token

package
v1.3.13 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHash

func BuildHash(t *Token, appKey string) string

func Validate

func Validate(token *Token, appKey string) (int32, bool)

Types

type Token

type Token struct {
	PID       int32  `json:"pid"`
	OpenID    string `json:"open_id"`
	Timestamp int64  `json:"tt"`
	Hash      string `json:"hash"`
}

func DecodeToken

func DecodeToken(base64Token string) (*Token, bool)

func New

func New(pid int32, openId string, appKey string) *Token

func (*Token) ToBase64

func (t *Token) ToBase64() string

Jump to

Keyboard shortcuts

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