jwt

package
v0.0.0-...-f6cc6f7 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TokenPattern = "(^[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*\\.[A-Za-z0-9-_]*$)"

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(claims *Claims, secret string) (string, error)

Types

type Claims

type Claims struct {
	OwnerId   int64 `json:"owner_id"`
	ExpiresAt int64 `json:"expires_at"`
}

func ExtractClaims

func ExtractClaims(tokenString, secret string) (*Claims, error)

func (*Claims) Valid

func (c *Claims) Valid() error

Jump to

Keyboard shortcuts

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