Documentation
¶
Index ¶
- type ClientStore
- type ClientStoreItem
- type ClientStoreOption
- type Config
- type Store
- func (s *Store) Close()
- func (s *Store) Create(ctx context.Context, info oauth2.TokenInfo) error
- func (s *Store) GetByAccess(ctx context.Context, access string) (oauth2.TokenInfo, error)
- func (s *Store) GetByCode(ctx context.Context, code string) (oauth2.TokenInfo, error)
- func (s *Store) GetByRefresh(ctx context.Context, refresh string) (oauth2.TokenInfo, error)
- func (s *Store) RemoveByAccess(ctx context.Context, access string) error
- func (s *Store) RemoveByCode(ctx context.Context, code string) error
- func (s *Store) RemoveByRefresh(ctx context.Context, refresh string) error
- func (s *Store) SetStdout(stdout io.Writer) *Store
- type StoreItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStore ¶
type ClientStore struct {
// contains filtered or unexported fields
}
func NewClientStore ¶
func NewClientStore(db *xorm.Engine, options ...ClientStoreOption) (*ClientStore, error)
NewClientStore creates xorm mysql store instance
func (*ClientStore) Create ¶
func (s *ClientStore) Create(info oauth2.ClientInfo) error
Create creates and stores the new client information
type ClientStoreItem ¶
type ClientStoreItem struct { ID string `xorm:"id"` Secret string `xorm:"secret"` Domain string `xorm:"domain"` Data string `xorm:"data"` }
ClientStoreItem data item
type ClientStoreOption ¶
type ClientStoreOption func(s *ClientStore)
ClientStoreOption is the configuration options type for client store
func WithClientStoreInitTableDisabled ¶
func WithClientStoreInitTableDisabled() ClientStoreOption
WithClientStoreInitTableDisabled returns option that disables table creation on client store instantiation
func WithClientStoreTableName ¶
func WithClientStoreTableName(tableName string) ClientStoreOption
WithClientStoreTableName returns option that sets client store table name
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store mysql token store
func NewDefaultStore ¶
NewDefaultStore create mysql store instance
func NewStore ¶
NewStore create mysql store instance, config mysql configuration, tableName table name (default oauth2_token), GC time interval (in seconds, default 600)
func NewStoreWithDB ¶
NewStoreWithDB create mysql store instance, db sql.DB, tableName table name (default oauth2_token), GC time interval (in seconds, default 600)
func (*Store) GetByAccess ¶
GetByAccess use the access token for token information data
func (*Store) GetByRefresh ¶
GetByRefresh use the refresh token for token information data
func (*Store) RemoveByAccess ¶
RemoveByAccess use the access token to delete the token information
func (*Store) RemoveByCode ¶
RemoveByCode delete the authorization code
func (*Store) RemoveByRefresh ¶
RemoveByRefresh use the refresh token to delete the token information