Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGeneratorSource ¶ added in v0.23.0
func DefaultGeneratorSource() *generatorSource
DefaultGeneratorSource returns a new correlation ID source which generates a new correlation ID. The underlying generator is a default random string generator.
func DefaultHeaderSource ¶ added in v0.23.0
func DefaultHeaderSource() *headerSource
DefaultHeaderSource returns a correlation ID source which retrieves the correlation ID from common HTTP headers.
func NewGeneratorSource ¶ added in v0.23.0
func NewGeneratorSource(generator correlationIdGenerator) *generatorSource
NewGeneratorSource returns a new correlation ID source which generates a new correlation ID.
func NewHeaderSource ¶ added in v0.23.0
func NewHeaderSource(headers ...string) *headerSource
NewHeaderSource returns a correlation ID source which retrieves the correlation ID from given HTTP headers.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used to define middleware configuration.
func Source ¶ added in v0.23.0
func Source(s ...correlationIdSource) Option
Source sets a set of correlation ID sources in the middleware.
func Store ¶ added in v0.23.0
func Store(s ...correlationIdStore) Option
Store sets a set of correlation ID stores in the middleware.
func WithSource ¶ added in v0.23.0
func WithSource(s ...correlationIdSource) Option
WithSource appends a set of correlation ID sources in the middleware.