statelesstoken

package
v0.0.0-...-0941746 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecretSize = crypto.KeySize256
	HashSize   = crypto.KeySize256
)

Variables

View Source
var (
	ErrTokenIsNotValid = errors.New("token is not valid")
	ErrDataIsTooLong   = errors.New("data is too long")
)

Functions

This section is empty.

Types

type Stateless

type Stateless struct {
	// contains filtered or unexported fields
}

func New

func New(key []byte, id uuid.UUID, expire time.Time, data string) (token Stateless, err error)

func ParseStateless

func ParseStateless(tokenStr string) (token Stateless, err error)

func (*Stateless) Data

func (token *Stateless) Data() string

func (*Stateless) ID

func (token *Stateless) ID() uuid.UUID

func (*Stateless) String

func (token *Stateless) String() string

func (*Stateless) Verify

func (token *Stateless) Verify(key []byte) (err error)

func (*Stateless) Version

func (token *Stateless) Version() uint8

Jump to

Keyboard shortcuts

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