package
0.2.1
Repository: https://github.com/donewscode/core-kit.git
Documentation: pkg.go.dev

# Packages

Package stateful contains stateful middleware, typically in the context of distributed transaction.

# Functions

Async returns a go kit middleware that calls the next handler in a detached goroutine.
Error returns a middleware that wraps the returned error from next handler with a *unierr.Error.
Interceptor is a grpc UnaryInterceptor that injects the method name into context so it can be consumed by Go kit gRPC middlewares.
LabeledLog returns a labeled version of logging middleware.
LabeledMetrics returns a LabeledMiddleware that collects histogram metrics.
LabeledTraceServer returns a LabeledMiddleware that wraps the `next` Endpoint in an OpenTracing Span.
Log returns a middleware the logs every request and response at debug level.
Metrics returns a middleware that collects histogram metrics.
Retry returns a middleware that retries the failed requests.
Timeout returns a middleware that timeouts the request when the timer expired.
TraceClient returns a Middleware that wraps the `next` Endpoint in an OpenTracing Span called `operationName`.
TraceConsumer returns a Middleware that wraps the `next` Endpoint in an OpenTracing Span called `operationName`.
TraceProducer returns a Middleware that wraps the `next` Endpoint in an OpenTracing Span called `operationName`.
TraceServer returns a Middleware that wraps the `next` Endpoint in an OpenTracing Span called `operationName`.
Validate returns a middleware that validates the request by calling Validate().

# Constants

GRPCKind stands for GRPC transport.
HTTPKind stands for HTTP transport.

# Structs

ErrorOption is an option that tunes the middleware returned by Error.
RetryOption is the parameter to config the retry middleware.

# Type aliases

LabeledMiddleware is a mutated endpoint.Middleware.