Documentation ¶
Index ¶
- func NewMemoryTokenStore(gcInterval time.Duration) oauth2.TokenStore
- func NewTestClientStore(clients ...*models.Client) oauth2.ClientStore
- type MemoryTokenStore
- func (mts *MemoryTokenStore) Create(info oauth2.TokenInfo) (err error)
- func (mts *MemoryTokenStore) GetByAccess(access string) (ti oauth2.TokenInfo, err error)
- func (mts *MemoryTokenStore) GetByRefresh(refresh string) (ti oauth2.TokenInfo, err error)
- func (mts *MemoryTokenStore) RemoveByAccess(access string) (err error)
- func (mts *MemoryTokenStore) RemoveByRefresh(refresh string) (err error)
- type TestClientStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemoryTokenStore ¶
NewMemoryTokenStore Create a token store instance based on memory gcInterval Perform garbage collection intervals(The default is 30 seconds)
func NewTestClientStore ¶
NewTestClientStore Create to client information store instance
Types ¶
type MemoryTokenStore ¶
type MemoryTokenStore struct {
// contains filtered or unexported fields
}
MemoryTokenStore Memory storage for token
func (*MemoryTokenStore) Create ¶
func (mts *MemoryTokenStore) Create(info oauth2.TokenInfo) (err error)
Create Create and store the new token information
func (*MemoryTokenStore) GetByAccess ¶
func (mts *MemoryTokenStore) GetByAccess(access string) (ti oauth2.TokenInfo, err error)
GetByAccess Use the access token for token information data
func (*MemoryTokenStore) GetByRefresh ¶
func (mts *MemoryTokenStore) GetByRefresh(refresh string) (ti oauth2.TokenInfo, err error)
GetByRefresh Use the refresh token for token information data
func (*MemoryTokenStore) RemoveByAccess ¶
func (mts *MemoryTokenStore) RemoveByAccess(access string) (err error)
RemoveByAccess Use the access token to delete the token information
func (*MemoryTokenStore) RemoveByRefresh ¶
func (mts *MemoryTokenStore) RemoveByRefresh(refresh string) (err error)
RemoveByRefresh Use the refresh token to delete the token information
type TestClientStore ¶
type TestClientStore struct {
// contains filtered or unexported fields
}
TestClientStore Client information store
func (*TestClientStore) GetByID ¶
func (ts *TestClientStore) GetByID(id string) (cli oauth2.ClientInfo, err error)
GetByID According to the ID for the client information