history

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: 20 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 {
	// contains filtered or unexported fields
}

Dao dao.

func New

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

New new history dao and return.

func (*Dao) Add

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

Add add history list.

func (*Dao) AddCache

func (d *Dao) AddCache(c context.Context, mid int64, h *model.History) (err error)

AddCache add the user State to redis.

func (*Dao) AddCacheMap

func (d *Dao) AddCacheMap(c context.Context, mid int64, hm map[int64]*model.History) (err error)

AddCacheMap add the user State to redis.

func (*Dao) AddMap

func (d *Dao) AddMap(ctx context.Context, mid int64, hs map[int64]*model.History) (err error)

AddMap add history list.

func (*Dao) AidsMap

func (d *Dao) AidsMap(ctx context.Context, mid int64, aids []int64) (his map[int64]*model.History, err error)

AidsMap get all Historys from hbase by aids.

func (*Dao) Bangumis

func (d *Dao) Bangumis(c context.Context, mid int64, epid []int64) (map[int64]*model.Bangumi, error)

Bangumis .

func (*Dao) BangumisByAids

func (d *Dao) BangumisByAids(c context.Context, mid int64, aids []int64, realIP string) (map[int64]*model.BangumiSeason, error)

BangumisByAids .

func (*Dao) Cache

func (d *Dao) Cache(c context.Context, mid int64, aids []int64) (amap map[int64]*model.History, miss []int64, err error)

Cache return the user State from redis.

func (*Dao) CacheMap

func (d *Dao) CacheMap(c context.Context, mid int64) (amap map[int64]*model.History, err error)

CacheMap return the user State from redis.

func (*Dao) Clear

func (d *Dao) Clear(ctx context.Context, mid int64) (err error)

Clear clear history.

func (*Dao) ClearCache

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

ClearCache clear the user State redis.

func (*Dao) Close

func (d *Dao) Close()

Close close the redis and kafka resource.

func (*Dao) DelAids

func (d *Dao) DelAids(ctx context.Context, mid int64, aids []int64) (err error)

DelAids delete more history.

func (*Dao) DelCache

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

DelCache delete the history redis.

func (*Dao) Delete

func (d *Dao) Delete(ctx context.Context, mid int64, his []*model.History) (err error)

Delete delete more history.

func (*Dao) ExpireCache

func (d *Dao) ExpireCache(c context.Context, mid int64) (bool, error)

ExpireCache expire the user State redis.

func (*Dao) ExpireIndexCache

func (d *Dao) ExpireIndexCache(c context.Context, mid int64) (bool, error)

ExpireIndexCache expire index cache.

func (*Dao) IndexCache

func (d *Dao) IndexCache(c context.Context, mid int64, start, end int) (aids []int64, err error)

IndexCache get history from redis.

func (*Dao) IndexCacheByTime

func (d *Dao) IndexCacheByTime(c context.Context, mid int64, start int64) (aids []int64, err error)

IndexCacheByTime get aids from redis where score.

func (*Dao) InfoShadow

func (d *Dao) InfoShadow(ctx context.Context, mid int64) (sw int64, err error)

InfoShadow return the user switch from hbase.

func (*Dao) Map

func (d *Dao) Map(ctx context.Context, mid int64) (his map[string]*model.History, err error)

Map get all Historys from hbase.

func (*Dao) Merge

func (d *Dao) Merge(c context.Context, mid int64, msg interface{}) (err error)

Merge send history to databus.

func (*Dao) Ping

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

Ping check connection success.

func (*Dao) PingRedis

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

PingRedis check redis connection

func (*Dao) PlayPro

func (d *Dao) PlayPro(c context.Context, key string, msg interface{}) (err error)

PlayPro send history to databus.

func (*Dao) ProPub

func (d *Dao) ProPub(c context.Context, key string, msg interface{}) (err error)

ProPub send history to databus.

func (*Dao) PushFirstQueue

func (d *Dao) PushFirstQueue(c context.Context, mid, aid, now int64) (err error)

PushFirstQueue push first view record every day into kafka.

func (*Dao) SetInfoShadow

func (d *Dao) SetInfoShadow(ctx context.Context, mid, value int64) (err error)

SetInfoShadow set the user switch to hbase.

func (*Dao) SetShadowCache

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

SetShadowCache set the user switch to redis.

func (*Dao) ShadowCache

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

ShadowCache return user switch redis.

func (*Dao) TrimCache

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

TrimCache trim history.

Jump to

Keyboard shortcuts

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