Documentation ¶
Index ¶
- func PackVideo(video *model.Video, author *base.User, info *base.VideoInteractInfo) *base.Video
- func PackVideos(videoList []*model.Video, authorList []*base.User, ...) []*base.Video
- func SubscribeRoutine(subscriber *Subscriber, dao *dao.Video) error
- func Video(v *model.Video) *base.Video
- func Videos(videos []*model.Video) []*base.Video
- type InteractionManager
- func (i *InteractionManager) BatchGetVideoInteractInfo(ctx context.Context, videoIdList []int64, viewerId int64) ([]*base.VideoInteractInfo, error)
- func (i *InteractionManager) GetFavoriteVideoIdList(ctx context.Context, userId int64) ([]int64, error)
- func (i *InteractionManager) GetVideoInteractInfo(ctx context.Context, videoId, viewerId int64) (*base.VideoInteractInfo, error)
- type Publisher
- type RedisManager
- func (r *RedisManager) BatchGetVideoByVideoId(ctx context.Context, videoIdList []int64) ([]*model.Video, error)
- func (r *RedisManager) CreateVideo(ctx context.Context, video *model.Video) error
- func (r *RedisManager) DeleteVideoById(ctx context.Context, videoId int64) error
- func (r *RedisManager) GetVideoByVideoId(ctx context.Context, videoId int64) (*model.Video, error)
- func (r *RedisManager) GetVideoIdListByAuthorId(ctx context.Context, authorId int64) ([]int64, error)
- func (r *RedisManager) GetVideoListByAuthorId(ctx context.Context, authorId int64) ([]*model.Video, error)
- func (r *RedisManager) GetVideoListByLatestTime(ctx context.Context, latestTime int64) ([]*model.Video, error)
- type Subscriber
- type UserManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackVideos ¶
func SubscribeRoutine ¶
func SubscribeRoutine(subscriber *Subscriber, dao *dao.Video) error
Types ¶
type InteractionManager ¶
type InteractionManager struct {
InteractionService interactionserver.Client
}
func (*InteractionManager) BatchGetVideoInteractInfo ¶
func (i *InteractionManager) BatchGetVideoInteractInfo(ctx context.Context, videoIdList []int64, viewerId int64) ([]*base.VideoInteractInfo, error)
BatchGetVideoInteractInfo batch get video interactInfo.
func (*InteractionManager) GetFavoriteVideoIdList ¶
func (i *InteractionManager) GetFavoriteVideoIdList(ctx context.Context, userId int64) ([]int64, error)
GetFavoriteVideoIdList gets the favorite video id list.
func (*InteractionManager) GetVideoInteractInfo ¶
func (i *InteractionManager) GetVideoInteractInfo(ctx context.Context, videoId, viewerId int64) (*base.VideoInteractInfo, error)
GetVideoInteractInfo get video interactInfo.
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
Publisher implements an amqp publisher.
func NewPublisher ¶
func NewPublisher(conn *amqp.Connection, exchange string) (*Publisher, error)
type RedisManager ¶
type RedisManager struct {
RedisClient *redis.Client
}
func NewRedisManager ¶
func NewRedisManager(client *redis.Client) *RedisManager
func (*RedisManager) BatchGetVideoByVideoId ¶
func (*RedisManager) CreateVideo ¶
func (*RedisManager) DeleteVideoById ¶
func (r *RedisManager) DeleteVideoById(ctx context.Context, videoId int64) error
func (*RedisManager) GetVideoByVideoId ¶
func (*RedisManager) GetVideoIdListByAuthorId ¶
func (*RedisManager) GetVideoListByAuthorId ¶
func (*RedisManager) GetVideoListByLatestTime ¶
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Subscriber implements an amqp subscriber.
func NewSubscriber ¶
func NewSubscriber(conn *amqp.Connection, exchange string) (*Subscriber, error)
NewSubscriber creates an amqp subscriber.
func (*Subscriber) Subscribe ¶
func (s *Subscriber) Subscribe(c context.Context) (videoChan chan *model.Video, cleanUpFunc func(), err error)
Subscribe subscribes and returns a channel with video publish request.
func (*Subscriber) SubscribeRaw ¶
SubscribeRaw subscribes and returns a channel with raw amqp delivery.
type UserManager ¶
type UserManager struct {
UserService userservice.Client
}
func (*UserManager) BatchGetUser ¶
func (m *UserManager) BatchGetUser(ctx context.Context, list []int64, viewerId int64) ([]*base.User, error)
BatchGetUser gets users info by list.
Click to show internal directories.
Click to hide internal directories.