onexx

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromAccessToken

func FromAccessToken(ctx context.Context) string

FromAccessToken extract accessToken from context.

func FromContext

func FromContext(ctx context.Context) (token *jwt.RegisteredClaims, ok bool)

FromContext extract auth info from context.

func FromUserID

func FromUserID(ctx context.Context) string

FromUserID extract userID from context.

func FromUserM added in v0.2.0

func FromUserM(ctx context.Context) *model.UserM

FromUserM extract *UserM from extract.

func NewAccessToken

func NewAccessToken(ctx context.Context, accessToken string) context.Context

NewAccessToken put accessToken into context.

func NewContext

func NewContext(ctx context.Context, info *jwt.RegisteredClaims) context.Context

NewContext put auth info into context.

func NewUserID

func NewUserID(ctx context.Context, userID string) context.Context

NewUserID put userID into context.

func NewUserM added in v0.2.0

func NewUserM(ctx context.Context, user *model.UserM) context.Context

NewUserM put *UserM into context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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