Documentation ¶
Index ¶
- func GetCorrelationID(ctx stdcontext.Context) string
- type CancelFunc
- type Context
- type Option
- func WithArgument(key string, value interface{}) Option
- func WithArguments(args map[string]interface{}) Option
- func WithCancel() Option
- func WithCorrelationID(cID string) Option
- func WithMethod(method string) Option
- func WithParent(parent stdcontext.Context) Option
- func WithTimeout(timeout time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCorrelationID ¶
func GetCorrelationID(ctx stdcontext.Context) string
GetCorrelationID returns the correlation if there is one
Types ¶
type Context ¶
type Context interface { Cancel() Deadline() (deadline time.Time, ok bool) Done() <-chan struct{} Err() error Value(key interface{}) interface{} Arguments() map[string]interface{} Method() string CorrelationID() string }
Context that matches std context
func FromContext ¶
func FromContext(ctx stdcontext.Context) Context
FromContext returns a new context from a parent
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 ¶
func WithParent(parent stdcontext.Context) Option
WithParent sets the context's parent context
func WithTimeout ¶
WithTimeout sets a Context timeout
Click to show internal directories.
Click to hide internal directories.