share

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: 9 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 share dao.

func New

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

New new a share dao.

func (*Dao) AddShare

func (d *Dao) AddShare(c context.Context, mid, aid int64, ip string) (ok bool, err error)

AddShare add a share with mid and ip to redis.

func (*Dao) Close

func (d *Dao) Close()

Close close resource.

func (*Dao) HadFirstShare

func (d *Dao) HadFirstShare(c context.Context, mid, aid int64, ip string) (had bool, err error)

HadFirstShare if key not exist need set expire to one day.

func (*Dao) Ping

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

Ping ping success.

func (*Dao) PubShare

func (d *Dao) PubShare(c context.Context, aid int64, mid int64, ip string) (err error)

PubShare pub first share to databus

func (*Dao) PubStatDatabus

func (d *Dao) PubStatDatabus(c context.Context, aid int64, share int) (err error)

PubStatDatabus pub share count into databus.

Jump to

Keyboard shortcuts

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