Documentation ¶
Index ¶
- Variables
- type ApiKey
- type ApiKeyClient
- type DB
- func (db *DB) CreateApiKey(uid, clientID, scopes string) (*ApiKey, string, error)
- func (db *DB) CreateToken(uid, email string) (*Token, error)
- func (db *DB) DestroyApiKey(user, clientID string) error
- func (db *DB) DestroyApiKeys(uid string) error
- func (db *DB) DestroyToken(token string) error
- func (db *DB) DestroyTokenByUser(uid string) error
- func (db *DB) FetchApiKey(key string) (*ApiKey, error)
- func (db *DB) FetchApiKeys(uid string) ([]*ApiKey, error)
- func (db *DB) FetchToken(token string, maxAge int) (*Token, error)
- func (db *DB) FetchTokenByUser(uid string, maxAge int) (*Token, error)
- func (db *DB) IncrementToken(token string) error
- func (db *DB) RandKey() (string, error)
- func (db *DB) RandToken() (string, error)
- func (db *DB) RefreshApiKey(ak *ApiKey) error
- func (db *DB) SignToken(salt, token string) string
- func (db *DB) VerifyToken(salt, signedToken string) (string, bool)
- type Datastore
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("Record not found in database")
Functions ¶
This section is empty.
Types ¶
type ApiKeyClient ¶ added in v0.5.1
type DB ¶ added in v0.5.1
func (*DB) CreateApiKey ¶ added in v0.5.1
func (*DB) CreateToken ¶ added in v0.5.1
func (*DB) DestroyApiKey ¶ added in v0.5.1
func (*DB) DestroyApiKeys ¶ added in v0.5.1
func (*DB) DestroyToken ¶ added in v0.5.1
func (*DB) DestroyTokenByUser ¶ added in v0.5.1
func (*DB) FetchToken ¶ added in v0.5.1
func (*DB) FetchTokenByUser ¶ added in v0.5.1
func (*DB) IncrementToken ¶ added in v0.5.1
func (*DB) RefreshApiKey ¶ added in v0.5.1
type Datastore ¶ added in v0.5.1
type Datastore interface { // API Key RandKey() (string, error) FetchApiKeys(uid string) ([]*ApiKey, error) FetchApiKey(key string) (*ApiKey, error) CreateApiKey(uid, clientID, scopes string) (*ApiKey, string, error) RefreshApiKey(ak *ApiKey) error DestroyApiKey(user, clientID string) error DestroyApiKeys(uid string) error // Token RandToken() (string, error) SignToken(salt, token string) string VerifyToken(salt, signedToken string) (string, bool) FetchTokenByUser(uid string, maxAge int) (*Token, error) FetchToken(token string, maxAge int) (*Token, error) CreateToken(uid, email string) (*Token, error) IncrementToken(token string) error DestroyToken(token string) error DestroyTokenByUser(uid string) error }
Click to show internal directories.
Click to hide internal directories.