Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailValidator ¶
func NewDefaultEmailValidator ¶
func NewDefaultEmailValidator() EmailValidator
type LoginHandler ¶
type LoginHandler interface {
Handle(*LoginRequest) (*LoginResponse, error)
}
func NewLoginHandler ¶
func NewLoginHandler(userDB UserDB, emailValidator EmailValidator, passwordEncoder PasswordEncoder, tokenStore TokenStore) LoginHandler
type LoginRequest ¶
type LoginResponse ¶
type LoginResponse struct {
Token string
}
type LogoutHandler ¶
type LogoutHandler interface {
Handle(*LogoutRequest) (*LogoutResponse, error)
}
func NewLogoutHandler ¶
func NewLogoutHandler(tokenStore TokenStore) LogoutHandler
type LogoutRequest ¶
type LogoutRequest struct {
Token string
}
type LogoutResponse ¶
type LogoutResponse struct{}
type PasswordEncoder ¶
func NewUnsafePasswordEncoder ¶
func NewUnsafePasswordEncoder() PasswordEncoder
type RegistrationHandler ¶
type RegistrationHandler interface {
Handle(*RegistrationRequest) (*RegistrationResponse, error)
}
func NewRegistrationHandler ¶
func NewRegistrationHandler(userDB UserDB, emailValidator EmailValidator, passwordEncoder PasswordEncoder) RegistrationHandler
type RegistrationRequest ¶
type RegistrationResponse ¶
type RegistrationResponse struct{}
type TokenStore ¶
type TokenStore interface { Encode(uint64) (string, error) Decode(string) (uint64, error) Revoke(string) error }
func NewInMemoryTokenStore ¶
func NewInMemoryTokenStore(duration time.Duration) TokenStore
Click to show internal directories.
Click to hide internal directories.