Documentation ¶
Index ¶
- Constants
- type Log
- type NewStoreOptions
- type Store
- func (st *Store) AutoMigrate() error
- func (st *Store) Debug(message string) (bool, error)
- func (st *Store) DebugWithContext(message string, context interface{}) (bool, error)
- func (st *Store) DriverName(db *sql.DB) string
- func (st *Store) EnableDebug(debug bool)
- func (st *Store) Error(message string) (bool, error)
- func (st *Store) ErrorWithContext(message string, context interface{}) (bool, error)
- func (st *Store) Fatal(message string) (bool, error)
- func (st *Store) FatalWithContext(message string, context interface{}) (bool, error)
- func (st *Store) Info(message string) (bool, error)
- func (st *Store) InfoWithContext(message string, context interface{}) (bool, error)
- func (st *Store) Log(logEntry *Log) (bool, error)
- func (st *Store) Panic(message string)
- func (st *Store) PanicWithContext(message string, context interface{})
- func (st *Store) SqlCreateTable() string
- func (st *Store) Trace(message string) (bool, error)
- func (st *Store) TraceWithContext(message string, context interface{}) (bool, error)
- func (st *Store) Warn(message string) (bool, error)
- func (st *Store) WarnWithContext(message string, context interface{}) (bool, error)
Constants ¶
const ( // LevelTrace trace level LevelTrace = "trace" // LevelDebug debug level LevelDebug = "debug" // LevelError error level LevelError = "error" // LevelFatal fatal level LevelFatal = "fatal" // LevelInfo info level LevelInfo = "info" // LevelPanic panic level LevelPanic = "panic" // LevelWarning warning level LevelWarning = "warning" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewStoreOptions ¶ added in v1.3.0
type NewStoreOptions struct { LogTableName string DB *sql.DB DbDriverName string AutomigrateEnabled bool DebugEnabled bool }
NewStoreOptions define the options for creating a new session store
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store defines a session store
func NewStore ¶
func NewStore(opts NewStoreOptions) (*Store, error)
NewStore creates a new session store
func (*Store) DebugWithContext ¶
DebugWithContext adds a debug log with context data
func (*Store) DriverName ¶
DriverName finds the driver name from database
func (*Store) EnableDebug ¶
EnableDebug - enables the debug option
func (*Store) ErrorWithContext ¶
ErrorWithContext adds an error log with context data
func (*Store) FatalWithContext ¶
FatalWithContext adds a fatal log with context data and calls os.Exit(1) after logging
func (*Store) InfoWithContext ¶
InfoWithContext adds an info log with context data
func (*Store) PanicWithContext ¶
PanicWithContext adds a panic log with context data and calls panic(message) after logging
func (*Store) SqlCreateTable ¶
SqlCreateTable returns a SQL string for creating the setting table
func (*Store) TraceWithContext ¶
TraceWithContext adds a trace log with context data