package
Version:
v0.0.0-...-2910145
Opens a new window with list of versions in this module.
Published: Feb 14, 2024
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
包 gctx 对 context.Context 进行了封装,并提供了额外的上下文功能。
NeverDone 包装并返回一个新的上下文对象,该对象将永不完成,
这样可以禁止手动完成上下文,以使上下文能够传播到异步goroutine中。
WithCtx 在给定的父级上下文 `ctx` 的基础上创建并返回一个包含上下文 ID 的新上下文。
CtxId 从 context 中检索并返回上下文 id。
GetInitCtx 返回初始化上下文。
初始化上下文用于在 `main` 或 `init` 函数中使用。
SetInitCtx 设置自定义初始化上下文。
注意:该函数不能在多个goroutine中被调用。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.