context

package
v0.0.0-...-d5522c5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

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