Documentation
¶
Index ¶
- Constants
- Variables
- func ContextConfig(c context.Context) any
- func ContextLogger(c context.Context) logging.Logger
- func ContextWaitGroup(c context.Context) *sync.WaitGroup
- func ContextWithValues(parent context.Context, offset int, values ...any) context.Context
- func Run(r Runnable, config any, logger logging.Logger, ctx context.Context) error
- type Runnable
Constants ¶
View Source
const ( ContextValueKeyWaitGroup = ContextValuesOffset + iota ContextValueKeyLogger ContextValueKeyConfig )
View Source
const ContextValuesOffset = 0xFF0
Variables ¶
View Source
var ErrAlreadyRunning = ErrStillRunning
View Source
var ErrRunFuncNil = errors.New("run func is nil")
View Source
var ErrStillRunning = errors.New("runnable running")
Functions ¶
func ContextConfig ¶
func ContextWithValues ¶
ContextWithValues creates a context with given values stored as an array of sequentially indexed values. Values may be accessed with the seq index. An offset can be used to prevent accidental overrides.
Types ¶
Click to show internal directories.
Click to hide internal directories.