Documentation ¶
Index ¶
- func New(prefix string) cache.Store
- type Memory
- func (r *Memory) Add(key string, value any, seconds time.Duration) bool
- func (r *Memory) Connection(name string) cache.Store
- func (r *Memory) Flush() bool
- func (r *Memory) Forever(key string, value any) bool
- func (r *Memory) Forget(key string) bool
- func (r *Memory) Get(key string, def any) any
- func (r *Memory) GetBool(key string, def bool) bool
- func (r *Memory) GetInt(key string, def int) int
- func (r *Memory) GetString(key string, def string) string
- func (r *Memory) Has(key string) bool
- func (r *Memory) Pull(key string, def any) any
- func (r *Memory) Put(key string, value any, seconds time.Duration) error
- func (r *Memory) Remember(key string, ttl time.Duration, callback func() any) (any, error)
- func (r *Memory) RememberForever(key string, callback func() any) (any, error)
- func (r *Memory) WithContext(ctx context.Context) cache.Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Memory ¶
type Memory struct { Prefix string Client contractStorage.Storage }
func (*Memory) Remember ¶
Remember Get an item from the cache, or execute the given Closure and store the result.
func (*Memory) RememberForever ¶
RememberForever Get an item from the cache, or execute the given Closure and store the result forever.
Click to show internal directories.
Click to hide internal directories.