tokener

package module
v0.0.0-...-f4bf8f6 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tokener

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

func NewTokener

func NewTokener(secretKeyString string) (*Tokener, error)

NewTokener creates a new Tokener

func (*Tokener) GenerateToken

func (t *Tokener) GenerateToken(username string, duration time.Duration) (string, error)

GenerateToken creates a new token for a specific username and duration

func (*Tokener) GetPublicKey

func (t *Tokener) GetPublicKey() string

type Verifier

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

func NewVerifier

func NewVerifier(publicKeyString string) (*Verifier, error)

NewVerifier creates a new Verifier

func (*Verifier) VerifyToken

func (v *Verifier) VerifyToken(token string) (string, error)

VerifyToken checks if the token is valid or not

Jump to

Keyboard shortcuts

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