Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // 存储数据 Set(ctx context.Context, key string, val interface{}, timeout time.Duration) // 获取数据 // 返回数据和数据是否存在 Get(ctx context.Context, key string) (interface{}, bool) // 锁 Lock(ctx context.Context, Key string) bool // 释放锁 UnLock(ctx context.Context, Key string) error }
func NewMemoryCache ¶
func NewMemoryCache() Cache
func NewRedisCache ¶
func NewRedisCache() Cache
Click to show internal directories.
Click to hide internal directories.