Documentation ¶
Index ¶
- type Dao
- func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error)
- func (d *Dao) Close()
- func (d *Dao) DeleteUserCache(c context.Context, mid int64) (err error)
- func (d *Dao) DeleteUserDetailCache(c context.Context, mid int64) (err error)
- func (d *Dao) SendSysMsg(c context.Context, code string, mids []int64, title string, content string, ...) (err error)
- func (d *Dao) SetUserCache(c context.Context, mid int64, status model.BlockStatus, ...) (err error)
- func (d *Dao) SetUserDetailCache(c context.Context, mid int64, detail *model.MCUserDetail) (err error)
- func (d *Dao) TxInsertHistory(c context.Context, tx *xsql.Tx, h *model.DBHistory) (err error)
- func (d *Dao) TxUpdateUser(c context.Context, tx *xsql.Tx, mid int64, status model.BlockStatus) (err error)
- func (d *Dao) UpdateAddBlockCount(c context.Context, mid int64) (err error)
- func (d *Dao) User(c context.Context, mid int64) (user *model.DBUser, err error)
- func (d *Dao) UserDetails(c context.Context, mids []int64) (midMap map[int64]*model.DBUserDetail, err error)
- func (d *Dao) UserDetailsCache(c context.Context, mids []int64) (res map[int64]*model.MCUserDetail, err error)
- func (d *Dao) UserLastHistory(c context.Context, mid int64) (his *model.DBHistory, err error)
- func (d *Dao) UserStatusList(c context.Context, status model.BlockStatus, startID int64, limit int) (maxID int64, mids []int64, err error)
- func (d *Dao) UserStatusMapWithMIDs(c context.Context, status model.BlockStatus, mids []int64) (midMap map[int64]struct{}, err error)
- func (d *Dao) UsersCache(c context.Context, mids []int64) (res map[int64]*model.MCBlockInfo, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct { NotifyPurgeCache notifyFunc // contains filtered or unexported fields }
Dao is
func New ¶
func New(conf *conf.Config, db *sql.DB, mc *memcache.Pool, client *bm.Client, notifyFunc notifyFunc) *Dao
New is
func (*Dao) DeleteUserCache ¶
DeleteUserCache delete user cache
func (*Dao) DeleteUserDetailCache ¶
DeleteUserDetailCache delete user detail cache
func (*Dao) SendSysMsg ¶
func (d *Dao) SendSysMsg(c context.Context, code string, mids []int64, title string, content string, remoteIP string) (err error)
SendSysMsg send sys msg.
func (*Dao) SetUserCache ¶
func (d *Dao) SetUserCache(c context.Context, mid int64, status model.BlockStatus, startTime, endTime int64) (err error)
SetUserCache set user block info to cache
func (*Dao) SetUserDetailCache ¶
func (d *Dao) SetUserDetailCache(c context.Context, mid int64, detail *model.MCUserDetail) (err error)
SetUserDetailCache set user detail to cache
func (*Dao) TxInsertHistory ¶
TxInsertHistory is
func (*Dao) TxUpdateUser ¶
func (d *Dao) TxUpdateUser(c context.Context, tx *xsql.Tx, mid int64, status model.BlockStatus) (err error)
TxUpdateUser is
func (*Dao) UpdateAddBlockCount ¶
UpdateAddBlockCount is
func (*Dao) UserDetails ¶
func (d *Dao) UserDetails(c context.Context, mids []int64) (midMap map[int64]*model.DBUserDetail, err error)
UserDetails .
func (*Dao) UserDetailsCache ¶
func (d *Dao) UserDetailsCache(c context.Context, mids []int64) (res map[int64]*model.MCUserDetail, err error)
UserDetailsCache .
func (*Dao) UserLastHistory ¶
UserLastHistory get lastest block history
func (*Dao) UserStatusList ¶
func (d *Dao) UserStatusList(c context.Context, status model.BlockStatus, startID int64, limit int) (maxID int64, mids []int64, err error)
UserStatusList get user status list
func (*Dao) UserStatusMapWithMIDs ¶
func (d *Dao) UserStatusMapWithMIDs(c context.Context, status model.BlockStatus, mids []int64) (midMap map[int64]struct{}, err error)
UserStatusMapWithMIDs get user block status map by mids
func (*Dao) UsersCache ¶
func (d *Dao) UsersCache(c context.Context, mids []int64) (res map[int64]*model.MCBlockInfo, err error)
UsersCache get block info by mids
Click to show internal directories.
Click to hide internal directories.