Documentation ¶
Index ¶
- Variables
- func Insert(engine *xorm.Engine, data interface{}) error
- type Item
- type Options
- type SqlSvr
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(k string) error
- func (s *Store) GC()
- func (s *Store) Get(k string, v interface{}) (found bool, err error)
- func (s *Store) Has(k string) bool
- func (s *Store) Set(k string, v interface{}) error
- func (s *Store) SetEx(k string, v interface{}, expires time.Duration) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Item ¶
type Item struct { Key string `xorm:"varchar(64) not null pk id"` Data string `xorm:"varchar(256) not null data"` ExpiresAt time.Time `xorm:"datetime expiresAt"` CTime time.Time `xorm:"updated ctime"` Table string `xorm:"-"` Split bool `xorm:"-"` }
Item identifes a cached piece of data
type Options ¶
type Options struct { User string Pwd string Host string Db string Codec encoding.Codec Interval time.Duration TableName string Split bool }
options are the options for the mssql store.
type Store ¶
Store is a gokv.Store implementation for SQL databases.
func (*Store) Close ¶
Close closes the Store. It must be called to return all open connections to the connection pool and to release any open resources.
func (*Store) Delete ¶
Delete deletes the stored value for the given key. Deleting a non-existing key-value pair does NOT lead to an error. The key must not be "".
func (*Store) Get ¶
Get retrieves the stored value for the given key. You need to pass a pointer to the value, so in case of a struct the automatic unmarshalling can populate the fields of the object that v points to with the values of the retrieved object's values. If no value is found it returns (false, nil). The key must not be "" and the pointer must not be nil.