cache

package
v0.0.0-...-e90a31b Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 10 Imported by: 0

README

cache

cache 文件存放位置

Documentation

Index

Constants

View Source
const (
	// PrefixUserFollowerCacheKey cache prefix
	PrefixUserFollowerCacheKey = "user:follower:%d_%d"
)
View Source
const (
	// PrefixUserFollowingCacheKey cache prefix
	PrefixUserFollowingCacheKey = "user:following:%d_%d"
)

Variables

ProviderSet is cache providers.

Functions

This section is empty.

Types

type UserFollowerCache

type UserFollowerCache interface {
	SetUserFollowerCache(ctx context.Context, userID, followedUID int64, data *model.UserFollowerModel, duration time.Duration) error
	GetUserFollowerCache(ctx context.Context, userID, followedUID int64) (data *model.UserFollowerModel, err error)
	DelUserFollowerCache(ctx context.Context, userID, followedUID int64) error
}

UserFollower define cache interface

func NewUserFollowerCache

func NewUserFollowerCache(rdb *redis.Client) UserFollowerCache

NewUserFollowerCache new a cache

type UserFollowingCache

type UserFollowingCache interface {
	SetUserFollowingCache(ctx context.Context, userID, followedUID int64, data *model.UserFollowingModel, duration time.Duration) error
	GetUserFollowingCache(ctx context.Context, userID, followedUID int64) (data *model.UserFollowingModel, err error)
	DelUserFollowingCache(ctx context.Context, userID, followedUID int64) error
}

UserFollowing define cache interface

func NewUserFollowingCache

func NewUserFollowingCache(rdb *redis.Client) UserFollowingCache

NewUserFollowingCache new a cache

Jump to

Keyboard shortcuts

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