token

package
v1.21.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 8 Imported by: 2

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

Jump to

Keyboard shortcuts

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