Documentation ¶
Index ¶
- func MustStore(cfg Config, dialect string, args ...interface{}) session.ManagerStore
- func MustStoreWithDB(db *gorm.DB, tableName string, gcInterval int) session.ManagerStore
- func NewStore(cfg Config, dialect string, args ...interface{}) (session.ManagerStore, error)
- func NewStoreWithDB(db *gorm.DB, tableName string, gcInterval int) (session.ManagerStore, error)
- type Config
- type SessionItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustStore ¶
func MustStore(cfg Config, dialect string, args ...interface{}) session.ManagerStore
MustStore Create an instance of a gorm store(Throw a panic if an error occurs)
func MustStoreWithDB ¶
MustStoreWithDB Create an instance of a gorm store(Throw a panic if an error occurs)
func NewStore ¶
func NewStore(cfg Config, dialect string, args ...interface{}) (session.ManagerStore, error)
NewStore Create an instance of a gorm store
func NewStoreWithDB ¶
NewStoreWithDB Create an instance of a gorm store, tableName Specify the stored table name (default session), gcInterval Time interval for executing GC (in seconds, default 600)
Types ¶
type Config ¶
type Config struct { Debug bool // start debug mode ConnMaxLifetime time.Duration // sets the maximum amount of time a connection may be reused MaxOpenConns int // sets the maximum number of open connections to the database MaxIdleConns int // sets the maximum number of connections in the idle connection pool TableName string // Specify the stored table name (default session) GCInterval int // Time interval for executing GC (in seconds, default 600) }
Config configuration parameter
Click to show internal directories.
Click to hide internal directories.