token

package
v0.0.0-...-3eb4ebe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeAuthentication = "authentication"
)

Variables

This section is empty.

Functions

func ValidateTokenPlaintext

func ValidateTokenPlaintext(v *validator.Validator, plaintext string)

Types

type Token

type Token struct {
	PlainText string    `json:"plaintext"`
	Hash      []byte    `json:"-"`
	UserID    uint64    `json:"user_id"`
	Expiry    time.Time `json:"expiry"`
	Scope     string    `json:"-"`
}

func GenerateToken

func GenerateToken(userID uint64, ttl time.Duration, scope string) (*Token, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL