Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenEmitter ¶
type TokenEmitter interface { Generate(id string) string Valid(token string, d time.Duration) (valid bool, id string, issue time.Time) }
TokenEmitter interface to be able to generate and validate tokens
func NewTokenHmacSha ¶
func NewTokenHmacSha(secret string) TokenEmitter
type TokenHmacSha ¶
type TokenHmacSha struct {
// contains filtered or unexported fields
}
TokenHmacSha generate a tokes in the format <hash>.<rnd>.<id>.<ts> with hash = HMAC_SHA1 (secret, rnd + id + ts)
func (*TokenHmacSha) Generate ¶
func (tk *TokenHmacSha) Generate(id string) string
Click to show internal directories.
Click to hide internal directories.