goweb/session/gorilla/provider.go

17 lines
492 B
Go
Raw Normal View History

2018-12-07 20:40:23 +01:00
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
}
}