userHeader

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func SetUserCtx

func SetUserCtx(ctx context.Context, uid int64, IP string, role int64) context.Context

Types

type UserCtx

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

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