Documentation ¶
Index ¶
- type Cache
- type NewStoreOptions
- type Store
- func (st *Store) AutoMigrate() error
- func (st *Store) DriverName(db *sql.DB) string
- func (st *Store) EnableDebug(debugEnabled bool)
- func (st *Store) ExpireCacheGoroutine() error
- func (st *Store) FindByKey(key string) (*Cache, error)
- func (st *Store) Get(key string, valueDefault string) (string, error)
- func (st *Store) GetJSON(key string, valueDefault interface{}) (interface{}, error)
- func (st *Store) Remove(key string) error
- func (st *Store) SQLCreateTable() string
- func (st *Store) Set(key string, value string, seconds int64) error
- func (st *Store) SetJSON(key string, value interface{}, seconds int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { ID string `db:"id"` Key string `db:"cache_key"` Value string `db:"cache_value"` ExpiresAt *time.Time `db:"expires_at"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
Cache type
type NewStoreOptions ¶ added in v0.15.0
type NewStoreOptions struct { CacheTableName string DB *sql.DB DbDriverName string TimeoutSeconds int64 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 entity store
func (*Store) DriverName ¶
DriverName finds the driver name from database
func (*Store) EnableDebug ¶
EnableDebug - enables the debug option
func (*Store) ExpireCacheGoroutine ¶
ExpireCacheGoroutine - soft deletes expired cache
func (*Store) SQLCreateTable ¶
SQLCreateTable returns a SQL string for creating the cache table
Click to show internal directories.
Click to hide internal directories.