etoken

package module
v0.0.0-...-5247eb1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PackageName = "component.token"

PackageName ..

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig() *config

DefaultConfig ...

Types

type AccessTokenTicket

type AccessTokenTicket struct {
	AccessToken string `json:"accessToken"`
	ExpiresIn   int64  `json:"expiresIn"`
}

type Component

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

func (*Component) CheckAccessToken

func (c *Component) CheckAccessToken(tokenStr string) bool

func (*Component) CreateAccessToken

func (c *Component) CreateAccessToken(uid int, startTime int64) (resp AccessTokenTicket, err error)

func (*Component) DecodeAccessToken

func (c *Component) DecodeAccessToken(tokenStr string) (resp map[string]interface{}, err error)

func (*Component) EncodeAccessToken

func (c *Component) EncodeAccessToken(jwtId int, uid int, startTime int64) (tokenStr string, err error)

func (*Component) RefreshAccessToken

func (c *Component) RefreshAccessToken(tokenStr string, startTime int64) (resp AccessTokenTicket, err error)

type Container

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

func DefaultContainer

func DefaultContainer() *Container

func Load

func Load(key string) *Container

Load ...

func (*Container) Build

func (con *Container) Build(options ...Option) *Component

Build

type Option

type Option func(c *Container)

func WithRedis

func WithRedis(client *eredis.Component) Option

Jump to

Keyboard shortcuts

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