From 9d5a2b02cc5094b7f111322e6d0fbb82157cf014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Gaud=C3=A9?= Date: Fri, 7 Dec 2018 20:40:23 +0100 Subject: [PATCH] Add gorilla session provider --- session/gorilla/provider.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 session/gorilla/provider.go diff --git a/session/gorilla/provider.go b/session/gorilla/provider.go new file mode 100644 index 0000000..0cce1f7 --- /dev/null +++ b/session/gorilla/provider.go @@ -0,0 +1,16 @@ +package gorilla + +import ( + "forge.cadoles.com/wpetit/goweb/service" + "github.com/gorilla/sessions" +) + +// ServiceProvider returns a service.Provider for the +// the gorilla session service implementation +func ServiceProvider(sessionName string, store sessions.Store, defaultOptions *sessions.Options) service.Provider { + sessionService := NewSessionService(sessionName, store, defaultOptions) + + return func(container *service.Container) (interface{}, error) { + return sessionService, nil + } +}