token

package
v0.0.0-...-1b5cee2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 5 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 {
	ID             any    `json:"-"               bson:"_id,omitempty"   db:"id"`
	Token          string `json:"token"           bson:"token"           db:"token"`
	Valid          bool   `json:"valid"           bson:"valid"           db:"valid"`
	ExpirationDate int64  `json:"expiration_date" bson:"expiration_date" db:"expiration_date"`
}

Token holds information about unique token. Token is a way of proving to the REST API of the central server that the request is valid and comes from the client that is allowed to use the API.

func New

func New(expiration int64) (Token, error)

New creates new token.

Jump to

Keyboard shortcuts

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