xtoken

package
v0.0.0-...-0e18063 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

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

func NewJWT

func NewJWT(key []byte, method jwt.SigningMethod) *JWT

func (*JWT) Parse

func (j *JWT) Parse(token string) (map[string]any, error)

func (*JWT) Token

func (j *JWT) Token(data map[string]any) (string, error)

type Token

type Token struct {
	Channel    string
	Username   string
	Nodename   string
	Expiration int64
}

func NewToken

func NewToken(channel, username, nodename string, expiration int64) *Token

func UnmarshalToken

func UnmarshalToken(data map[string]any) *Token

func (*Token) Marshal

func (t *Token) Marshal() map[string]any

func (*Token) NotExpired

func (t *Token) NotExpired(n int64) bool

Jump to

Keyboard shortcuts

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