block

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: 17 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 {
	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) BeginTran

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

BeginTran is

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) DeleteUserCache

func (d *Dao) DeleteUserCache(c context.Context, mid int64) (err error)

DeleteUserCache delete user cache

func (*Dao) DeleteUserDetailCache

func (d *Dao) DeleteUserDetailCache(c context.Context, mid int64) (err error)

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

func (d *Dao) TxInsertHistory(c context.Context, tx *xsql.Tx, h *model.DBHistory) (err error)

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

func (d *Dao) UpdateAddBlockCount(c context.Context, mid int64) (err error)

UpdateAddBlockCount is

func (*Dao) User

func (d *Dao) User(c context.Context, mid int64) (user *model.DBUser, err error)

User get block user from db

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

func (d *Dao) UserLastHistory(c context.Context, mid int64) (his *model.DBHistory, err error)

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

Jump to

Keyboard shortcuts

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