Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
Token is a manager for the token entity.
func NewToken ¶
func NewToken(logger logrus.FieldLogger, conn database.DB) *Token
NewToken creates a new manager for the token entity.
func NewTokenFromRequest ¶
NewTokenFromRequest returns the token manager from the request context.
func (*Token) Consume ¶
Consume consumes an active (not expired) token that is linked to an uuid and a category.
func (*Token) Create ¶
Create generates a token for a given uuid and category, with an optional expiration.
func (*Token) RemoveExpired ¶
RemoveExpired removes expired tokens from the database.
Click to show internal directories.
Click to hide internal directories.