store

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storer

type Storer interface {
	// 获取令牌剩余的时间
	TTL(ctx context.Context, key string) (time.Duration, bool, error)
	// 重置过期时间
	EXP(ctx context.Context, key string, expiration time.Duration) (bool, error)
	// 存储令牌数据,并指定到期时间
	Set(ctx context.Context, key, value string, expiration time.Duration) error
	// 获取存储数据
	Get(ctx context.Context, key string) (string, bool, error)
	// 检查令牌是否存在
	Check(ctx context.Context, key string) (bool, error)
	// 存放一个键值, 只用来确定是否存在
	Set1(ctx context.Context, key string, expiration time.Duration) error
	// 删除存储的令牌
	Delete(ctx context.Context, key string) error
	// 关闭存储
	Close() error
}

Storer 令牌存储接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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