Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenDataAccess ¶
type TokenDataAccess interface { LookupToken(hash string) (*Token, error) StoreToken(*Token) error RevokeToken(hash string) error ListTokens() ([]*Token, error) }
func NewJsonStore ¶
func NewJsonStore(fname string) (TokenDataAccess, error)
NewJsonStore makes a simple token store that keeps tokens in-memory, backed up to a local json file. Not suitable for high volume or high reliability. if you specify an empty string for file name, nothing will be backed up to disk, and you will have a solely in-memory store
type TokenProvider ¶
type TokenProvider struct {
// contains filtered or unexported fields
}
func NewToken ¶
func NewToken(secret string, data TokenDataAccess) *TokenProvider
func (*TokenProvider) AdminHandler ¶
func (t *TokenProvider) AdminHandler() http.Handler
func (*TokenProvider) LoginHandler ¶
func (t *TokenProvider) LoginHandler() http.Handler
Click to show internal directories.
Click to hide internal directories.