From 9a2da81b11ad0064cca24ce7974827d032309369 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Mon, 1 May 2023 07:56:25 -0600 Subject: name change gus -> sliderule --- logging/middleware.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'logging/middleware.go') 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, -- cgit v1.2.3