Skip to content

Commit

Permalink
Bump up rk-entry version to v2.2.10 & switch path to filepath in codes
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxuny committed Nov 1, 2022
1 parent 1969046 commit 2147856
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions boot/mux_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
"net"
"net/http"
"net/http/pprof"
"path"
"path/filepath"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -120,7 +120,7 @@ type MuxEntry struct {

// RegisterMuxEntryYAML register Mux entries with provided config file (Must YAML file).
//
// Currently, support two ways to provide config file path.
// Currently, support two ways to provide config file filepath.
// 1: With function parameters
// 2: With command line flag "--rkboot" described in rkcommon.BootConfigPathFlagKey (Will override function parameter if exists)
// Command line flag has high priority which would override function parameter
Expand Down Expand Up @@ -398,16 +398,16 @@ func (entry *MuxEntry) Bootstrap(ctx context.Context) {
})

entry.Router.NewRoute().Methods(http.MethodGet).Path(entry.PProfEntry.Path).HandlerFunc(pprof.Index)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "cmdline")).HandlerFunc(pprof.Cmdline)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "profile")).HandlerFunc(pprof.Profile)
entry.Router.NewRoute().Methods(http.MethodGet, http.MethodPost).Path(path.Join(entry.PProfEntry.Path, "symbol")).HandlerFunc(pprof.Symbol)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "trace")).HandlerFunc(pprof.Trace)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "allocs")).HandlerFunc(pprof.Handler("allocs").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "block")).HandlerFunc(pprof.Handler("block").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "goroutine")).HandlerFunc(pprof.Handler("goroutine").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "heap")).HandlerFunc(pprof.Handler("heap").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "mutex")).HandlerFunc(pprof.Handler("mutex").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(path.Join(entry.PProfEntry.Path, "threadcreate")).HandlerFunc(pprof.Handler("threadcreate").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "cmdline")).HandlerFunc(pprof.Cmdline)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "profile")).HandlerFunc(pprof.Profile)
entry.Router.NewRoute().Methods(http.MethodGet, http.MethodPost).Path(filepath.Join(entry.PProfEntry.Path, "symbol")).HandlerFunc(pprof.Symbol)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "trace")).HandlerFunc(pprof.Trace)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "allocs")).HandlerFunc(pprof.Handler("allocs").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "block")).HandlerFunc(pprof.Handler("block").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "goroutine")).HandlerFunc(pprof.Handler("goroutine").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "heap")).HandlerFunc(pprof.Handler("heap").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "mutex")).HandlerFunc(pprof.Handler("mutex").ServeHTTP)
entry.Router.NewRoute().Methods(http.MethodGet).Path(filepath.Join(entry.PProfEntry.Path, "threadcreate")).HandlerFunc(pprof.Handler("threadcreate").ServeHTTP)
entry.PProfEntry.Bootstrap(ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/golang-jwt/jwt/v4 v4.4.2
github.com/gorilla/mux v1.8.0
github.com/prometheus/client_golang v1.12.2
github.com/rookie-ninja/rk-entry/v2 v2.2.9
github.com/rookie-ninja/rk-entry/v2 v2.2.10
github.com/rookie-ninja/rk-logger v1.2.12
github.com/rookie-ninja/rk-query v1.2.14
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rookie-ninja/rk-entry/v2 v2.2.9 h1:dp3ziwWCeNbUAdxmWK7CPSoYCtLxdfEFfqJCOtn46yA=
github.com/rookie-ninja/rk-entry/v2 v2.2.9/go.mod h1:+gvLV+G0Bnu6xlZsRRN4U8r6OXRPlxEIfxGOxdyFQNY=
github.com/rookie-ninja/rk-entry/v2 v2.2.10 h1:FgHIGoKTSoTsKjD/gc7PfCQCbtF8+4DWRIPuF3ofi9o=
github.com/rookie-ninja/rk-entry/v2 v2.2.10/go.mod h1:+gvLV+G0Bnu6xlZsRRN4U8r6OXRPlxEIfxGOxdyFQNY=
github.com/rookie-ninja/rk-logger v1.2.11/go.mod h1:0ZiGn1KsHKOmCv+FHMH7k40DWYSJcj5yIR3EYcjlnLs=
github.com/rookie-ninja/rk-logger v1.2.12 h1:eQHP7hDW/zFeDCoGUV3Mu8Ot72+7c+Cy0Tuxauir5a8=
github.com/rookie-ninja/rk-logger v1.2.12/go.mod h1:0ZiGn1KsHKOmCv+FHMH7k40DWYSJcj5yIR3EYcjlnLs=
Expand Down

0 comments on commit 2147856

Please sign in to comment.