kfc

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KfcCodeUsed       = 1
	KfcCodeNotGiveOut = 0
)

KfcCodeUsed kfcDao const.

Functions

func PromError

func PromError(name string, format string, args ...interface{})

PromError stat and log.

Types

type Dao

type Dao struct {
	// contains filtered or unexported fields
}

Dao dao.

func New

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

New dao new.

func (*Dao) AddCacheKfcCode

func (d *Dao) AddCacheKfcCode(c context.Context, id string, val int64) (err error)

AddCacheKfcCode Set data to mc

func (*Dao) AddCacheKfcCoupon

func (d *Dao) AddCacheKfcCoupon(c context.Context, id int64, val *kfc.BnjKfcCoupon) (err error)

AddCacheKfcCoupon Set data to mc

func (*Dao) CacheKfcCode

func (d *Dao) CacheKfcCode(c context.Context, id string) (res int64, err error)

CacheKfcCode get data from mc

func (*Dao) CacheKfcCoupon

func (d *Dao) CacheKfcCoupon(c context.Context, id int64) (res *kfc.BnjKfcCoupon, err error)

CacheKfcCoupon get data from mc

func (*Dao) Close

func (d *Dao) Close()

Close Dao

func (*Dao) DelCacheKfcCoupon

func (d *Dao) DelCacheKfcCoupon(c context.Context, id int64) (err error)

DelCacheKfcCoupon delete data from mc

func (*Dao) KfcCodeGiveOut

func (d *Dao) KfcCodeGiveOut(c context.Context, id int64) (res int64, err error)

KfcCodeGiveOut .

func (*Dao) KfcCoupon

func (d *Dao) KfcCoupon(c context.Context, id int64) (res *kfc.BnjKfcCoupon, err error)

KfcCoupon get data from cache if miss will call source method, then add to cache.

func (*Dao) KfcDeliver

func (d *Dao) KfcDeliver(c context.Context, id, mid int64) (res int64, err error)

KfcDeliver .

func (*Dao) KfcWinner

func (d *Dao) KfcWinner(c context.Context, id int64) (uid int64, err error)

KfcWinner .

func (*Dao) RawKfcCode

func (d *Dao) RawKfcCode(c context.Context, code string) (res *kfc.BnjKfcCoupon, err error)

RawKfcCode .

func (*Dao) RawKfcCoupon

func (d *Dao) RawKfcCoupon(c context.Context, id int64) (res *kfc.BnjKfcCoupon, err error)

RawKfcCoupon get coupon .

Jump to

Keyboard shortcuts

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