Documentation
¶
Overview ¶
Package boltSession provides a Service that is using local BoltDB database to store Session data.
Index ¶
- func NewDB(filename string, fileMode os.FileMode, boltOptions *bolt.Options) (db *bolt.DB, err error)
- type Logger
- type Service
- func (s Service) CreateSession(o *session.Options) (*session.Session, error)
- func (s Service) DataDump(ifModifiedSince *time.Time) (dump *dataDump.Dump, err error)
- func (s Service) DeleteSession(id string) error
- func (s Service) PeriodicCleanup() (err error)
- func (s Service) Session(id string) (*session.Session, error)
- func (s Service) UpdateSession(id string, o *session.Options) (*session.Session, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶ added in v0.4.1
type Logger interface { Debug(a ...interface{}) Debugf(format string, a ...interface{}) Info(a ...interface{}) Errorf(format string, a ...interface{}) }
Logger defines interface for logging messages with various severity levels.
type Service ¶
type Service struct { DB *bolt.DB // DefaultLifetime is a period how long a session is valid if // no MaxTime is provided. DefaultLifetime time.Duration // CleanupPeriod defines a period on which deletion of expired // session is executed. CleanupPeriod time.Duration Logger Logger }
Service implements gopherpit.com/gopherpit/services/session.Service interface.
func (Service) CreateSession ¶
CreateSession creates a new Session in a BoltDB database.
func (Service) DataDump ¶ added in v0.2.1
DataDump implements dataDump.Interface interface to extract database data in a safe and reliable way.
func (Service) DeleteSession ¶
DeleteSession deletes an existing Session.
func (Service) PeriodicCleanup ¶
PeriodicCleanup deletes expired session on a period defined in Service.CleanupPeriod.
Click to show internal directories.
Click to hide internal directories.