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 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(logger *logging.Logger) (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 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
}
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.