jwt

package
v0.0.0-...-cff06d4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(secretKey []byte, payload Payload) (tokenString string, err error)

Encode encodes a jwt token using data gotten from payload.

Types

type Payload

type Payload struct {
	UserID string
}

func Decode

func Decode(secretKey []byte, tokenString string) (payload *Payload, err error)

Decode decodes a jwt token string.

If the jwt token is invalid it returns an error.

Jump to

Keyboard shortcuts

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