Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultConnectionAddress defines the default connection address of the redis server DefaultConnectionAddress = ":6379" // DefaultMaxIdleConnections sets the maximum number of idle connections on the redis server DefaultMaxIdleConnections = 3 // DefaultMaxActiveConnections sets the maximum number of active connections on the redis server // DefaultMaxActiveConnections = 10 // changing this to 0, the uninitialized val, for now // DefaultIdleTimeoutDuration sets the maximum duration to wait before closing an idle connection on the redis server DefaultIdleTimeoutDuration = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { ConnectionAddress string MaxIdleConnections int MaxActiveConnections int IdleTimeoutDuration time.Duration }
Options defines the behavior of the session store
type Service ¶
Service is a session store backed by a redis db
func New ¶
New returns a new session store connected to a redis db Alternatively, you can build your own redis store with &Service{Pool: yourCustomPool,}
func (*Service) DeleteUserSession ¶
func (s *Service) DeleteUserSession(sessionID string) *sessionerrs.Custom
DeleteUserSession deletes a user session from the store
func (*Service) FetchValidUserSession ¶
FetchValidUserSession returns a valid user session or an err if the session has expired or does not exist
func (*Service) SaveUserSession ¶
func (s *Service) SaveUserSession(userSession *user.Session) *sessionerrs.Custom
SaveUserSession saves a user session in the store
type ServiceInterface ¶
type ServiceInterface interface { SaveUserSession(userSession *user.Session) *sessionerrs.Custom DeleteUserSession(sessionID string) *sessionerrs.Custom FetchValidUserSession(sessionID string) (*user.Session, *sessionerrs.Custom) }
ServiceInterface defines the behavior of the session store
Click to show internal directories.
Click to hide internal directories.