Versions in this module Expand all Collapse all v1 v1.0.0 Aug 25, 2026 Changes in this version + const DefaultCausationField + const DefaultCorrelationField + const DefaultRequestField + var ErrCarrierOverwrite = errors.New("correlation: carrier overwrite") + var ErrConflictingCarrier = errors.New("correlation: conflicting carrier values") + var ErrGeneration = errors.New("correlation: generation failed") + var ErrInvalidCarrier = errors.New("correlation: invalid carrier") + var ErrInvalidDerivation = errors.New("correlation: invalid deterministic derivation") + var ErrInvalidDisclosure = errors.New("correlation: invalid disclosure policy") + var ErrInvalidExternalID = errors.New("correlation: invalid external identifier") + var ErrInvalidFactory = errors.New("correlation: invalid factory") + var ErrInvalidID = errors.New("correlation: invalid identifier") + var ErrInvalidPropagator = errors.New("correlation: invalid propagator") + func Disclose(label, value string, policy DisclosurePolicy) (string, error) + func WithValues(ctx context.Context, values Values) context.Context + type Carrier interface + Set func(key, value string) + Values func(key string) []string + type CausationID string + func MustCausationID(value string, policy Policy) CausationID + func ParseCausationID(value string, policy Policy) (CausationID, error) + func (id CausationID) String() string + type Codec struct + func NewCodec(options CodecOptions) (*Codec, error) + func (codec *Codec) Extract(carrier Carrier) (Values, error) + func (codec *Codec) Inject(carrier Carrier, values Values) error + type CodecOptions struct + CausationField string + CorrelationField string + Policy Policy + RequestField string + type CorrelationID string + func MustCorrelationID(value string, policy Policy) CorrelationID + func ParseCorrelationID(value string, policy Policy) (CorrelationID, error) + func (id CorrelationID) String() string + type Deterministic struct + func NewDeterministic(options DeterministicOptions) (*Deterministic, error) + func (strategy *Deterministic) Derive(input []byte) (CorrelationID, error) + type DeterministicOptions struct + Domain string + Key []byte + Length int + Version uint32 + type DisclosureMode uint8 + const ExposeDisclosure + const HashDisclosure + const RedactDisclosure + type DisclosurePolicy struct + Key []byte + Mode DisclosureMode + type ExternalID struct + func NewExternalID(options ExternalIDOptions) (ExternalID, error) + func (external ExternalID) Kind() string + func (external ExternalID) Source() string + func (external ExternalID) Trusted() bool + func (external ExternalID) Value() string + type ExternalIDOptions struct + Kind string + Policy Policy + Source string + Trusted bool + Value string + type Factory struct + func NewFactory(options FactoryOptions) (*Factory, error) + func (factory *Factory) Accept(inbound Values, policy InboundPolicy) (Values, error) + func (factory *Factory) Next(parent Values) (Values, error) + func (factory *Factory) Start() (Values, error) + type FactoryOptions struct + Generator Generator + Policy Policy + type Generator interface + New func() (string, error) + type GeneratorFunc func() (string, error) + func (function GeneratorFunc) New() (string, error) + type InboundPolicy struct + TrustCorrelation bool + TrustRequestAsCausation bool + type Policy struct + MaxLength int + type Propagator struct + func NewPropagator(factory *Factory, codec *Codec) (*Propagator, error) + func (propagator *Propagator) Receive(carrier Carrier, policy InboundPolicy) (Values, error) + func (propagator *Propagator) Send(carrier Carrier, parent Values) (Values, error) + type RequestID string + func MustRequestID(value string, policy Policy) RequestID + func ParseRequestID(value string, policy Policy) (RequestID, error) + func (id RequestID) String() string + type Values struct + CausationID CausationID + CorrelationID CorrelationID + RequestID RequestID + func FromContext(ctx context.Context) (Values, bool)