Compare commits
2 Commits
f201ac1fca
...
82c08a7bc3
Author | SHA1 | Date | |
---|---|---|---|
82c08a7bc3 | |||
a8f62858e0 |
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module gitea.libretechconsulting.com/rmcguire/ambient-local-exporter
|
|||||||
go 1.24.1
|
go 1.24.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gitea.libretechconsulting.com/rmcguire/go-app v0.9.0
|
gitea.libretechconsulting.com/rmcguire/go-app v0.9.1
|
||||||
github.com/go-resty/resty/v2 v2.16.5
|
github.com/go-resty/resty/v2 v2.16.5
|
||||||
github.com/gorilla/schema v1.4.1
|
github.com/gorilla/schema v1.4.1
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3
|
||||||
|
2
go.sum
2
go.sum
@ -8,6 +8,8 @@ gitea.libretechconsulting.com/rmcguire/go-app v0.8.1 h1:pnmFJnY77dsh84zvVcHqFuQg
|
|||||||
gitea.libretechconsulting.com/rmcguire/go-app v0.8.1/go.mod h1:W6YHFSGf4nJrgs9DqEaw+3J6ufIARsr1zpOs/V6gRTQ=
|
gitea.libretechconsulting.com/rmcguire/go-app v0.8.1/go.mod h1:W6YHFSGf4nJrgs9DqEaw+3J6ufIARsr1zpOs/V6gRTQ=
|
||||||
gitea.libretechconsulting.com/rmcguire/go-app v0.9.0 h1:ZOBdVk2EehGCX6K3pdT5Dy07bMiUR7VTifE+n0ODfak=
|
gitea.libretechconsulting.com/rmcguire/go-app v0.9.0 h1:ZOBdVk2EehGCX6K3pdT5Dy07bMiUR7VTifE+n0ODfak=
|
||||||
gitea.libretechconsulting.com/rmcguire/go-app v0.9.0/go.mod h1:W6YHFSGf4nJrgs9DqEaw+3J6ufIARsr1zpOs/V6gRTQ=
|
gitea.libretechconsulting.com/rmcguire/go-app v0.9.0/go.mod h1:W6YHFSGf4nJrgs9DqEaw+3J6ufIARsr1zpOs/V6gRTQ=
|
||||||
|
gitea.libretechconsulting.com/rmcguire/go-app v0.9.1 h1:QihWX1YeCqttpAjXq6nHWvNk1MpIhuW8bSO3G+fbsRg=
|
||||||
|
gitea.libretechconsulting.com/rmcguire/go-app v0.9.1/go.mod h1:W6YHFSGf4nJrgs9DqEaw+3J6ufIARsr1zpOs/V6gRTQ=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
|
@ -9,25 +9,9 @@ import (
|
|||||||
|
|
||||||
func (aw *AmbientWeather) GetGatewayOpts() []runtime.ServeMuxOption {
|
func (aw *AmbientWeather) GetGatewayOpts() []runtime.ServeMuxOption {
|
||||||
return []runtime.ServeMuxOption{
|
return []runtime.ServeMuxOption{
|
||||||
runtime.WithMiddlewares(func(hf runtime.HandlerFunc) runtime.HandlerFunc {
|
runtime.WithErrorHandler(func(ctx context.Context, sm *runtime.ServeMux, m runtime.Marshaler, w http.ResponseWriter, req *http.Request, err error) {
|
||||||
return func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
|
aw.GetLogger().Err(err).Msg("error handling gateway request")
|
||||||
aw.GetLogger().Trace().
|
runtime.DefaultHTTPErrorHandler(ctx, sm, m, w, req, err)
|
||||||
Any("pathParams", pathParams).
|
|
||||||
Msg("inbound request called")
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
runtime.WithRoutingErrorHandler(
|
|
||||||
func(
|
|
||||||
ctx context.Context, mux *runtime.ServeMux, mshl runtime.Marshaler,
|
|
||||||
w http.ResponseWriter, r *http.Request, code int,
|
|
||||||
) {
|
|
||||||
aw.GetLogger().Trace().
|
|
||||||
Int("code", code).
|
|
||||||
Str("pattern", r.Pattern).
|
|
||||||
Msg("requesting grpc-gateway route")
|
|
||||||
|
|
||||||
// Pass back to default
|
|
||||||
runtime.DefaultRoutingErrorHandler(ctx, mux, mshl, w, r, code)
|
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user