token

package
v0.0.0-...-e7f8777 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// just for testing
	DefaultSecret = "jwt-1sNzdiSgnNuxyq2g7xml2JvLArU"
)

Variables

This section is empty.

Functions

func Generate

func Generate(secret string, token *Token) (string, error)

Types

type Token

type Token struct {
	Account string `json:"acc,omitempty"`
	App     string `json:"app,omitempty"`
	Exp     int64  `json:"exp,omitempty"`
}

func Parse

func Parse(secret, tk string) (*Token, error)

func (*Token) Valid

func (t *Token) Valid() error

Jump to

Keyboard shortcuts

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