Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForSignals ¶ added in v0.3.0
ForSignals returns a context.Context that will be cancelled if the given signals (or SIGTERM and SIGINT by default, if none are passed) are received by the process.
Types ¶
type MessageContext ¶
MessageContext is a context.Context wrapper that is intended to include some extra metadata about which context was cancelled. Useful for distinguishing e.g. http request cancellation vs deadline vs process sigterm handling.
func (MessageContext) Err ¶
func (c MessageContext) Err() error
Err returns an error with extra context messaging
type MessageError ¶
MessageError implements error but separates the message from the original error in case you want it.
func (*MessageError) Error ¶
func (c *MessageError) Error() string
Error implements error and prints out the message plus the metadata about which context was cancelled.
func (*MessageError) Unwrap ¶
func (c *MessageError) Unwrap() error
Unwrap supports errors.Is/errors.As