Documentation ¶
Index ¶
- Constants
- func DefaultGeneratorSource() *generatorSource
- func DefaultMetadataSource() *metadataSource
- func NewGeneratorSource(generator correlationIdGenerator) *generatorSource
- func NewMetadataSource(headers ...string) *metadataSource
- func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
- func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
- type Option
- type Options
Constants ¶
const TagCorrelationID = "correlationid"
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 DefaultMetadataSource ¶ added in v0.23.0
func DefaultMetadataSource() *metadataSource
DefaultMetadataSource returns a correlation ID source which retrieves the correlation ID from gRPC metadata 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 NewMetadataSource ¶ added in v0.23.0
func NewMetadataSource(headers ...string) *metadataSource
NewMetadataSource returns a correlation ID source which retrieves the correlation ID from gRPC metadata headers.
func StreamServerInterceptor ¶
func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor
StreamServerInterceptor returns a new streaming server interceptor for propagating correlation ID.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor
UnaryServerInterceptor returns a new unary server interceptor for propagating correlation ID.
Types ¶
type Option ¶ added in v0.23.0
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.