dao

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TaskLastPage            = "TaskLastPage"
	TaskLastUpsPage         = "TaskLastUpsPage"
	TaskBiliUserProfile     = "TaskBiliUserProfile"
	TaskBBQUserProfile      = "TaskBBQUserProfile"
	TaskBBQDeviceProfile    = "TaskBBQDeviceProfile"
	TaskUserLike            = "TaskUserLike"
	TaskUserLikeYesterday   = "TaskUserLikeYesterday"
	TaskUserPlay            = "TaskUserPlay"
	TaskUserPlayYesterday   = "TaskUserPlayYesterday"
	TaskDevicePlay          = "TaskDevicePlay"
	TaskDevicePlayYesterday = "TaskDevicePlayYesterday"
	TaskUserFollow          = "TaskUserFollow"
	TaskUserFollowYesterday = "TaskUserFollowYesterday"
)

user const

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	SearchClient   searchv1.SearchClient
	RecallClient   recallv1.RecsysRecallClient
	UserClient     user.UserClient
	RelationClient relation.RelationClient
	// contains filtered or unexported fields
}

Dao dao

func New

func New(c *conf.Config) (dao *Dao)

New init mysql db

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) DownGradeRecall

func (d *Dao) DownGradeRecall(c context.Context) (response *recsys.RecsysResponse, err error)

DownGradeRecall ...

func (*Dao) GetUserBlack

func (d *Dao) GetUserBlack(c context.Context, mid int64, u *model.UserProfile) (err error)

GetUserBlack ...

func (*Dao) GetUserFollow

func (d *Dao) GetUserFollow(c context.Context, mid int64, u *model.UserProfile) (err error)

GetUserFollow ...

func (*Dao) InitModel

func (d *Dao) InitModel(c context.Context, weights map[string]float64) (err error)

InitModel ...

func (*Dao) InitUserProfile

func (d *Dao) InitUserProfile(c context.Context, mid int64, buvid string) (u *model.UserProfile)

InitUserProfile ...

func (*Dao) LastPageRedisKey

func (d *Dao) LastPageRedisKey(mid int64, buvid string) (key string)

LastPageRedisKey for main rec process

func (*Dao) LastUpsPageRedisKey

func (d *Dao) LastUpsPageRedisKey(mid int64, buvid string) (key string)

LastUpsPageRedisKey for ups rec process

func (*Dao) LoadUserProfile

func (d *Dao) LoadUserProfile(c context.Context, mid int64, buvid string) (userProfile *model.UserProfile, err error)

LoadUserProfile load user info from redis parallel

func (*Dao) ParallelRedis

func (d *Dao) ParallelRedis(tasks *[]parallel.RedisTask) *[]workpool.FutureTask

ParallelRedis run redis cmd parallel

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) error

Ping dao ping

func (*Dao) StoreRecResults

func (d *Dao) StoreRecResults(c context.Context, u *model.UserProfile, mid int64, buvid string, response *recsys.RecsysResponse, getKeyFunc func(int64, string) string, lastRecords []model.Record4Dup) (err error)

StoreRecResults store rec or upsRec history according to getKeyFunc

func (*Dao) WriteBF

func (d *Dao) WriteBF(c context.Context, mid int64, buvid string, svid []uint64) (bool, error)

WriteBF .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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