Documentation ¶
Index ¶
- Variables
- func StartRefreshJob()
- func StartRoomFeatureJob(c *conf.Config)
- type Counter
- type Dao
- func (d *Dao) ClearRecommend(ctx context.Context, uid int64) error
- func (d *Dao) Close()
- func (d *Dao) FilterOnlineRoomIds(roomIds []int64) (ret []int64)
- func (d *Dao) GetLrRecRoomIds(r redis.Conn, uid int64, candidateIds []int64) (ret []int64, err error)
- func (d *Dao) GetRandomRoomIds(ctx context.Context, uid int64, reqCount int, existRoomIDs []int64) (ret []int64, err error)
- func (d *Dao) Ping(ctx context.Context) (err error)
- type ScoreSlice
Constants ¶
This section is empty.
Variables ¶
View Source
var RelationAPI *relation_api.Client
RelationAPI relation liverpc client
View Source
var RoomAPI *room_api.Client
RoomAPI room liverpc client
Functions ¶
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter 房间-分数结构体, 用于构建一个可排序的slice
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) ClearRecommend ¶
ClearRecommend 清空该用户相关的推荐缓存
func (*Dao) FilterOnlineRoomIds ¶
FilterOnlineRoomIds 给定一批room id 返回所有在线的
func (*Dao) GetLrRecRoomIds ¶
func (d *Dao) GetLrRecRoomIds(r redis.Conn, uid int64, candidateIds []int64) (ret []int64, err error)
GetLrRecRoomIds 在GetRandomRoomIds的基础上进行LR计算并返回倒排的房间号列表 与GetRandomRoomIds有相同的输入输出结构
type ScoreSlice ¶
type ScoreSlice []Counter
ScoreSlice Counter对象的slice
func (ScoreSlice) Len ¶
func (s ScoreSlice) Len() int
func (ScoreSlice) Less ¶
func (s ScoreSlice) Less(i, j int) bool
func (ScoreSlice) Swap ¶
func (s ScoreSlice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.