# Packages
No description provided by the author
# Functions
GetCorrelation will return the correlation ID from the context if it cannot find it it will try to get the root correlation ID If it cannot find it, it will return nil.
GetError will return the error and error code which were set into the context.
GetOrCreateCorrelation will get the correlation ID from the context If it cannot find, it will try to use the root correlation ID If it does not exist, it will create a new correlation ID.
GetOrCreateCorrelationFromContext will get correlation ID from the context if it does not exist it will create new correlation ID If appendToContext, it will update the input context with the correlation ID.
GetOrCreateTimeout will get duration and deadline from the context if it does not exist it will create new duration and deadline If appendToContext, it will update the input context with the duration and deadline.
GetOrCreateTimeoutFromContext will get duration and deadline from the context if it does not exist it will create new duration and deadline If appendToContext, it will update the input context with the duration and deadline.
GetRootCorrelation will return the correlation ID from the context If it cannot find it, it will return nil.
GetTimeout will return the duration and the deadline from the given context If it cannot find it, it will respectively return nil.
NewCorrelation ...
NewCorrelationID creates a new instance of the correlationID interface.
NewTimeoutCalculator creates a new instance of timeout calculator.
Root is the context which is created for a service / application when it initialized The context created has no expiration or deadline When we need to call external service, we need to create a new context with deadlines, durtion and correlation ID.
SetCorrealtion will set into the given context a corraltion ID value.
SetError will set in to the given context an error For example, in rabbit, before returning the response, we will check for an error and based on it will decide if to ack.
SetRootCorrealtion will set into the given context a corraltion ID value.
SetTimeout will set in to the given context the duration and the deadline.
# Constants
CorrelationIDKey ...
CorrelationIDRootKey ..
DeadlineKey ...
DurationKey ..
ErrorCodeKey ..
ErrorKey ..
MaxTimeout is 15 seconds.
# Type aliases
CorrelationIDHeaderKey ..
CorrelationIDRootHeaderKey ..
DeadlineHeaderKey ..
DurationHeaderKey ..
ErrCodeKey ..
ErrKey ..