Documentation
¶
Index ¶
- func UnsafeContext(ctx Context) _UnsafeContextdeprecated
- type ConcurrentContextProvider
- type Context
- type ContextBehavior
- func (ctx *ContextBehavior) AutoRecover() bool
- func (ctx *ContextBehavior) ParentContext() context.Context
- func (ctx *ContextBehavior) ReportError() chan error
- func (ctx *ContextBehavior) Terminate() async.AsyncRet
- func (ctx *ContextBehavior) Terminated() async.AsyncRet
- func (ctx *ContextBehavior) WaitGroup() WaitGroup
- type CurrentContextProvider
- type WaitGroup
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 {
// ConcurrentContext 获取多线程安全的上下文
ConcurrentContext() iface.Cache
}
ConcurrentContextProvider 多线程安全的上下文提供者
type Context ¶
type Context interface {
context.Context
// ParentContext 获取父上下文
ParentContext() context.Context
// AutoRecover panic时是否自动恢复
AutoRecover() bool
// ReportError 在开启panic时自动恢复时,将会恢复并将错误写入此error channel
ReportError() chan error
// WaitGroup 获取等待组
WaitGroup() WaitGroup
// Terminate 停止
Terminate() async.AsyncRet
// Terminated 已停止
Terminated() async.AsyncRet
// contains filtered or unexported methods
}
Context 上下文
type ContextBehavior ¶
ContextBehavior 上下文行为
func (*ContextBehavior) AutoRecover ¶
func (ctx *ContextBehavior) AutoRecover() bool
AutoRecover panic时是否自动恢复
func (*ContextBehavior) ParentContext ¶
func (ctx *ContextBehavior) ParentContext() context.Context
ParentContext 获取父上下文
func (*ContextBehavior) ReportError ¶
func (ctx *ContextBehavior) ReportError() chan error
ReportError 在开启panic时自动恢复时,将会恢复并将错误写入此error channel
func (*ContextBehavior) Terminate ¶
func (ctx *ContextBehavior) Terminate() async.AsyncRet
Terminate 停止
func (*ContextBehavior) Terminated ¶
func (ctx *ContextBehavior) Terminated() async.AsyncRet
Terminated 已停止
func (*ContextBehavior) WaitGroup ¶
func (ctx *ContextBehavior) WaitGroup() WaitGroup
WaitGroup 获取等待组
type CurrentContextProvider ¶
type CurrentContextProvider interface {
ConcurrentContextProvider
// CurrentContext 获取当前上下文
CurrentContext() iface.Cache
}
CurrentContextProvider 当前上下文提供者
Click to show internal directories.
Click to hide internal directories.