diff --git a/.golangci.yml b/.golangci.yml index db84041..6a08fa0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -25,10 +25,11 @@ linters-settings: - FIXME gofumpt: extra-rules: true + decorder: + ignore-underscore-vars: true linters: enable-all: true - ignore-underscore-vars: true disable: - deadcode # deprecated - exhaustivestruct # deprecated diff --git a/docker-compose.yml b/docker-compose.yml index 0797529..59a6d8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: - "--providers.docker=true" - "--entrypoints.web.address=:80" - "--experimental.plugins.session-max-age.modulename=github.com/longbridgeapp/traefik-session-max-age" - - "--experimental.plugins.session-max-age.version=v0.1.2" + - "--experimental.plugins.session-max-age.version=v0.1.0" ports: - "80:80" - "8080:8080" diff --git a/max_age.go b/max_age.go index 5bb2d0c..3032285 100644 --- a/max_age.go +++ b/max_age.go @@ -1,3 +1,5 @@ +// Package traefik_session_max_age is a plugin for the Traefik reverse proxy +// that sets cookie's max-age package traefik_session_max_age import ( @@ -44,7 +46,7 @@ func (rww responseWriterWrapper) Write(b []byte) (int, error) { return rww.ResponseWriter.Write(b) } -// SessionMaxAge is a middleware for traefik middlware plugin to set cookie max age +// SessionMaxAge is a middleware for traefik middlware plugin to set cookie max age. type SessionMaxAge struct { next http.Handler cookieName string @@ -52,7 +54,7 @@ type SessionMaxAge struct { name string } -// New return a wrapped http.Handler +// New return a wrapped http.Handler. func New(ctx context.Context, next http.Handler, config *Config, name string) (http.Handler, error) { return &SessionMaxAge{ next: next,