Documentation
¶
Index ¶
- Constants
- Variables
- func Clear(prefixs ...string) error
- func ClearFrom(conn string, prefixs ...string) error
- func Delete(key string) error
- func DeleteFrom(conn, key string) error
- func Exists(key string) (bool, error)
- func ExistsIn(conn, key string) (bool, error)
- func Keys(prefixs ...string) ([]string, error)
- func KeysFrom(conn string, prefixs ...string) ([]string, error)
- func Read(key string) (Map, error)
- func ReadData(key string) ([]byte, error)
- func ReadDataFrom(conn, key string) ([]byte, error)
- func ReadFrom(conn, key string) (Map, error)
- func Sequence(key string, start, step int64, expires ...time.Duration) (int64, error)
- func SequenceOn(conn, key string, start, step int64, expires ...time.Duration) (int64, error)
- func Write(key string, value Map, expires ...time.Duration) error
- func WriteData(key string, data []byte, expires ...time.Duration) error
- func WriteDataTo(conn, key string, data []byte, expires ...time.Duration) error
- func WriteTo(conn, key string, value Map, expires ...time.Duration) error
- type Config
- type Configs
- type Connect
- type Driver
- type Instance
- type Module
- func (this *Module) Clear(prefixs ...string) error
- func (this *Module) ClearFrom(conn string, prefixs ...string) error
- func (this *Module) Config(name string, config Config)
- func (this *Module) Configs(name string, config Configs)
- func (this *Module) Configure(global Map)
- func (this *Module) Connect()
- func (this *Module) Delete(key string) error
- func (this *Module) DeleteFrom(conn, key string) error
- func (this *Module) Driver(name string, driver Driver)
- func (this *Module) Exists(key string) (bool, error)
- func (this *Module) ExistsIn(conn, key string) (bool, error)
- func (this *Module) Initialize()
- func (this *Module) Keys(prefixs ...string) ([]string, error)
- func (this *Module) KeysFrom(conn string, prefixs ...string) ([]string, error)
- func (this *Module) Launch()
- func (this *Module) Read(key string) (Map, error)
- func (this *Module) ReadData(key string) ([]byte, error)
- func (this *Module) ReadDataFrom(conn, key string) ([]byte, error)
- func (this *Module) ReadFrom(conn, key string) (Map, error)
- func (this *Module) Register(name string, value Any)
- func (this *Module) Sequence(key string, start, step int64, expires ...time.Duration) (int64, error)
- func (this *Module) SequenceOn(conn, key string, start, step int64, expires ...time.Duration) (int64, error)
- func (this *Module) Terminate()
- func (this *Module) Write(key string, val Map, expires ...time.Duration) error
- func (this *Module) WriteData(key string, data []byte, expires ...time.Duration) error
- func (this *Module) WriteDataTo(conn, key string, data []byte, expires ...time.Duration) error
- func (this *Module) WriteTo(conn string, key string, val Map, expires ...time.Duration) error
Constants ¶
View Source
const (
NAME = "CACHE"
)
Variables ¶
View Source
var (
ErrInvalidConnection = errors.New("Invalid cache connection.")
)
Functions ¶
func SequenceOn ¶
SequenceOn 指定库生成序列
func WriteDataTo ¶
WriteDataTo 指定库写缓存原始数据
Types ¶
type Connect ¶
type Connect interface {
Open() error
Close() error
Read(string) ([]byte, error)
Write(key string, val []byte, expire time.Duration) error
Exists(key string) (bool, error)
Delete(key string) error
Sequence(key string, start, step int64, expire time.Duration) (int64, error)
Keys(prefix string) ([]string, error)
Clear(prefix string) error
}
Connect 会话连接
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) Initialize ¶
func (this *Module) Initialize()
func (*Module) ReadDataFrom ¶
ReadDataFrom 从指定库读原始数据
func (*Module) Sequence ¶
func (this *Module) Sequence(key string, start, step int64, expires ...time.Duration) (int64, error)
Sequence 生成编号
func (*Module) SequenceOn ¶
func (this *Module) SequenceOn(conn, key string, start, step int64, expires ...time.Duration) (int64, error)
SequenceOn 指定库生成编号
func (*Module) WriteDataTo ¶
Click to show internal directories.
Click to hide internal directories.