cache

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL