cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedisClient *redis.Client

Functions

func AddComment

func AddComment(ctx context.Context, key string, comment *db.Comment) (err error)

func AddComments

func AddComments(ctx context.Context, key string, comments *[]db.Comment) (err error)

func AddCount

func AddCount(ctx context.Context, increment int64, videoID string) (err error)

func AddNoData

func AddNoData(ctx context.Context, key string) (err error)

func AddVideoLikeCount

func AddVideoLikeCount(ctx context.Context, videoID int64, userID int64) error

func Delete

func Delete(ctx context.Context, key string) (err error)

func DeleteComment

func DeleteComment(ctx context.Context, key string, comment *db.Comment) (err error)

func GetCommentKey

func GetCommentKey(videoID string) string

func GetCommentNXKey

func GetCommentNXKey(videoID string) string

func GetComments

func GetComments(ctx context.Context, key string) (comments *[]redis.Z, err error)

func GetCount

func GetCount(ctx context.Context, key string) (ok bool, count string, err error)

func GetCountKey

func GetCountKey(videoID string) string

func GetCountNXKey

func GetCountNXKey(videoID string) string

func GetUserFavoriteCount

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

func GetUserFavoriteVideos

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

func GetUserLikeKey

func GetUserLikeKey(userID int64) string

func GetVideoLikeCount

func GetVideoLikeCount(ctx context.Context, videoID int64) (bool, int64, error)

func GetVideoLikeCountKey

func GetVideoLikeCountKey(videoID int64) string

func Init

func Init()

func IsExistComment

func IsExistComment(ctx context.Context, key string) (exist int64, err error)

func IsVideoLikeExist

func IsVideoLikeExist(ctx context.Context, videoID int64, userID int64) (bool, error)

func Lock

func Lock(ctx context.Context, key string) (ok bool, err error)

func ReduceVideoLikeCount

func ReduceVideoLikeCount(ctx context.Context, videoID int64, userID int64) error

func SetCount

func SetCount(ctx context.Context, key string, count int64) (err error)

func SetVideoLikeCount

func SetVideoLikeCount(ctx context.Context, videoID int64, count int64) error
func Unlink(ctx context.Context, key string) (err error)

func UpdateFavoriteVideoList

func UpdateFavoriteVideoList(ctx context.Context, userID int64, videoIDList []int64) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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