passport

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims added in v0.3.2

type Claims struct {
	ActiveId string
	Data     map[string]interface{}

	jwt.RegisteredClaims
}

func NewClaims added in v0.12.0

func NewClaims(activeId string, expire time.Duration) *Claims

func (*Claims) SetData added in v0.12.1

func (x *Claims) SetData(v map[string]interface{}) *Claims

func (*Claims) SetIssuer added in v0.12.0

func (x *Claims) SetIssuer(v string) *Claims

func (*Claims) SetJTI added in v0.12.0

func (x *Claims) SetJTI(v string) *Claims

type Option

type Option func(x *Passport)

func SetIssuer added in v0.6.1

func SetIssuer(v string) Option

func SetKey added in v0.3.2

func SetKey(v string) Option

type Passport

type Passport struct {
	Issuer string
	Key    string
}

func New

func New(options ...Option) *Passport

func (*Passport) Create

func (x *Passport) Create(claims *Claims) (tokenString string, err error)

func (*Passport) Verify

func (x *Passport) Verify(tokenString string) (claims Claims, err error)

Jump to

Keyboard shortcuts

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