store

package
v3.8.3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileTokenStore

func NewFileTokenStore(filename string) (store oauth2.TokenStore, err error)

NewFileTokenStore create a token store instance based on file

func NewMemoryTokenStore

func NewMemoryTokenStore() (store oauth2.TokenStore, err error)

NewMemoryTokenStore create a token store instance based on memory

Types

type ClientStore

type ClientStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ClientStore client information store

func NewClientStore

func NewClientStore() *ClientStore

func (*ClientStore) GetByID

func (cs *ClientStore) GetByID(id string) (cli oauth2.ClientInfo, err error)

GetByID according to the ID for the client information

func (*ClientStore) Set

func (cs *ClientStore) Set(id string, cli oauth2.ClientInfo) (err error)

Set set client information

type TokenStore

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

TokenStore token storage based on buntdb(https://github.com/tidwall/buntdb)

func (*TokenStore) Create

func (ts *TokenStore) Create(info oauth2.TokenInfo) (err error)

Create create and store the new token information

func (*TokenStore) GetByAccess

func (ts *TokenStore) GetByAccess(access string) (ti oauth2.TokenInfo, err error)

GetByAccess use the access token for token information data

func (*TokenStore) GetByCode

func (ts *TokenStore) GetByCode(code string) (ti oauth2.TokenInfo, err error)

GetByCode use the authorization code for token information data

func (*TokenStore) GetByRefresh

func (ts *TokenStore) GetByRefresh(refresh string) (ti oauth2.TokenInfo, err error)

GetByRefresh use the refresh token for token information data

func (*TokenStore) RemoveByAccess

func (ts *TokenStore) RemoveByAccess(access string) (err error)

RemoveByAccess use the access token to delete the token information

func (*TokenStore) RemoveByCode

func (ts *TokenStore) RemoveByCode(code string) (err error)

RemoveByCode use the authorization code to delete the token information

func (*TokenStore) RemoveByRefresh

func (ts *TokenStore) RemoveByRefresh(refresh string) (err error)

RemoveByRefresh use the refresh token to delete the token information

Jump to

Keyboard shortcuts

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