Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultJWTKey = "secret"
View Source
const DefaultJWTSigningMethod = "HS256"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
func NewAuthenticator ¶
func NewAuthenticator(key, method string) *Authenticator
func (*Authenticator) CreateToken ¶
func (a *Authenticator) CreateToken(user *entities.User) (string, error)
func (*Authenticator) CreateUserFromToken ¶
func (a *Authenticator) CreateUserFromToken(token string) (*entities.User, error)
func (*Authenticator) JWTHandlerFunc ¶
func (a *Authenticator) JWTHandlerFunc(handler http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.