toview

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: 13 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, aid, now int64) (err error)

Add add one toview.

func (*Dao) AddCache

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

AddCache add user toview to redis.

func (*Dao) AddCacheList

func (d *Dao) AddCacheList(c context.Context, mid int64, views []*model.ToView) error

AddCacheList add user toview to redis.

func (*Dao) AddMap

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

AddMap add some toview.

func (*Dao) Adds

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

Adds add some toview.

func (*Dao) Cache

func (d *Dao) Cache(c context.Context, mid int64, start, end int) (res []*model.ToView, err error)

Cache return the user all toview from redis.

func (*Dao) CacheMap

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

CacheMap return the user all toview map from redis.

func (*Dao) Clear

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

Clear clear ToView.

func (*Dao) ClearCache

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

ClearCache delete the user toview redis.

func (*Dao) Close

func (d *Dao) Close()

Close close the redis and kafka resource.

func (*Dao) CntCache

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

CntCache return the user toview count from redis.

func (*Dao) Del

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

Del delete more toview.

func (*Dao) DelCaches

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

DelCaches delete the user toview redis.

func (*Dao) Expire

func (d *Dao) Expire(c context.Context, mid int64) (ok bool, err error)

Expire expire toview by mid.

func (*Dao) ListInfo

func (d *Dao) ListInfo(ctx context.Context, mid int64, aids []int64) (res []*model.ToView, err error)

ListInfo get all ToViews from hbase.

func (*Dao) MapInfo

func (d *Dao) MapInfo(ctx context.Context, mid int64, aids []int64) (res map[int64]*model.ToView, err error)

MapInfo get all ToViews from hbase.

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

Jump to

Keyboard shortcuts

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