metactx

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IContext

type IContext interface {
	Ctx() *gin.Context

	UserID() core.TUserID
	UserName() string
	ClientIP() string
	Language() string

	Head(headKey string) string

	Set(obj interface{}, flag ...interface{})
	Get(nilStruct interface{}, flag ...interface{}) interface{}
}

> MetaCtx 接口

func WithCtx

func WithCtx(c *gin.Context) IContext

构造函数1: 请求链场景

func WithUser

func WithUser(uid core.TUserID) IContext

构造函数2: 非请求链场景

Jump to

Keyboard shortcuts

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