xcontext

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

定义公共上下文结构,明确定义上下文结构,方便代码阅读

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCtx

type BaseCtx struct {
	XLog  logs.Logger
	Timer *timer.XTimer
}

考虑到后续对操作生命周期做控制,先实现空context.Context接口,方便扩展 同时定义扩展全局需要的公共成员,方便为各对象统一注入和管理

func (*BaseCtx) Deadline

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

func (*BaseCtx) Done

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

func (*BaseCtx) Err

func (t *BaseCtx) Err() error

func (*BaseCtx) GetLog

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

func (*BaseCtx) GetTimer

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

func (*BaseCtx) Value

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

type XContext

type XContext interface {
	context.Context
	GetLog() logs.Logger
	GetTimer() *timer.XTimer
}

Jump to

Keyboard shortcuts

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