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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromError

func PromError(name string)

PromError prom error

Types

type Dao

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

Dao struct info of Dao

func New

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

New new a Dao and return.

func (*Dao) AccessCache

func (d *Dao) AccessCache(c context.Context, key string) (res *model.IdentifyInfo, err error)

AccessCache .

func (*Dao) AccessCookie

func (d *Dao) AccessCookie(c context.Context, cookie string) (res *model.IdentifyInfo, err error)

AccessCookie .

func (*Dao) AccessToken

func (d *Dao) AccessToken(c context.Context, accesskey string) (res *model.IdentifyInfo, err error)

AccessToken .

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) DelCache

func (d *Dao) DelCache(c context.Context, key string) (err error)

DelCache delete access cache.

func (*Dao) ExistMIDAndIP

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

ExistMIDAndIP check is exist mid

func (*Dao) Ping

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

Ping ping health.

func (*Dao) SetAccessCache

func (d *Dao) SetAccessCache(c context.Context, key string, res *model.IdentifyInfo)

SetAccessCache .

func (*Dao) SetLoginCache

func (d *Dao) SetLoginCache(c context.Context, mid int64, ip string, expires int32) (err error)

SetLoginCache set login cache

Jump to

Keyboard shortcuts

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