Documentation ¶
Index ¶
- Variables
- type JWTToken
- type PasetoToken
- type Payload
- func (p Payload) GetAudience() (jwt.ClaimStrings, error)
- func (p Payload) GetExpirationTime() (*jwt.NumericDate, error)
- func (p Payload) GetIssuedAt() (*jwt.NumericDate, error)
- func (p Payload) GetIssuer() (string, error)
- func (p Payload) GetNotBefore() (*jwt.NumericDate, error)
- func (p Payload) GetSubject() (string, error)
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrExpiredToken = errors.New("expired token") )
Functions ¶
This section is empty.
Types ¶
type JWTToken ¶
type JWTToken struct {
// contains filtered or unexported fields
}
func (JWTToken) CreateToken ¶
type PasetoToken ¶
type PasetoToken struct {
// contains filtered or unexported fields
}
func (PasetoToken) CreateToken ¶
func (PasetoToken) ValidateToken ¶
func (t PasetoToken) ValidateToken(token string) (*Payload, error)
type Payload ¶
type Payload struct { ID uuid.UUID `json:"id"` Data string `json:"data"` ExpiredAt *jwt.NumericDate `json:"expired_at"` }
func (Payload) GetAudience ¶
func (Payload) GetExpirationTime ¶
func (Payload) GetIssuedAt ¶
func (Payload) GetNotBefore ¶
func (Payload) GetSubject ¶
Click to show internal directories.
Click to hide internal directories.