Documentation
¶
Index ¶
- Constants
- Variables
- func Clear(prefixs ...string) error
- func ClearAll() error
- func ClearAllFrom(conn 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 Key(parts ...any) string
- func KeyWith(sep string, parts ...any) string
- 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 ResetStats()
- func Sequence(key string, start, step int64, expires ...time.Duration) (int64, error)
- func SequenceMany(key string, start, step, count int64, expires ...time.Duration) ([]int64, error)
- func SequenceManyOn(conn, key string, start, step, count 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 ManyConnect
- type Module
- func (m *Module) Clear(prefixs ...string) error
- func (m *Module) ClearAll() error
- func (m *Module) ClearAllFrom(conn string) error
- func (m *Module) ClearFrom(conn string, prefixs ...string) error
- func (m *Module) Close()
- func (m *Module) Config(global Map)
- func (m *Module) Delete(key string) error
- func (m *Module) DeleteFrom(conn, key string) error
- func (m *Module) Exists(key string) (bool, error)
- func (m *Module) ExistsIn(conn, key string) (bool, error)
- func (m *Module) Keys(prefixs ...string) ([]string, error)
- func (m *Module) KeysFrom(conn string, prefixs ...string) ([]string, error)
- func (m *Module) Open()
- func (m *Module) Read(key string) (Map, error)
- func (m *Module) ReadData(key string) ([]byte, error)
- func (m *Module) ReadDataFrom(conn, key string) ([]byte, error)
- func (m *Module) ReadFrom(conn, key string) (Map, error)
- func (m *Module) Register(name string, value Any)
- func (m *Module) RegisterConfig(name string, config Config)
- func (m *Module) RegisterConfigs(configs Configs)
- func (m *Module) RegisterDriver(name string, driver Driver)
- func (m *Module) ResetStats()
- func (m *Module) Sequence(key string, start, step int64, expires ...time.Duration) (int64, error)
- func (m *Module) SequenceMany(key string, start, step, count int64, expires ...time.Duration) ([]int64, error)
- func (m *Module) SequenceManyOn(conn, key string, start, step, count int64, expires ...time.Duration) ([]int64, error)
- func (m *Module) SequenceOn(conn, key string, start, step int64, expires ...time.Duration) (int64, error)
- func (m *Module) Setup()
- func (m *Module) Start()
- func (m *Module) Stats() Statistics
- func (m *Module) StatsFrom(conn string) (Statistics, error)
- func (m *Module) Stop()
- func (m *Module) Write(key string, val Map, expires ...time.Duration) error
- func (m *Module) WriteData(key string, data []byte, expires ...time.Duration) error
- func (m *Module) WriteDataTo(conn, key string, data []byte, expires ...time.Duration) error
- func (m *Module) WriteTo(conn string, key string, val Map, expires ...time.Duration) error
- type Statistics
Constants ¶
View Source
const NAME = "CACHE"
Variables ¶
View Source
var ErrInvalidConnection = errors.New("Invalid cache connection.")
View Source
var ErrUnsafeClear = errors.New("Unsafe cache clear blocked.")
Functions ¶
func ClearAllFrom ¶ added in v0.26.0
func DeleteFrom ¶
func ReadDataFrom ¶
func ResetStats ¶ added in v0.26.0
func ResetStats()
func SequenceMany ¶ added in v0.26.0
func SequenceManyOn ¶ added in v0.26.0
func SequenceOn ¶
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
}
type ManyConnect ¶ added in v0.26.0
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) ClearAllFrom ¶ added in v0.26.0
func (*Module) DeleteFrom ¶
func (*Module) RegisterConfig ¶ added in v0.7.0
func (*Module) RegisterConfigs ¶ added in v0.7.0
func (*Module) RegisterDriver ¶ added in v0.7.0
func (*Module) ResetStats ¶ added in v0.26.0
func (m *Module) ResetStats()
func (*Module) SequenceMany ¶ added in v0.26.0
func (*Module) SequenceManyOn ¶ added in v0.26.0
func (*Module) SequenceOn ¶
func (*Module) Stats ¶ added in v0.26.0
func (m *Module) Stats() Statistics
func (*Module) StatsFrom ¶ added in v0.26.0
func (m *Module) StatsFrom(conn string) (Statistics, error)
func (*Module) WriteDataTo ¶
type Statistics ¶ added in v0.26.0
type Statistics struct {
Read uint64
Write uint64
Delete uint64
Exists uint64
Keys uint64
Clear uint64
Sequence uint64
SequenceMany uint64
Hit uint64
Miss uint64
Error uint64
Instances map[string]Statistics
}
func Stats ¶ added in v0.26.0
func Stats() Statistics
func StatsFrom ¶ added in v0.26.0
func StatsFrom(conn string) (Statistics, error)
Click to show internal directories.
Click to hide internal directories.