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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao dao

func New

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

New fn

func (*Dao) BaseInfoEnd

func (d *Dao) BaseInfoEnd(c context.Context, date time.Time) (end int, err error)

BaseInfoEnd get end id by date

func (*Dao) BaseInfoStart

func (d *Dao) BaseInfoStart(c context.Context, date time.Time) (start int, err error)

BaseInfoStart get start id by date

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error)

BeginTran begin transcation

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) DelPastRecord

func (d *Dao) DelPastRecord(c context.Context, date time.Time) (rows int64, err error)

DelPastRecord del past record

func (*Dao) DelPastStat

func (d *Dao) DelPastStat(c context.Context, limit int64) (rows int64, err error)

DelPastStat del past stat

func (*Dao) DelRatingCom

func (d *Dao) DelRatingCom(c context.Context, table string, date time.Time, limit int) (rows int64, err error)

DelRatingCom del rating common by date

func (*Dao) DelRatings

func (d *Dao) DelRatings(c context.Context, date time.Time, limit int) (rows int64, err error)

DelRatings del ratings

func (*Dao) DelTrend

func (d *Dao) DelTrend(c context.Context, table string, limit int) (rows int64, err error)

DelTrend del trend limit x

func (*Dao) GetAllParamter

func (d *Dao) GetAllParamter(c context.Context) (paramters map[string]int64, err error)

GetAllParamter get all paramter

func (*Dao) GetBaseInfo

func (d *Dao) GetBaseInfo(c context.Context, month time.Month, start, end, limit int) (bs []*model.BaseInfo, id int, err error)

GetBaseInfo get rating info

func (*Dao) GetBaseTotal

func (d *Dao) GetBaseTotal(c context.Context, date time.Time, id, limit int64) (bs []*model.BaseInfo, err error)

GetBaseTotal get total

func (*Dao) GetPastRecord

func (d *Dao) GetPastRecord(c context.Context, cdate string) (times int, err error)

GetPastRecord batch insert past score stat

func (*Dao) GetPasts

func (d *Dao) GetPasts(c context.Context, offset, limit int64) (past []*model.Past, last int64, err error)

GetPasts get past statistics

func (*Dao) GetRatings

func (d *Dao) GetRatings(c context.Context, date time.Time, offset, limit int) (rs []*model.Rating, last int, err error)

GetRatings get ratings by date

func (*Dao) GetRatingsFast

func (d *Dao) GetRatingsFast(c context.Context, date time.Time, start, end, limit int) (rs []*model.Rating, id int, err error)

GetRatingsFast get rating fast

func (*Dao) InsertPastRecord

func (d *Dao) InsertPastRecord(c context.Context, times int, cdate string) (rows int64, err error)

InsertPastRecord insert past record date and times

func (*Dao) InsertPastScoreStat

func (d *Dao) InsertPastScoreStat(c context.Context, values string) (rows int64, err error)

InsertPastScoreStat batch insert past score stat

func (*Dao) InsertRatingStat

func (d *Dao) InsertRatingStat(c context.Context, month time.Month, values string) (rows int64, err error)

InsertRatingStat batch insert rating score stat

func (*Dao) InsertRatingStatis

func (d *Dao) InsertRatingStatis(c context.Context, values string) (rows int64, err error)

InsertRatingStatis batch insert rating statistics

func (*Dao) InsertTaskStatus

func (d *Dao) InsertTaskStatus(c context.Context, val string) (rows int64, err error)

InsertTaskStatus insert task status

func (*Dao) InsertTopRating

func (d *Dao) InsertTopRating(c context.Context, values string) (rows int64, err error)

InsertTopRating insert rating top

func (*Dao) InsertTrend

func (d *Dao) InsertTrend(c context.Context, table string, values string) (rows int64, err error)

InsertTrend insert asc values

func (*Dao) Ping

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

Ping ping health.

func (*Dao) RatingCount

func (d *Dao) RatingCount(c context.Context, date time.Time) (count int, err error)

RatingCount get end id by date

func (*Dao) RatingEnd

func (d *Dao) RatingEnd(c context.Context, date time.Time) (end int, err error)

RatingEnd get end id by date

func (*Dao) RatingStart

func (d *Dao) RatingStart(c context.Context, date time.Time) (start int, err error)

RatingStart get start id by date

Jump to

Keyboard shortcuts

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