context

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ReqCtxKeyName = "reqCtx"
)

Variables

This section is empty.

Functions

func WithReqCtx

func WithReqCtx(ctx context.Context, reqCtx ReqCtx) context.Context

Types

type ReqCtx

type ReqCtx interface {
	context.Context
	GetEngine() common.Engine
	GetLog() logs.Logger
	GetTimer() *timer.XTimer
	GetClientIp() string
}

请求级别上下文

func NewReqCtx

func NewReqCtx(engine common.Engine, reqId, clientIp string) (ReqCtx, error)

func ValueReqCtx

func ValueReqCtx(ctx context.Context) ReqCtx

type ReqCtxImpl

type ReqCtxImpl struct {
	// contains filtered or unexported fields
}

func (*ReqCtxImpl) Deadline

func (t *ReqCtxImpl) Deadline() (deadline time.Time, ok bool)

func (*ReqCtxImpl) Done

func (t *ReqCtxImpl) Done() <-chan struct{}

func (*ReqCtxImpl) Err

func (t *ReqCtxImpl) Err() error

func (*ReqCtxImpl) GetClientIp

func (t *ReqCtxImpl) GetClientIp() string

func (*ReqCtxImpl) GetEngine

func (t *ReqCtxImpl) GetEngine() common.Engine

func (*ReqCtxImpl) GetLog

func (t *ReqCtxImpl) GetLog() logs.Logger

func (*ReqCtxImpl) GetTimer

func (t *ReqCtxImpl) GetTimer() *timer.XTimer

func (*ReqCtxImpl) Value

func (t *ReqCtxImpl) Value(key interface{}) interface{}

Jump to

Keyboard shortcuts

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