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

token

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 8 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 ExtractToken

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

ExtractToken extracts the action/user tuple from the token and verifies the content

Source Files

  • token.go

Jump to

Keyboard shortcuts

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