cache

package
v0.0.0-...-24b49fa Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotExist = errors.New("inexisted key")

Functions

This section is empty.

Types

type BaseInteractiveCache

type BaseInteractiveCache struct{}

func (*BaseInteractiveCache) Key

func (c *BaseInteractiveCache) Key(biz string, bizID int64) string

type InteractiveCache

type InteractiveCache interface {
	IncrReadCntIfPresent(ctx context.Context, biz string, bizID int64) error
	IncrLikeCntIfPresent(ctx context.Context, biz string, bizID int64) error
	DecrLikeCntIfPresent(ctx context.Context, biz string, bizID int64) error
	IncrCollectCntIfPresent(ctx context.Context, biz string, bizID int64) error
	DecrCollectCntIfPresent(ctx context.Context, biz string, bizID int64) error
	Get(ctx context.Context, biz string, bizID int64) (domain.Interactive, error)
	Set(ctx context.Context, biz string, bizID int64, intr domain.Interactive) error
	MustBatchGet(ctx context.Context, biz string, bizIDs []int64) ([]domain.Interactive, error)
	BatchSet(ctx context.Context, biz string, bizIDs []int64, intr []domain.Interactive) error
	GetTopLikedIDs(ctx context.Context, biz string, limit int64) ([]int64, error)
	SetLikeToZSET(ctx context.Context, biz string, bizId int64, likeCnt int64) error
	IncrLikeRank(ctx context.Context, biz string, bizID int64) error
	DecrLikeRank(ctx context.Context, biz string, bizID int64) error
}

type TopArticlesCache

type TopArticlesCache interface {
	SetTopLikedArticles(ctx context.Context, articles []int64) error
	GetTopLikedArticles(ctx context.Context) ([]int64, error)
}

Directories

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

Jump to

Keyboard shortcuts

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