rediscache

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCodeExp = errors.New("verification code exists but has no expiration date")

Functions

func NewArticleRedisCache

func NewArticleRedisCache(client redis.Cmdable) cache.ArticleCache

func NewCodeRedisCache

func NewCodeRedisCache(cmd redis.Cmdable) cache.CodeCache

func NewInteractiveRedisCache

func NewInteractiveRedisCache(client redis.Cmdable) cache.InteractiveCache

func NewUserRedisCache

func NewUserRedisCache(cmd redis.Cmdable) cache.UserCache

Types

type ArticleRedisCache

type ArticleRedisCache struct {
	cache.BaseArticleCache
	// contains filtered or unexported fields
}

func (*ArticleRedisCache) DelFirstPage

func (a *ArticleRedisCache) DelFirstPage(ctx context.Context, uid int64) error

DelFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) Get

Get implements cache.ArticleCache.

func (*ArticleRedisCache) GetFirstPage

func (a *ArticleRedisCache) GetFirstPage(ctx context.Context, uid int64) ([]domain.Article, error)

GetFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) GetPub

func (a *ArticleRedisCache) GetPub(ctx context.Context, id int64) (domain.Article, error)

GetPub implements cache.ArticleCache.

func (*ArticleRedisCache) Set

func (a *ArticleRedisCache) Set(ctx context.Context, article domain.Article) error

Set implements cache.ArticleCache.

func (*ArticleRedisCache) SetFirstPage

func (a *ArticleRedisCache) SetFirstPage(
	ctx context.Context,
	uid int64,
	articles []domain.Article,
) error

SetFirstPage implements cache.ArticleCache.

func (*ArticleRedisCache) SetPub

func (a *ArticleRedisCache) SetPub(ctx context.Context, article domain.Article) error

SetPub implements cache.ArticleCache.

type CodeRedisCache

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

func (*CodeRedisCache) Set

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

func (*CodeRedisCache) Verify

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

type InteractiveRedisCache

type InteractiveRedisCache struct {
	cache.BaseInteractiveCache
	// contains filtered or unexported fields
}

func (*InteractiveRedisCache) DecrCollectCntIfPresent

func (i *InteractiveRedisCache) DecrCollectCntIfPresent(
	ctx context.Context,
	biz string,
	bizID int64,
) error

DecrCollectCntIfPresent implements cache.InteractiveCache.

func (*InteractiveRedisCache) DecrLikeCntIfPresent

func (i *InteractiveRedisCache) DecrLikeCntIfPresent(
	ctx context.Context,
	biz string,
	bizID int64,
) error

DecrLikeCntIfPresent implements cache.InteractiveCache.

func (*InteractiveRedisCache) Get

func (i *InteractiveRedisCache) Get(
	ctx context.Context,
	biz string,
	bizID int64,
) (domain.Interactive, error)

Get implements cache.InteractiveCache.

func (*InteractiveRedisCache) IncrCollectCntIfPresent

func (i *InteractiveRedisCache) IncrCollectCntIfPresent(
	ctx context.Context,
	biz string,
	bizID int64,
) error

IncrCollectorCntIfPresent implements cache.InteractiveCache.

func (*InteractiveRedisCache) IncrLikeCntIfPresent

func (i *InteractiveRedisCache) IncrLikeCntIfPresent(
	ctx context.Context,
	biz string,
	bizID int64,
) error

IncrLikeCntIfPresent implements cache.InteractiveCache.

func (*InteractiveRedisCache) IncrReadCntIfPresent

func (i *InteractiveRedisCache) IncrReadCntIfPresent(
	ctx context.Context,
	biz string,
	bizID int64,
) error

IncrReadCntIfPresent implements cache.InteractiveCache.

func (*InteractiveRedisCache) Set

func (i *InteractiveRedisCache) Set(
	ctx context.Context,
	biz string,
	bizID int64,
	intr domain.Interactive,
) error

Set implements cache.InteractiveCache.

type UserRedisCache

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

func (*UserRedisCache) Get

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

func (*UserRedisCache) Set

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

Directories

Path Synopsis
Package redismock is a generated GoMock package.
Package redismock is a generated GoMock package.

Jump to

Keyboard shortcuts

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