diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-05-01 07:56:25 -0600 |
commit | 9a2da81b11ad0064cca24ce7974827d032309369 (patch) | |
tree | 4313224dc089208423e78bffc3ec50833e35bcea /logging/middleware.go | |
parent | 21e2758145d100d74013060f7090d84679cae683 (diff) |
name change gus -> sliderule
Diffstat (limited to 'logging/middleware.go')
-rw-r--r-- | logging/middleware.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/logging/middleware.go b/logging/middleware.go index 4e23c1e..3b68c15 100644 --- a/logging/middleware.go +++ b/logging/middleware.go @@ -6,12 +6,12 @@ import ( "io" "time" - "tildegit.org/tjp/gus" + sr "tildegit.org/tjp/sliderule" ) -func LogRequests(logger Logger) gus.Middleware { - return func(inner gus.Handler) gus.Handler { - return gus.HandlerFunc(func(ctx context.Context, request *gus.Request) *gus.Response { +func LogRequests(logger Logger) sr.Middleware { + return func(inner sr.Handler) sr.Handler { + return sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response { response := inner.Handle(ctx, request) if response != nil { response.Body = loggingBody(logger, request, response) @@ -23,8 +23,8 @@ func LogRequests(logger Logger) gus.Middleware { } type loggedResponseBody struct { - request *gus.Request - response *gus.Response + request *sr.Request + response *sr.Response body io.Reader start time.Time @@ -81,7 +81,7 @@ func (lwtr loggedWriteToResponseBody) WriteTo(dst io.Writer) (int64, error) { return n, err } -func loggingBody(logger Logger, request *gus.Request, response *gus.Response) io.Reader { +func loggingBody(logger Logger, request *sr.Request, response *sr.Response) io.Reader { body := &loggedResponseBody{ request: request, response: response, |