token

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func WithExpire

func WithExpire(expire int) Option

func WithSecret

func WithSecret(secret string) Option

type Options

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

type Token

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

func Default

func Default() *Token

func New

func New(opts ...Option) *Token

func (*Token) Cancellation

func (token *Token) Cancellation(license string) error

func (*Token) CancellationAll

func (token *Token) CancellationAll(uType guard.UserType, uid int64) error

func (*Token) ExpiresAt

func (token *Token) ExpiresAt(license string) int64

func (*Token) GetLicense

func (token *Token) GetLicense(userType guard.UserType, uid int64) ([]string, error)

func (*Token) IssuerAt

func (token *Token) IssuerAt(license string) int64

func (*Token) License

func (token *Token) License(user *guard.User) (string, error)

func (*Token) Provide

func (token *Token) Provide(ctx context.Context) interface{}

func (*Token) Verify

func (token *Token) Verify(license string) (*guard.User, error)

Jump to

Keyboard shortcuts

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