Documentation ¶
Index ¶
- type Meta
- type NewStoreOptions
- type Store
- func (st *Store) AutoMigrate() error
- func (st *Store) DriverName(db *sql.DB) string
- func (st *Store) EnableDebug(debug bool)
- func (st *Store) FindByKey(objectType string, objectID string, key string) (*Meta, error)
- func (st *Store) Get(objectType string, objectID string, key string, valueDefault string) (string, error)
- func (st *Store) GetJSON(objectType string, objectID string, key string, valueDefault interface{}) (interface{}, error)
- func (st *Store) Remove(objectType string, objectID string, key string) error
- func (st *Store) Set(objectType string, objectID string, key string, value string) error
- func (st *Store) SetJSON(objectType string, objectID string, key string, value interface{}) error
- func (st *Store) SqlCreateTable() string
- type StoreOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct { ID string `db:"id"` ObjectType string `db:"object_type"` ObjectID string `db:"object_id"` Key string `db:"meta_key"` Value string `db:"meta_value"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` DeletedAt *time.Time `db:"deleted_at"` }
Meta type
type NewStoreOptions ¶
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) Get ¶
func (st *Store) Get(objectType string, objectID string, key string, valueDefault string) (string, error)
Get gets a key from cache
func (*Store) GetJSON ¶
func (st *Store) GetJSON(objectType string, objectID string, key string, valueDefault interface{}) (interface{}, error)
GetJSON gets a JSON key from cache
func (*Store) SqlCreateTable ¶
SqlCreateTable returns a SQL string for creating the setting table
Click to show internal directories.
Click to hide internal directories.