Documentation
¶
Overview ¶
Package knife 提供了 context.Context 上的缓存。
Index ¶
- func Copy(src context.Context, keys ...string) (context.Context, error)
- func Delete(ctx context.Context, key string)
- func Load(ctx context.Context, key string) (interface{}, error)
- func LoadOrStore(ctx context.Context, key string, val interface{}) (actual interface{}, loaded bool, err error)
- func New(ctx context.Context) (_ context.Context, cached bool)
- func Range(ctx context.Context, f func(key, value interface{}) bool)
- func Store(ctx context.Context, key string, val interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadOrStore ¶
func LoadOrStore(ctx context.Context, key string, val interface{}) (actual interface{}, loaded bool, err error)
LoadOrStore 将 key 及其 val 保存到 context.Context 对象。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.