Documentation ¶
Index ¶
- func UnsafeContext(ctx Context) _UnsafeContextdeprecated
- type ConcurrentContextProvider
- type Context
- type ContextBehavior
- func (ctx *ContextBehavior) GetAutoRecover() bool
- func (ctx *ContextBehavior) GetParentContext() context.Context
- func (ctx *ContextBehavior) GetReportError() chan error
- func (ctx *ContextBehavior) GetWaitGroup() *sync.WaitGroup
- func (ctx *ContextBehavior) Terminate() <-chan struct{}
- func (ctx *ContextBehavior) Terminated() <-chan struct{}
- type CurrentContextProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnsafeContext
deprecated
func UnsafeContext(ctx Context) _UnsafeContext
Deprecated: UnsafeContext 访问上下文内部方法
Types ¶
type ConcurrentContextProvider ¶
type ConcurrentContextProvider interface { // GetConcurrentContext 获取多线程安全的上下文 GetConcurrentContext() iface.Cache }
ConcurrentContextProvider 多线程安全的上下文提供者
type Context ¶
type Context interface { context.Context // GetParentContext 获取父上下文 GetParentContext() context.Context // GetAutoRecover panic时是否自动恢复 GetAutoRecover() bool // GetReportError 在开启panic时自动恢复时,将会恢复并将错误写入此error channel GetReportError() chan error // GetWaitGroup 获取等待组 GetWaitGroup() *sync.WaitGroup // Terminate 停止 Terminate() <-chan struct{} // Terminated 已停止 Terminated() <-chan struct{} // contains filtered or unexported methods }
Context 上下文
type ContextBehavior ¶
ContextBehavior 上下文行为
func (*ContextBehavior) GetAutoRecover ¶
func (ctx *ContextBehavior) GetAutoRecover() bool
GetAutoRecover panic时是否自动恢复
func (*ContextBehavior) GetParentContext ¶
func (ctx *ContextBehavior) GetParentContext() context.Context
GetParentContext 获取父上下文
func (*ContextBehavior) GetReportError ¶
func (ctx *ContextBehavior) GetReportError() chan error
GetReportError 在开启panic时自动恢复时,将会恢复并将错误写入此error channel
func (*ContextBehavior) GetWaitGroup ¶
func (ctx *ContextBehavior) GetWaitGroup() *sync.WaitGroup
GetWaitGroup 获取等待组
func (*ContextBehavior) Terminate ¶
func (ctx *ContextBehavior) Terminate() <-chan struct{}
Terminate 停止
func (*ContextBehavior) Terminated ¶ added in v0.3.33
func (ctx *ContextBehavior) Terminated() <-chan struct{}
Terminated 已停止
type CurrentContextProvider ¶
type CurrentContextProvider interface { ConcurrentContextProvider // GetCurrentContext 获取当前上下文 GetCurrentContext() iface.Cache }
CurrentContextProvider 当前上下文提供者
Click to show internal directories.
Click to hide internal directories.