userHeader

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserToken    string = "iThings-token"
	UserSetToken string = "iThings-set-token"
	UserUid      string = "iThings-uid"
)

Variables

This section is empty.

Functions

func SetUserCtx

func SetUserCtx(ctx context.Context, userCtx *UserCtx) context.Context

Types

type UserCtx

type UserCtx struct {
	Uid  int64  //用户id
	IP   string //用户的ip地址
	Role int64  //用户角色
	Os   string //操作系统
}

func GetUserCtx

func GetUserCtx(ctx context.Context) *UserCtx

使用该函数前必须传了UserCtx

Jump to

Keyboard shortcuts

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