diff --git a/boot/echo_entry.go b/boot/echo_entry.go index 3d181fb..09c0626 100644 --- a/boot/echo_entry.go +++ b/boot/echo_entry.go @@ -46,7 +46,7 @@ import ( "go.uber.org/zap" "net/http" "net/http/pprof" - "path" + "path/filepath" "strconv" "strings" "sync" @@ -378,7 +378,7 @@ func (entry *EchoEntry) Bootstrap(ctx context.Context) { ctx.Redirect(http.StatusTemporaryRedirect, entry.SwEntry.Path) return nil }) - entry.Echo.GET(path.Join(entry.SwEntry.Path, "*"), echo.WrapHandler(entry.SwEntry.ConfigFileHandler())) + entry.Echo.GET(filepath.Join(entry.SwEntry.Path, "*"), echo.WrapHandler(entry.SwEntry.ConfigFileHandler())) entry.SwEntry.Bootstrap(ctx) } @@ -389,7 +389,7 @@ func (entry *EchoEntry) Bootstrap(ctx context.Context) { ctx.Redirect(http.StatusTemporaryRedirect, entry.DocsEntry.Path) return nil }) - entry.Echo.GET(path.Join(entry.DocsEntry.Path, "*"), echo.WrapHandler(entry.DocsEntry.ConfigFileHandler())) + entry.Echo.GET(filepath.Join(entry.DocsEntry.Path, "*"), echo.WrapHandler(entry.DocsEntry.ConfigFileHandler())) entry.DocsEntry.Bootstrap(ctx) } @@ -403,7 +403,7 @@ func (entry *EchoEntry) Bootstrap(ctx context.Context) { }) // Register path into Router. - entry.Echo.GET(path.Join(entry.StaticFileEntry.Path, "*"), echo.WrapHandler(entry.StaticFileEntry.GetFileHandler())) + entry.Echo.GET(filepath.Join(entry.StaticFileEntry.Path, "*"), echo.WrapHandler(entry.StaticFileEntry.GetFileHandler())) entry.StaticFileEntry.Bootstrap(ctx) } @@ -419,16 +419,16 @@ func (entry *EchoEntry) Bootstrap(ctx context.Context) { // Is pprof enabled? if entry.IsPProfEnabled() { entry.Echo.GET(entry.PProfEntry.Path, echo.WrapHandler(http.HandlerFunc(pprof.Index))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "cmdline"), echo.WrapHandler(http.HandlerFunc(pprof.Cmdline))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "profile"), echo.WrapHandler(http.HandlerFunc(pprof.Profile))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "symbol"), echo.WrapHandler(http.HandlerFunc(pprof.Symbol))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "trace"), echo.WrapHandler(http.HandlerFunc(pprof.Trace))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "allocs"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("allocs").ServeHTTP))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "block"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("block").ServeHTTP))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "goroutine"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("goroutine").ServeHTTP))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "heap"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("heap").ServeHTTP))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "mutex"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("mutex").ServeHTTP))) - entry.Echo.GET(path.Join(entry.PProfEntry.Path, "threadcreate"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("threadcreate").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "cmdline"), echo.WrapHandler(http.HandlerFunc(pprof.Cmdline))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "profile"), echo.WrapHandler(http.HandlerFunc(pprof.Profile))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "symbol"), echo.WrapHandler(http.HandlerFunc(pprof.Symbol))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "trace"), echo.WrapHandler(http.HandlerFunc(pprof.Trace))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "allocs"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("allocs").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "block"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("block").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "goroutine"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("goroutine").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "heap"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("heap").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "mutex"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("mutex").ServeHTTP))) + entry.Echo.GET(filepath.Join(entry.PProfEntry.Path, "threadcreate"), echo.WrapHandler(http.HandlerFunc(pprof.Handler("threadcreate").ServeHTTP))) } // Start echo server diff --git a/go.mod b/go.mod index e3035fc..c3e02fd 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.17 require ( github.com/golang-jwt/jwt/v4 v4.4.2 - github.com/labstack/echo/v4 v4.7.2 + github.com/labstack/echo/v4 v4.9.1 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/rs/xid v1.3.0 @@ -30,7 +30,7 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/labstack/gommon v0.3.1 // indirect + github.com/labstack/gommon v0.4.0 // indirect github.com/magiconair/properties v1.8.6 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect diff --git a/go.sum b/go.sum index 43965e7..159c7be 100644 --- a/go.sum +++ b/go.sum @@ -320,10 +320,10 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.7.2 h1:Kv2/p8OaQ+M6Ex4eGimg9b9e6icoxA42JSlOR3msKtI= -github.com/labstack/echo/v4 v4.7.2/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks= -github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o= -github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= +github.com/labstack/echo/v4 v4.9.1 h1:GliPYSpzGKlyOhqIbG8nmHBo3i1saKWFOgh41AN3b+Y= +github.com/labstack/echo/v4 v4.9.1/go.mod h1:Pop5HLc+xoc4qhTZ1ip6C0RtP7Z+4VzRLWZZFKqbbjo= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -418,8 +418,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=