onetime

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Key       string    `db:"key"`
	UserID    string    `db:"user_id"`
	CreatedAt time.Time `db:"created_at"`
	// Number of times the token has been used.
	Clicks int `db:"clicks"`
}

Token is a short-lived, one-time use token.

func New

func New(userID string) *Token

func (*Token) IsExpired

func (t *Token) IsExpired() bool

func (*Token) IsReused

func (t *Token) IsReused() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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