cache

package
v0.0.0-...-11f987e Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeSendTooMany        = errors.New("发送验证码太频繁")
	ErrCodeVerifyTooManyTimes = errors.New("验证次数太多")
	ErrUnknownForCode         = errors.New("我也不知发生什么了,反正是跟 code 有关")
)

Functions

This section is empty.

Types

type CodeCache

type CodeCache struct {
	// contains filtered or unexported fields
}

func (*CodeCache) Set

func (c *CodeCache) Set(ctx context.Context, biz string, code string, phone string) error

func (*CodeCache) Verify

func (c *CodeCache) Verify(ctx context.Context, biz string, code string, phone string) (bool, error)

type UserCache

type UserCache struct {
	// contains filtered or unexported fields
}

func NewUserCache

func NewUserCache(client redis.Cmdable) *UserCache

func (*UserCache) Get

func (cache *UserCache) Get(ctx context.Context, id int64) (domain.User, error)

func (*UserCache) Set

func (cache *UserCache) Set(ctx context.Context, u domain.User) error

Jump to

Keyboard shortcuts

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