Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateFunc ¶
type GenerateFunc = func(tokenKind int, tokenData []byte, ttl time.Duration) (token string, err error)
GenerateFunc generates a new token containing encrypted and signed data.
func CreateGenerateFunc ¶
func CreateGenerateFunc(now func() time.Time, encrypt aes.EncryptFunc, sign hmacsha256.SignFunc) GenerateFunc
CreateGenerateFunc creates a new `tokens.GenerateFunc` function.
type ValidateFunc ¶
ValidateFunc checks a token's validity and extracts the encrypted data if successful.
func CreateValidateFunc ¶
func CreateValidateFunc( now func() time.Time, decrypt aes.DecryptFunc, isValidSignature hmacsha256.ValidateFunc) ValidateFunc
CreateValidateFunc creates a new `tokens.ValidateFunc` function.
Click to show internal directories.
Click to hide internal directories.