Documentation
¶
Overview ¶
Package xtransport provides transport related utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CorrelationIDHeaderKey = "X-Correlation-Id"
CorrelationIDHeaderKey is the header to look for correlation id.
Functions ¶
func ContextWithCorrelationID ¶
ContextWithCorrelationID returns a new context enriched with correlation id information.
func CorrelationIDFromContext ¶
CorrelationIDFromContext returns the correlation id stored in the context, or an empty value if no correlation id is present in the context.
Types ¶
type CorrelationIDFactory ¶
type CorrelationIDFactory func() string
CorrelationIDFactory generates correlation ids.
var UUIDCorrelationIDFactory CorrelationIDFactory = uuid.NewString
UUIDCorrelationIDFactory is a CorrelationIDFactory that produces UUID based correlation ids.
var XRandCorrelationIDFactory CorrelationIDFactory = func() string { return xrand.String(32) }
XRandCorrelationIDFactory is a CorrelationIDFactory that produces random alfanumeric strings of length 32.
type Probe ¶
type Probe struct {
// contains filtered or unexported fields
}
Probe can be used as a ready/alive/health flag. It is concurrent safe to use.
type Transport ¶
type Transport interface { // StartAsync starts the transport asynchronous. // Any error received is passed to the error channel passed as second parameter. StartAsync(context.Context, chan<- error) // Shutdown stops the transport. Shutdown(context.Context) error }
Transport is the contract for a transport.
Directories
¶
Path | Synopsis |
---|---|
Package decoder provides decoding utilities.
|
Package decoder provides decoding utilities. |
Package http provides a HTTP transport and some utitities.
|
Package http provides a HTTP transport and some utitities. |
middleware
Package middleware provides HTTP handler useful decorators.
|
Package middleware provides HTTP handler useful decorators. |
testing
|
|
assert
Package assert provides basic assertion utilities.
|
Package assert provides basic assertion utilities. |