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: 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 dao struct

func New

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

New create new dao

func (*Dao) Close

func (d *Dao) Close()

Close close connections of mc, redis, db.

func (*Dao) Cookie

func (d *Dao) Cookie(c context.Context, sd []byte, ct time.Time) (res *model.Cookie, session []byte, err error)

Cookie get cookie by session

func (*Dao) CookieCache

func (d *Dao) CookieCache(c context.Context, session string) (res *model.Cookie, err error)

CookieCache get cookie info from cache

func (*Dao) DelCookieCache

func (d *Dao) DelCookieCache(c context.Context, session string) (err error)

DelCookieCache del cache.

func (*Dao) DelRefreshCache

func (d *Dao) DelRefreshCache(c context.Context, refresh string) (err error)

DelRefreshCache del refresh token from cache

func (*Dao) DelTokenCache

func (d *Dao) DelTokenCache(c context.Context, token string) (err error)

DelTokenCache del cache.

func (*Dao) Ping

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

Ping check db and mc health.

func (*Dao) Refresh

func (d *Dao) Refresh(c context.Context, rk []byte, ct time.Time) (res *model.Refresh, err error)

Refresh get token by access_token

func (*Dao) RefreshCache

func (d *Dao) RefreshCache(c context.Context, refresh string) (res *model.Refresh, err error)

RefreshCache get refresh token from cache

func (*Dao) SetCookieCache

func (d *Dao) SetCookieCache(c context.Context, session string, res *model.Cookie) (err error)

SetCookieCache set cookie info to cache

func (*Dao) SetRefreshCache

func (d *Dao) SetRefreshCache(c context.Context, refresh *model.Refresh) (err error)

SetRefreshCache set refresh token to cache .

func (*Dao) SetTokenCache

func (d *Dao) SetTokenCache(c context.Context, k string, res *model.Token) (err error)

SetTokenCache set token to cache

func (*Dao) Token

func (d *Dao) Token(c context.Context, token []byte, ct time.Time) (res *model.Token, err error)

Token get token by access_token

func (*Dao) TokenCache

func (d *Dao) TokenCache(c context.Context, sd string) (res *model.Token, err error)

TokenCache get token from cache

Jump to

Keyboard shortcuts

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