Skip to content

Commit

Permalink
chore: move govern to server
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Oct 20, 2022
1 parent 4884a09 commit 6abdd1b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions pkg/ecode/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
package ecode

import (
"encoding/json"
"net/http"
"sync"

"github.com/douyu/jupiter/pkg/governor"
"github.com/douyu/jupiter/pkg/xlog"
spb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc/codes"
Expand All @@ -38,20 +35,6 @@ var (
OK = add(int(codes.OK), "OK")
)

func init() {
// status code list
governor.HandleFunc("/status/code/list", func(w http.ResponseWriter, r *http.Request) {
var rets = make(map[int]*spbStatus)
_codes.Range(func(key, val interface{}) bool {
code := key.(int)
status := val.(*spbStatus)
rets[code] = status
return true
})
_ = json.NewEncoder(w).Encode(rets)
})
}

// Add ...
func Add(code int, message string) *spbStatus {
if code > maxCustomizeCode {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6abdd1b

Please sign in to comment.