Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
// Authenticates the current user.
Authenticate(*http.Request) (Identity, error)
// Challenge generates challenges upon authentication failure.
Challenge(http.ResponseWriter)
}
Authenticator is an interface that authenticates an user.
type Identity ¶
type Identity interface {
GetID() string
}
Identity is an interface that should be implemented by an user instance.
type IdentityStore ¶
type IdentityStore interface {
// Gets identity by ID.
GetIdentity(id string) (Identity, error)
// Gets identity by the given token and token type.
GetIdentityByToken(token string, tokenType interface{}) (Identity, error)
}
IdentityStore is a store interface for retrieving identity by ID or token.
Click to show internal directories.
Click to hide internal directories.