Documentation
¶
Index ¶
- type Dao
- func (d *Dao) ActionCounter(c context.Context, mid int64, ts int64) (actionCounter *model.ActionCounter, err error)
- func (d *Dao) CalcRecords(c context.Context, mid int64, weekTSFrom, weekTSTo int64) (figureRecords []*model.FigureRecord, err error)
- func (d *Dao) Close()
- func (d *Dao) Figure(c context.Context, mid int64) (figure *model.Figure, err error)
- func (d *Dao) FigureCache(c context.Context, mid int64) (figure *model.Figure, err error)
- func (d *Dao) Figures(c context.Context, fromMid int64, limit int) (figures []*model.Figure, end bool, err error)
- func (d *Dao) InsertRankHistory(c context.Context, rank *model.Rank) (id int64, err error)
- func (d *Dao) PendingMidsCache(c context.Context, version int64, shard int64) (mids []int64, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PingRedis(c context.Context) (err error)
- func (d *Dao) PutCalcRecord(c context.Context, record *model.FigureRecord, weekTS int64) (err error)
- func (d *Dao) RemoveCache(c context.Context, mid int64) (err error)
- func (d *Dao) SetFigureCache(c context.Context, figure *model.Figure) (err error)
- func (d *Dao) UpsertFigure(c context.Context, figure *model.Figure) (id int64, err error)
- func (d *Dao) UpsertRank(c context.Context, rank *model.Rank) (id int64, err error)
- func (d *Dao) UserInfo(c context.Context, mid int64, weekVer int64) (userInfo *model.UserInfo, err error)
- type HBase
- type Int
- type Mysql
- type Redis
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 struct info of Dao.
func (*Dao) ActionCounter ¶
func (d *Dao) ActionCounter(c context.Context, mid int64, ts int64) (actionCounter *model.ActionCounter, err error)
ActionCounter .
func (*Dao) CalcRecords ¶
func (d *Dao) CalcRecords(c context.Context, mid int64, weekTSFrom, weekTSTo int64) (figureRecords []*model.FigureRecord, err error)
CalcRecords get it from hbase
func (*Dao) FigureCache ¶
FigureCache get FigureUser from cache
func (*Dao) Figures ¶
func (d *Dao) Figures(c context.Context, fromMid int64, limit int) (figures []*model.Figure, end bool, err error)
Figures get all figure info from formMid
func (*Dao) InsertRankHistory ¶
InsertRankHistory insert figure rank history to db
func (*Dao) PendingMidsCache ¶
func (d *Dao) PendingMidsCache(c context.Context, version int64, shard int64) (mids []int64, err error)
PendingMidsCache get PendingUser set from cache
func (*Dao) PutCalcRecord ¶
func (d *Dao) PutCalcRecord(c context.Context, record *model.FigureRecord, weekTS int64) (err error)
PutCalcRecord put record all the params x.
func (*Dao) RemoveCache ¶
RemoveCache remove figure cache
func (*Dao) SetFigureCache ¶
SetFigureCache set FigureUser to cache
func (*Dao) UpsertFigure ¶
UpsertFigure insert or update(if mid duplicated) Figure
func (*Dao) UpsertRank ¶
UpsertRank insert or update figure rank to db
type HBase ¶
type HBase interface { UserInfo(c context.Context, mid int64, weekVer int64) (userInfo *model.UserInfo, err error) PutCalcRecord(c context.Context, record *model.FigureRecord, weekTS int64) (err error) CalcRecords(c context.Context, mid int64, weekTSFrom, weekTSTo int64) (figureRecords []*model.FigureRecord, err error) ActionCounter(c context.Context, mid int64, ts int64) (counter *model.ActionCounter, err error) }
HBase dao hbase interface
type Mysql ¶
type Mysql interface { Figure(c context.Context, mid int64) (figure *model.Figure, err error) Figures(c context.Context, fromMid int64, limit int) (figures []*model.Figure, end bool, err error) UpsertFigure(c context.Context, figure *model.Figure) (id int64, err error) InsertRankHistory(c context.Context, rank *model.Rank) (id int64, err error) UpsertRank(c context.Context, rank *model.Rank) (id int64, err error) }
Mysql dao mysql interface
type Redis ¶
type Redis interface { FigureCache(c context.Context, mid int64) (figure *model.Figure, err error) SetFigureCache(c context.Context, figure *model.Figure) (err error) PendingMidsCache(c context.Context, version int64, shard int64) (mids []int64, err error) RemoveCache(c context.Context, mid int64) (err error) }
Redis dao redis interface
Click to show internal directories.
Click to hide internal directories.