Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddHistories(c context.Context, hs []*model.History) (err error)
- func (d *Dao) AddHistoriesCache(c context.Context, hs []*pb.AddHistoryReq) (err error)
- func (d *Dao) AddHistoryCache(c context.Context, h *pb.AddHistoryReq) (err error)
- func (d *Dao) AddHistoryMessage(c context.Context, k int, msg []*model.Merge) (err error)
- func (d *Dao) ClearAllHistory(c context.Context, mid int64) (err error)
- func (d *Dao) ClearHistory(c context.Context, mid int64, businesses []string) (err error)
- func (d *Dao) ClearHistoryCache(c context.Context, mid int64, businesses []string) (err error)
- func (d *Dao) Close()
- func (d *Dao) DelCache(c context.Context, business string, mid int64, aids []int64) (err error)
- func (d *Dao) DelHistoryCache(c context.Context, arg *pb.DelHistoriesReq) (err error)
- func (d *Dao) DeleteHistories(c context.Context, h *pb.DelHistoriesReq) (err error)
- func (d *Dao) Histories(c context.Context, business string, mid int64, ids []int64) (res map[int64]*model.History, err error)
- func (d *Dao) HistoriesCache(c context.Context, mid int64, hs map[string][]int64) (res map[string]map[int64]*model.History, err error)
- func (d *Dao) ListCacheByTime(c context.Context, business string, mid int64, start int64) (aids []int64, err error)
- func (d *Dao) ListsCacheByTime(c context.Context, businesses []string, mid int64, viewAt, ps int64) (res map[string][]int64, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) QueryBusinesses(c context.Context) (res []*model.Business, err error)
- func (d *Dao) SetUserHideCache(c context.Context, mid, value int64) (err error)
- func (d *Dao) TrimCache(c context.Context, business string, mid int64, limit int) (err error)
- func (d *Dao) UpdateUserHide(c context.Context, mid int64, hide bool) (err error)
- func (d *Dao) UserHide(c context.Context, mid int64) (hide bool, err error)
- func (d *Dao) UserHideCache(c context.Context, mid int64) (value int64, err error)
- func (d *Dao) UserHistories(c context.Context, businesses []string, mid, viewAt, ps int64) (res map[string][]*model.History, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct { Businesses map[int64]*model.Business BusinessNames map[string]*model.Business // contains filtered or unexported fields }
Dao dao
func (*Dao) AddHistories ¶
AddHistories add histories to db
func (*Dao) AddHistoriesCache ¶
AddHistoriesCache add the user to redis.
func (*Dao) AddHistoryCache ¶
AddHistoryCache add the history to redis.
func (*Dao) AddHistoryMessage ¶
AddHistoryMessage .
func (*Dao) ClearAllHistory ¶
ClearAllHistory clear all histories
func (*Dao) ClearHistory ¶
ClearHistory clear histories
func (*Dao) ClearHistoryCache ¶
ClearHistoryCache clear the user redis.
func (*Dao) DelHistoryCache ¶
DelHistoryCache delete the history redis.
func (*Dao) DeleteHistories ¶
DeleteHistories .
func (*Dao) Histories ¶
func (d *Dao) Histories(c context.Context, business string, mid int64, ids []int64) (res map[int64]*model.History, err error)
Histories get histories by id
func (*Dao) HistoriesCache ¶
func (d *Dao) HistoriesCache(c context.Context, mid int64, hs map[string][]int64) (res map[string]map[int64]*model.History, err error)
HistoriesCache return the user histories from redis.
func (*Dao) ListCacheByTime ¶
func (d *Dao) ListCacheByTime(c context.Context, business string, mid int64, start int64) (aids []int64, err error)
ListCacheByTime get aids from redis where score.
func (*Dao) ListsCacheByTime ¶
func (d *Dao) ListsCacheByTime(c context.Context, businesses []string, mid int64, viewAt, ps int64) (res map[string][]int64, err error)
ListsCacheByTime get aids from redis where score.
func (*Dao) QueryBusinesses ¶
QueryBusinesses business
func (*Dao) SetUserHideCache ¶
SetUserHideCache set the user hide to redis.
func (*Dao) UpdateUserHide ¶
UpdateUserHide update user hide
func (*Dao) UserHideCache ¶
UserHideCache return user hide state from redis.