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: 10 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

func New

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

New init mysql db

func (*Dao) AddCookie

func (d *Dao) AddCookie(c context.Context, cookie *model.Cookie, now time.Time) (affected int64, err error)

AddCookie add cookie

func (*Dao) AddOldCookie

func (d *Dao) AddOldCookie(c context.Context, cookie *model.OldCookie) (affected int64, err error)

AddOldCookie add old cookie

func (*Dao) AddOldToken

func (d *Dao) AddOldToken(c context.Context, token *model.OldToken, t time.Time) (affected int64, err error)

AddOldToken add old token

func (*Dao) AddRefresh

func (d *Dao) AddRefresh(c context.Context, refresh *model.Refresh, t time.Time) (affected int64, err error)

AddRefresh add refresh

func (*Dao) AddToken

func (d *Dao) AddToken(c context.Context, token *model.Token, t time.Time) (affected int64, err error)

AddToken add token

func (*Dao) Close

func (d *Dao) Close()

Close close the resource.

func (*Dao) CookieCache

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

CookieCache get cookie info from cache

func (*Dao) DelCookie

func (d *Dao) DelCookie(c context.Context, session []byte, t time.Time) (affected int64, err error)

DelCookie del cookie by session

func (*Dao) DelCookieByMid

func (d *Dao) DelCookieByMid(c context.Context, mid int64, t time.Time) (affected int64, err error)

DelCookieByMid del cookie by mid

func (*Dao) DelCookieCache

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

DelCookieCache delete cookie cache

func (*Dao) DelOldCookie

func (d *Dao) DelOldCookie(c context.Context, session string, mid int64) (affected int64, err error)

DelOldCookie del old cookie by session_data

func (*Dao) DelOldCookieByMid

func (d *Dao) DelOldCookieByMid(c context.Context, mid int64) (affected int64, err error)

DelOldCookieByMid del old cookie by mid

func (*Dao) DelOldToken

func (d *Dao) DelOldToken(c context.Context, token string, t time.Time) (affected int64, err error)

DelOldToken del old token by access_token

func (*Dao) DelOldTokenByMid

func (d *Dao) DelOldTokenByMid(c context.Context, mid int64, t time.Time) (affected int64, err error)

DelOldTokenByMid del old token by mid

func (*Dao) DelRefresh

func (d *Dao) DelRefresh(c context.Context, refresh []byte, t time.Time) (affected int64, err error)

DelRefresh del refresh

func (*Dao) DelRefreshByMid

func (d *Dao) DelRefreshByMid(c context.Context, mid int64, t time.Time) (affected int64, err error)

DelRefreshByMid del refresh by mid

func (*Dao) DelToken

func (d *Dao) DelToken(c context.Context, token []byte, t time.Time) (affected int64, err error)

DelToken del token by access_token

func (*Dao) DelTokenByMid

func (d *Dao) DelTokenByMid(c context.Context, mid int64, t time.Time) (affected int64, err error)

DelTokenByMid del token by mid

func (*Dao) DelTokenCache

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

DelTokenCache delete token cache

func (*Dao) GetCookie

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

GetCookie get cookie by session

func (*Dao) GetRefresh

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

GetRefresh get refresh by refresh_token

func (*Dao) GetToken

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

GetToken get token by access_token

func (*Dao) GetUserBaseByUserID

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

GetUserBaseByUserID get user base by userID

func (*Dao) GetUserByMid

func (d *Dao) GetUserByMid(c context.Context, mid int64) (res *model.User, err error)

GetUserByMid get user by userID

func (*Dao) GetUserMailByMail

func (d *Dao) GetUserMailByMail(c context.Context, mail []byte) (res int64, err error)

GetUserMailByMail get user mail by mail

func (*Dao) GetUserTelByTel

func (d *Dao) GetUserTelByTel(c context.Context, tel []byte) (res int64, err error)

GetUserTelByTel get user tel by tel

func (*Dao) LoadSecret

func (d *Dao) LoadSecret(c context.Context) (res []*model.Secret, err error)

LoadSecret load secret

func (*Dao) Ping

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

Ping dao ping

func (*Dao) SetCookieCache

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

SetCookieCache set cookie info to cache

func (*Dao) SetRefreshCache

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

SetRefreshCache set refresh token to cache .

func (*Dao) SetTokenCache

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

SetTokenCache set token to cache

func (*Dao) TokenCache

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

TokenCache get token info from cache

Jump to

Keyboard shortcuts

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