Documentation ¶
Index ¶
- type Config
- type Store
- func (s *Store) ClearByAccessToken(userId int64) error
- func (s *Store) Close()
- func (s *Store) Create(info model.TokenInfo) (model.TokenResponse, error)
- func (s *Store) CreateClient(userId int64, name string) (model.Clients, error)
- func (s *Store) GetByAccess(access string) (*model.AccessTokens, error)
- func (s *Store) GetByRefresh(refresh string) (*model.AccessTokens, error)
- func (s *Store) RevokeByAccessTokens(userId int64) error
- func (s *Store) RevokeRefreshToken(accessTokenId string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store mysql token store model
func NewDefaultStore ¶
NewDefaultStore create mysql store instance, config mysql configuration,
func NewStore ¶
NewStore create mysql store instance, config mysql configuration, GC time interval (in seconds, default 600)
func NewStoreWithDB ¶
NewStoreWithDB create mysql store instance, db sql.DB, GC time interval (in seconds, default 600)
func (*Store) ClearByAccessToken ¶
ClearByAccessToken clears all token related to user, userId id of user whose access token needs to be cleared
func (*Store) CreateClient ¶
CreateClient creates new client, userId user's id who created the client
func (*Store) GetByAccess ¶
func (s *Store) GetByAccess(access string) (*model.AccessTokens, error)
GetByAccess use the access token for token information data, access Access token string
func (*Store) GetByRefresh ¶
func (s *Store) GetByRefresh(refresh string) (*model.AccessTokens, error)
GetByRefresh use the refresh token for token information data, refresh Refresh token string
func (*Store) RevokeByAccessTokens ¶
RevokeByAccessTokens revokes token from accessToken
func (*Store) RevokeRefreshToken ¶
RevokeRefreshToken revokes token from RefreshToken,