From 4eb35078b9c6005e8c46d061e4d0befe619df93b Mon Sep 17 00:00:00 2001 From: tsmethurst Date: Thu, 25 Mar 2021 20:10:27 +0100 Subject: [PATCH] rename r router --- internal/router/router.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/router/router.go b/internal/router/router.go index 779a91d..cab7fa7 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -62,23 +62,23 @@ func (r *router) Start() { } // Stop shuts down the router nicely -func (s *router) Stop(ctx context.Context) error { - return s.srv.Shutdown(ctx) +func (r *router) Stop(ctx context.Context) error { + return r.srv.Shutdown(ctx) } // AttachHandler attaches the given gin.HandlerFunc to the router with the specified method and path. // If the path is set to ANY, then the handlerfunc will be used for ALL methods at its given path. -func (s *router) AttachHandler(method string, path string, handler gin.HandlerFunc) { +func (r *router) AttachHandler(method string, path string, handler gin.HandlerFunc) { if method == "ANY" { - s.engine.Any(path, handler) + r.engine.Any(path, handler) } else { - s.engine.Handle(method, path, handler) + r.engine.Handle(method, path, handler) } } // AttachMiddleware attaches a gin middleware to the router that will be used globally -func (s *router) AttachMiddleware(middleware gin.HandlerFunc) { - s.engine.Use(middleware) +func (r *router) AttachMiddleware(middleware gin.HandlerFunc) { + r.engine.Use(middleware) } // New returns a new Router with the specified configuration, using the given logrus logger.