Documentation ¶
Index ¶
- func NewFileTokenStore(filename string) (store oauth2.TokenStore, err error)
- func NewMemoryTokenStore() (store oauth2.TokenStore, err error)
- type ClientStore
- type TokenStore
- func (ts *TokenStore) Create(info oauth2.TokenInfo) (err error)
- func (ts *TokenStore) GetByAccess(access string) (ti oauth2.TokenInfo, err error)
- func (ts *TokenStore) GetByCode(code string) (ti oauth2.TokenInfo, err error)
- func (ts *TokenStore) GetByRefresh(refresh string) (ti oauth2.TokenInfo, err error)
- func (ts *TokenStore) RemoveByAccess(access string) (err error)
- func (ts *TokenStore) RemoveByCode(code string) (err error)
- func (ts *TokenStore) RemoveByRefresh(refresh string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileTokenStore ¶
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 ¶
ClientStore client information store
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