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: 18 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 {
	HTTPClient *bm.Client
	URL        string

	BusinessesMap map[int64]*model.Business
	BusinessNames map[string]*model.Business
	// contains filtered or unexported fields
}

Dao dao.

func New

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

New new history dao and return.

func (*Dao) Add

func (d *Dao) Add(ctx context.Context, h *model.History) error

Add add history list.

func (*Dao) AddHistories

func (d *Dao) AddHistories(c context.Context, hs []*model.History) (err error)

AddHistories add histories to db

func (*Dao) Businesses

func (d *Dao) Businesses(c context.Context) (res []*model.Business, err error)

Businesses business

func (*Dao) Close

func (d *Dao) Close()

Close close the redis and kafka resource.

func (*Dao) DelCache

func (d *Dao) DelCache(c context.Context, business string, mid int64, aids []int64) (err error)

DelCache delete the history redis.

func (*Dao) DelLock

func (d *Dao) DelLock(c context.Context) (ok bool, err error)

DelLock delete proc lock

func (*Dao) DeleteHistories

func (d *Dao) DeleteHistories(c context.Context, bid int64, beginTime, endTime time.Time) (rows int64, err error)

DeleteHistories delete histories

func (*Dao) DeleteUserHistories

func (d *Dao) DeleteUserHistories(c context.Context, mid, bid int64, t time.Time) (rows int64, err error)

DeleteUserHistories .

func (*Dao) EarlyHistory

func (d *Dao) EarlyHistory(c context.Context, businessID int64) (res time.Time, err error)

EarlyHistory .

func (*Dao) Flush

func (d *Dao) Flush(c context.Context, mids string, stime int64) (err error)

Flush flush history to store by mids.

func (*Dao) HistoriesCache

func (d *Dao) HistoriesCache(c context.Context, merges []*model.Merge) (res []*model.History, err error)

HistoriesCache return the user histories from redis.

func (*Dao) Ping

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

Ping check connection success.

func (*Dao) TrimCache

func (d *Dao) TrimCache(c context.Context, business string, mid int64, limit int) (err error)

TrimCache trim history.

func (*Dao) UserHistories

func (d *Dao) UserHistories(c context.Context, mid, businessID int64) (res []time.Time, err error)

UserHistories .

Jump to

Keyboard shortcuts

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