Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
func FromContext(ctx stdcontext.Context) *context
FromContext returns a new context from a parent
func GetCorrelationID ¶
func GetCorrelationID(ctx stdcontext.Context) string
GetCorrelationID returns the correlation if there is one
func New ¶
func New(opts ...Option) *context
New constructs a new *context from a parent Context and Options
func WithTimeout ¶
func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc)
WithTimeout wraps stdcontext.WithTimeout
Types ¶
type CancelFunc ¶
type CancelFunc func()
A CancelFunc tells an operation to abandon its work
func WithCancel ¶
func WithCancel(parent stdcontext.Context) (*context, CancelFunc)
WithCancel returns a copy of parent with a new Done channel
type Option ¶
type Option func(*context)
Option allows configuring the context
func WithArgument ¶
WithArgument sets a Context argument
func WithArguments ¶
WithArguments sets the Context arguments
func WithCorrelationID ¶
WithCorrelationID sets the CorrelationID
func WithParent ¶
WithParent sets the context's parent context
Click to show internal directories.
Click to hide internal directories.