cache

package
v0.0.0-...-816873c Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserLikeKey       = "user_like"
	VideoLikeCountKey = "video_like_count"
	VideoSetKey       = "video_set"
)
View Source
const (
	CommentCountKey = "comment_count"
)

Variables

View Source
var RedisClient *redis.Client

Functions

func AddCommentCount

func AddCommentCount(ctx context.Context, vid int64) error

func AddVideFavoriteCount

func AddVideFavoriteCount(ctx context.Context, vid int64, uid int64) error

func AddVideoSet

func AddVideoSet(ctx context.Context, vid int64, expire time.Duration) error

func GetCommentCount

func GetCommentCount(ctx context.Context, vid int64) (int64, error)

func GetCommentCountKey

func GetCommentCountKey(vid int64) string

func GetUserFavoriteCount

func GetUserFavoriteCount(ctx context.Context, uid int64) (int64, error)

func GetUserFavoriteVideos

func GetUserFavoriteVideos(ctx context.Context, uid int64) ([]int64, error)

func GetVideoLikeCount

func GetVideoLikeCount(ctx context.Context, vid int64) (int64, error)

func Init

func Init()

func IsVideoFavoriteExist

func IsVideoFavoriteExist(ctx context.Context, vid int64, uid int64) (bool, error)

func IsVideoInSet

func IsVideoInSet(ctx context.Context, vid int64) (bool, error)

func ReduceVideoLikeCount

func ReduceVideoLikeCount(ctx context.Context, vid int64, uid int64) error

func RemoveVideoSet

func RemoveVideoSet(ctx context.Context, vid int64) error

func SetCommentCount

func SetCommentCount(ctx context.Context, vid int64, count int64) error

func SetVideoLikeCount

func SetVideoLikeCount(ctx context.Context, vid int64, count int64) error

func UpdateFavoriteVideoList

func UpdateFavoriteVideoList(ctx context.Context, uid int64, vids []int64) error

func UserFavoriteKey

func UserFavoriteKey(uid int64) string

func VideoFavoriteCountKey

func VideoFavoriteCountKey(vid int64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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