Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AutoMigrate ¶
AutoMigrate runs the GORM auto-migration tool to ensure the database schema matches the internal storage models (e.g., storageSession, storageEvent).
NOTE: This function relies on a type assertion to the concrete *databaseService implementation. It will return an error if the provided session.Service is a different implementation.
func NewSessionService ¶
NewSessionService creates a new session.Service implementation that uses a relational database (e.g., PostgreSQL, Spanner, SQLite) via the GORM library.
It requires a gorm.Dialector to specify the database connection and accepts optional gorm.Option values for further GORM configuration.
It returns the new session.Service or an error if the database connection gorm.Open fails.
Types ¶
type LocalSession ¶
type LocalSession struct {
// contains filtered or unexported fields
}
TODO LocalSession is identical to session.session. Move to sessioninternal
func (*LocalSession) AppName ¶
func (s *LocalSession) AppName() string
func (*LocalSession) Events ¶
func (s *LocalSession) Events() session.Events
func (*LocalSession) ID ¶
func (s *LocalSession) ID() string
func (*LocalSession) LastUpdateTime ¶
func (s *LocalSession) LastUpdateTime() time.Time
func (*LocalSession) State ¶
func (s *LocalSession) State() session.State
func (*LocalSession) UserID ¶
func (s *LocalSession) UserID() string