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: 15 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 is redis dao.

func New

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

New is new redis dao.

func (*Dao) Add

func (d *Dao) Add(ctx context.Context, p *model.ShareParams) (shared int64, err error)

Add add share

func (*Dao) AddShare

func (d *Dao) AddShare(c context.Context, oid int64, tp int) (err error)

AddShare add share

func (*Dao) AddShareMember

func (d *Dao) AddShareMember(ctx context.Context, p *model.ShareParams) (ok bool, err error)

AddShareMember add share

func (*Dao) BeginTran

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

BeginTran begin transcation.

func (*Dao) Close

func (d *Dao) Close()

Close close

func (*Dao) Ping

func (d *Dao) Ping() (err error)

Ping ping

func (*Dao) PubShare

func (d *Dao) PubShare(c context.Context, p *model.ShareParams) (err error)

PubShare .

func (*Dao) PubStatShare

func (d *Dao) PubStatShare(c context.Context, typ string, oid, count int64) (err error)

PubStatShare .

func (*Dao) SetShareCache

func (d *Dao) SetShareCache(c context.Context, oid int64, tp int, shared int64) (err error)

SetShareCache set share cache

func (*Dao) Share

func (d *Dao) Share(c context.Context, oid int64, tp int) (share *model.Share, err error)

Share get share

func (*Dao) ShareCache

func (d *Dao) ShareCache(c context.Context, oid int64, tp int) (shared int64, err error)

ShareCache return oid share count

func (*Dao) ShareCount

func (d *Dao) ShareCount(ctx context.Context, oid int64, tp int) (count int64, err error)

ShareCount get share from cache/db

func (*Dao) Shares

func (d *Dao) Shares(ctx context.Context, oids []int64, tp int) (shares map[int64]int64, err error)

Shares get shares

func (*Dao) SharesCache

func (d *Dao) SharesCache(c context.Context, oids []int64, tp int) (shares map[int64]int64, err error)

SharesCache return oids share

Jump to

Keyboard shortcuts

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