Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = fmt.Errorf("token is invalid") ErrTokenExpired = fmt.Errorf("token is expired") )
Known errors.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allows to issue and verify jwt tokens.
func NewService ¶
NewService creates a new jwt service.
type Token ¶
type Token struct { Token string `json:"token"` UserID string `json:"user_id"` ExpiresAt time.Time `json:"expires_at"` }
Token contains information about an authorized user.
func FromContext ¶
FromContext returns a token from the given context.
func MustFromContext ¶
Click to show internal directories.
Click to hide internal directories.