Documentation ¶
Index ¶
- Constants
- Variables
- func NewLocalCache(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- type CacheManager
- type LocalCache
- func (l *LocalCache) Clear(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Delete(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Exist(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Filter(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) FilterKey(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Get(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Set(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) SetWithTTL(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func (l *LocalCache) Struct() *starlarkstruct.Struct
- type Store
- func (s *Store) Clear(prefix []byte) error
- func (s *Store) Close() error
- func (s *Store) Delete(k []byte) error
- func (s *Store) Exist(k []byte) bool
- func (s *Store) Filter(prefix []byte) (map[string][]byte, error)
- func (s *Store) FilterKey(prefix []byte) (keys [][]byte, err error)
- func (s *Store) Get(k []byte) ([]byte, error)
- func (s *Store) Set(k, v []byte) error
- func (s *Store) SetWithTTL(k, v []byte, duration time.Duration) error
Constants ¶
View Source
const ModuleName = "localcache.star"
View Source
const Name = "localcache"
Variables ¶
View Source
var Module = &starlarkstruct.Module{ Name: "localcache", Members: starlark.StringDict{ "new": localctx.AddBuiltin("localcache.new", NewLocalCache), }, }
Functions ¶
Types ¶
type CacheManager ¶
type CacheManager struct {
// contains filtered or unexported fields
}
localCache singleton cache
func (*CacheManager) GetByDir ¶
func (c *CacheManager) GetByDir(dir string) *LocalCache
type LocalCache ¶
type LocalCache struct {
// contains filtered or unexported fields
}
func (*LocalCache) SetWithTTL ¶
func (*LocalCache) Struct ¶
func (l *LocalCache) Struct() *starlarkstruct.Struct
Click to show internal directories.
Click to hide internal directories.