Help us shape the future of Go! Take the 2026 Go Developer Survey

token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(ht HandlerType, user *user_model.User, data []byte) (string, error)

CreateToken creates a token for the action/user tuple

Types

type ErrToken

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

func (*ErrToken) Error

func (err *ErrToken) Error() string

func (*ErrToken) Unwrap

func (err *ErrToken) Unwrap() error

type HandlerType

type HandlerType byte
const (
	UnknownHandlerType HandlerType = iota
	ReplyHandlerType
	UnsubscribeHandlerType
)

func DecodeToken

func DecodeToken(ctx context.Context, token string) (HandlerType, *user_model.User, []byte, error)

DecodeToken decodes the handler, user and payload from the token and verifies the content

Jump to

Keyboard shortcuts

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