Documentation ¶
Index ¶
- Variables
- func Comment(c *model.Comment) *base.Comment
- func CommentSubscribeRoutine(subscriber *CommentSubscriber, dao *dao.Comment) error
- func Comments(c []*model.Comment) []*base.Comment
- func FavoriteSubscribeRoutine(subscriber *FavoriteSubscriber, dao *dao.Favorite) error
- type CommentPublisher
- type CommentRedisManager
- func (r *CommentRedisManager) CommentCountByVideoId(ctx context.Context, videoId int64) (int64, error)
- func (r *CommentRedisManager) CreateComment(ctx context.Context, comment *model.Comment) error
- func (r *CommentRedisManager) DeleteComment(ctx context.Context, commentId int64) error
- func (r *CommentRedisManager) GetCommentListByVideoId(ctx context.Context, videoId int64) ([]*model.Comment, error)
- type CommentSubscriber
- type FavoritePublisher
- type FavoriteRedisManager
- func (r *FavoriteRedisManager) Check(ctx context.Context, userId, videoId int64) (bool, error)
- func (r *FavoriteRedisManager) GetFavoriteCountByVideoId(ctx context.Context, videoId int64) (int64, error)
- func (r *FavoriteRedisManager) GetFavoriteVideoCountByUserId(ctx context.Context, userId int64) (int64, error)
- func (r *FavoriteRedisManager) GetFavoriteVideoIdListByUserId(ctx context.Context, userId int64) ([]int64, error)
- func (r *FavoriteRedisManager) Like(ctx context.Context, userId, videoId, time int64) error
- func (r *FavoriteRedisManager) Unlike(ctx context.Context, userId, videoId int64) error
- type FavoriteSubscriber
- type VideoManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoSuchRecord = errors.New("no such record") ErrRecordAlreadyExist = errors.New("record already exist") )
Functions ¶
func CommentSubscribeRoutine ¶
func CommentSubscribeRoutine(subscriber *CommentSubscriber, dao *dao.Comment) error
func FavoriteSubscribeRoutine ¶
func FavoriteSubscribeRoutine(subscriber *FavoriteSubscriber, dao *dao.Favorite) error
Types ¶
type CommentPublisher ¶
type CommentPublisher struct {
// contains filtered or unexported fields
}
CommentPublisher implements an amqp publisher.
func NewCommentPublisher ¶
func NewCommentPublisher(conn *amqp.Connection, exchange string) (*CommentPublisher, error)
type CommentRedisManager ¶
type CommentRedisManager struct {
RedisClient *redis.Client
}
func NewCommentRedisManager ¶
func NewCommentRedisManager(client *redis.Client) *CommentRedisManager
func (*CommentRedisManager) CommentCountByVideoId ¶
func (*CommentRedisManager) CreateComment ¶
func (*CommentRedisManager) DeleteComment ¶
func (r *CommentRedisManager) DeleteComment(ctx context.Context, commentId int64) error
func (*CommentRedisManager) GetCommentListByVideoId ¶
type CommentSubscriber ¶
type CommentSubscriber struct {
// contains filtered or unexported fields
}
CommentSubscriber implements an amqp subscriber.
func NewCommentSubscriber ¶
func NewCommentSubscriber(conn *amqp.Connection, exchange string) (*CommentSubscriber, error)
NewCommentSubscriber creates an amqp subscriber.
func (*CommentSubscriber) Subscribe ¶
Subscribe subscribes and returns a channel with Favorite action request.
func (*CommentSubscriber) SubscribeRaw ¶
SubscribeRaw subscribes and returns a channel with raw amqp delivery.
type FavoritePublisher ¶
type FavoritePublisher struct {
// contains filtered or unexported fields
}
FavoritePublisher implements an amqp publisher.
func NewFavoritePublisher ¶
func NewFavoritePublisher(conn *amqp.Connection, exchange string) (*FavoritePublisher, error)
type FavoriteRedisManager ¶
type FavoriteRedisManager struct {
// contains filtered or unexported fields
}
func NewFavoriteRedisManager ¶
func NewFavoriteRedisManager(client *redis.Client) *FavoriteRedisManager
func (*FavoriteRedisManager) GetFavoriteCountByVideoId ¶
func (*FavoriteRedisManager) GetFavoriteVideoCountByUserId ¶
func (*FavoriteRedisManager) GetFavoriteVideoIdListByUserId ¶
type FavoriteSubscriber ¶
type FavoriteSubscriber struct {
// contains filtered or unexported fields
}
FavoriteSubscriber implements an amqp subscriber.
func NewFavoriteSubscriber ¶
func NewFavoriteSubscriber(conn *amqp.Connection, exchange string) (*FavoriteSubscriber, error)
NewFavoriteSubscriber creates an amqp subscriber.
func (*FavoriteSubscriber) Subscribe ¶
Subscribe subscribes and returns a channel with Favorite model.
func (*FavoriteSubscriber) SubscribeRaw ¶
SubscribeRaw subscribes and returns a channel with raw amqp delivery.
type VideoManager ¶
type VideoManager struct {
// contains filtered or unexported fields
}
func NewVideoManager ¶
func NewVideoManager(client videoservice.Client) *VideoManager
func (*VideoManager) GetPublishedVideoIdList ¶
Click to show internal directories.
Click to hide internal directories.