Documentation
¶
Index ¶
- Constants
- type AscHeap
- type DescHeap
- type Heap
- type RatingHeap
- type Service
- func (s *Service) BaseInfo(c context.Context, date time.Time, start, end int, ch chan []*model.BaseInfo) (err error)
- func (s *Service) BaseInfoOffEnd(c context.Context, date time.Time) (offset, end int, err error)
- func (s *Service) BaseTotal(c context.Context, date time.Time) (total map[int64]*model.BaseInfo, err error)
- func (s *Service) BatchInsertRatingStat(c context.Context, wch chan []*model.Rating, date time.Time) (err error)
- func (s *Service) CalScore(rch chan []*model.BaseInfo, wch chan []*model.Rating, ...)
- func (s *Service) CalScores(c context.Context, date time.Time, past map[int64]*model.Past, ...) (err error)
- func (s *Service) CalTrend(c context.Context, date time.Time) (err error)
- func (s *Service) Close()
- func (s *Service) Copy(rch chan []*model.Rating, wch chan []*model.Rating, past map[int64]*model.Past, ...)
- func (s *Service) DelPastRecord(c context.Context, date time.Time) (err error)
- func (s *Service) DelRatings(c context.Context, date time.Time) (err error)
- func (s *Service) DelTrends(c context.Context, table string) (err error)
- func (s *Service) InsertPastRecord(c context.Context, date string) (err error)
- func (s *Service) InsertTaskStatus(c context.Context, ctype, status int, date, message string) (err error)
- func (s *Service) Ping(c context.Context) (err error)
- func (s *Service) PrepareData(c context.Context, date time.Time, past map[int64]*model.Past, ...) (err error)
- func (s *Service) RatingFast(c context.Context, date time.Time, start, end int, ch chan []*model.Rating) (err error)
- func (s *Service) RatingInfos(c context.Context, date time.Time, ch chan []*model.Rating) (err error)
- func (s *Service) RatingOffEnd(c context.Context, date time.Time) (offset, end, count int, err error)
- func (s *Service) Ratings(c context.Context, date time.Time, start, end int, ch chan []*model.Rating) (err error)
- func (s *Service) Run(c context.Context, date time.Time) (err error)
- func (s *Service) RunPastScore(c context.Context, date time.Time) (err error)
- func (s *Service) RunStatistics(c context.Context, date time.Time) (err error)
Constants ¶
View Source
const ( // TotalType total type TotalType int = iota // CreativeType creative type CreativeType // InfluenceType influence type InfluenceType // CreditType Credit type CreditType )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescHeap ¶
type DescHeap struct {
// contains filtered or unexported fields
}
DescHeap for desc
type RatingHeap ¶
RatingHeap rating heap for topK
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service struct
func (*Service) BaseInfo ¶
func (s *Service) BaseInfo(c context.Context, date time.Time, start, end int, ch chan []*model.BaseInfo) (err error)
BaseInfo get base infos
func (*Service) BaseInfoOffEnd ¶
BaseInfoOffEnd get offset and end
func (*Service) BaseTotal ¶
func (s *Service) BaseTotal(c context.Context, date time.Time) (total map[int64]*model.BaseInfo, err error)
BaseTotal get total base
func (*Service) BatchInsertRatingStat ¶
func (s *Service) BatchInsertRatingStat(c context.Context, wch chan []*model.Rating, date time.Time) (err error)
BatchInsertRatingStat batch insert rating stat
func (*Service) CalScore ¶
func (s *Service) CalScore(rch chan []*model.BaseInfo, wch chan []*model.Rating, params *model.RatingParameter, past map[int64]*model.Past, date time.Time)
CalScore cal rating score
func (*Service) CalScores ¶
func (s *Service) CalScores(c context.Context, date time.Time, past map[int64]*model.Past, params *model.RatingParameter) (err error)
CalScores cal scores
func (*Service) Copy ¶
func (s *Service) Copy(rch chan []*model.Rating, wch chan []*model.Rating, past map[int64]*model.Past, params *model.RatingParameter)
Copy copy data from month to month
func (*Service) DelPastRecord ¶
DelPastRecord del past record
func (*Service) DelRatings ¶
DelRatings del ratings
func (*Service) InsertPastRecord ¶
InsertPastRecord insert past record
func (*Service) InsertTaskStatus ¶
func (s *Service) InsertTaskStatus(c context.Context, ctype, status int, date, message string) (err error)
InsertTaskStatus insert task status
func (*Service) PrepareData ¶
func (s *Service) PrepareData(c context.Context, date time.Time, past map[int64]*model.Past, params *model.RatingParameter) (err error)
PrepareData prepare old data
func (*Service) RatingFast ¶
func (s *Service) RatingFast(c context.Context, date time.Time, start, end int, ch chan []*model.Rating) (err error)
RatingFast close chan when part finished
func (*Service) RatingInfos ¶
func (s *Service) RatingInfos(c context.Context, date time.Time, ch chan []*model.Rating) (err error)
RatingInfos rating infos
func (*Service) RatingOffEnd ¶
func (s *Service) RatingOffEnd(c context.Context, date time.Time) (offset, end, count int, err error)
RatingOffEnd get offset and end
func (*Service) Ratings ¶
func (s *Service) Ratings(c context.Context, date time.Time, start, end int, ch chan []*model.Rating) (err error)
Ratings chan <- ratings, close chan outside
func (*Service) RunPastScore ¶
RunPastScore run past score by date
Click to show internal directories.
Click to hide internal directories.