context

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValueNotFound = errors.New("value not found")

ErrValueNotFound error defined

Functions

func FromUserID

func FromUserID(ctx context.Context) (uint, error)

FromUserID 从上下文中获取用户ID

func FromUserName

func FromUserName(ctx context.Context) (string, error)

FromUserName 从上下文中获取用户名

func NewUserID

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

NewUserID 创建用户当前登录ID的上下文

func NewUserName

func NewUserName(ctx context.Context, userName string) context.Context

NewUserName 创建用户当前登录用户名的上下文

Types

This section is empty.

Jump to

Keyboard shortcuts

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