Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDatabaseSession ¶
NewDatabaseSession creates a new session in the database using default table names. For custom table names, use NewDatabaseSessionService with option functions.
func NewDatabaseSessionService ¶
NewDatabaseSessionService creates a new database-backed SessionService. By default it uses the table names "sessions" and "messages". Use Option functions such as WithTablePrefix, WithSessionsTable, or WithMessagesTable to customise the table names and avoid conflicts in shared databases. Returns an error if any configured table name is not a valid SQL identifier.
Types ¶
type Option ¶ added in v0.0.3
type Option func(*databaseSessionService)
Option is a functional option for configuring a DatabaseSessionService.
func WithMessagesTable ¶ added in v0.0.3
WithMessagesTable overrides the messages table name.
func WithSessionsTable ¶ added in v0.0.3
WithSessionsTable overrides the sessions table name.
func WithTablePrefix ¶ added in v0.0.3
WithTablePrefix sets a prefix for both the sessions and messages table names. For example, WithTablePrefix("myapp_") will use tables "myapp_sessions" and "myapp_messages".