localcache

package
v0.0.0-...-0ca6d7b Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCodeLocalCache

func NewCodeLocalCache(
	code *ttlcache.Cache[string, string],
	cnt *ttlcache.Cache[string, int],
	expiration time.Duration,
) cache.CodeCache

func NewUserLocalCache

func NewUserLocalCache(cc *ttlcache.Cache[string, domain.User]) cache.UserCache

Types

type CodeLocalCache

type CodeLocalCache struct {
	cache.BaseCodeCache
	// contains filtered or unexported fields
}

func (*CodeLocalCache) Set

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

func (*CodeLocalCache) Verify

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

type UserLocalCache

type UserLocalCache struct {
	cache.BaseUserCache
	// contains filtered or unexported fields
}

func (*UserLocalCache) Get

func (c *UserLocalCache) Get(ctx context.Context, uid int64) (domain.User, error)

func (*UserLocalCache) Set

func (c *UserLocalCache) Set(ctx context.Context, user domain.User) error

Jump to

Keyboard shortcuts

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