Get
should return a value RVV-A0006672// @Success 200 {object} response.StoresInfo
673// @Failure 500 {string} string "PD server failed to proceed the request."
674// @Router /stores/check [get]
675func (h *storesHandler) GetStoresByState(w http.ResponseWriter, r *http.Request) {676 rc := getCluster(r)
677 stores := rc.GetMetaStores()
678 StoresInfo := &response.StoresInfo{
635// @Failure 500 {string} string "PD server failed to proceed the request."
636// @Router /stores [get]
637// @Deprecated Better to use /stores/check instead.
638func (h *storesHandler) GetAllStores(w http.ResponseWriter, r *http.Request) {639 rc := getCluster(r)
640 stores := rc.GetMetaStores()
641 StoresInfo := &response.StoresInfo{
584// @Failure 400 {string} string "The input is invalid."
585// @Failure 500 {string} string "PD server failed to proceed the request."
586// @Router /stores/progress [get]
587func (h *storesHandler) GetStoresProgress(w http.ResponseWriter, r *http.Request) {588 if v := r.URL.Query().Get("id"); v != "" {
589 storeID, err := strconv.ParseUint(v, 10, 64)
590 if err != nil {
557// @Produce json
558// @Success 200 {string} string "Get store limit scene successfully."
559// @Router /stores/limit/scene [get]
560func (h *storesHandler) GetStoreLimitScene(w http.ResponseWriter, r *http.Request) {561 typeName := r.URL.Query().Get("type")
562 typeValue, err := parseStoreLimitType(typeName)
563 if err != nil {
496// @Success 200 {object} string
497// @Failure 500 {string} string "PD server failed to proceed the request."
498// @Router /stores/limit [get]
499func (h *storesHandler) GetAllStoresLimit(w http.ResponseWriter, r *http.Request) {500 cfg := h.GetScheduleConfig()
501 if version := cfg.StoreLimitVersion; version != storelimit.VersionV1 {
502 h.rd.JSON(w, http.StatusBadRequest, fmt.Sprintf("current store limit version:%s not support get limit", version))
Typically, functions with names prefixed with Get are supposed to return a value.
func GetData(n int) {
fmt.Println(10 - n)
}
func GetData(n int) int {
fmt.Println(10 - n)
return 10 - n
}