Documentation ¶
Index ¶
- func NewLoggingInterceptor(log *zap.SugaredLogger) fiber.Interceptor
- func NewMetricsInterceptor(client StatsdClient) fiber.Interceptor
- func NewTracingInterceptor(tracer opentracing.Tracer) fiber.Interceptor
- type MetricsInterceptor
- type MetricsKey
- type ResponseLoggingInterceptor
- type StatsdClient
- type TracingInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggingInterceptor ¶
func NewLoggingInterceptor(log *zap.SugaredLogger) fiber.Interceptor
NewLoggingInterceptor is a creator factory for a ResponseLoggingInterceptor
func NewMetricsInterceptor ¶
func NewMetricsInterceptor(client StatsdClient) fiber.Interceptor
NewMetricsInterceptor creates a new MetricsInterceptor with the given client
func NewTracingInterceptor ¶
func NewTracingInterceptor(tracer opentracing.Tracer) fiber.Interceptor
NewTracingInterceptor creates a TracingInterceptor
Types ¶
type MetricsInterceptor ¶
type MetricsInterceptor struct { fiber.NoopAfterDispatchInterceptor // contains filtered or unexported fields }
MetricsInterceptor is an interceptor to log metrics
func (*MetricsInterceptor) AfterCompletion ¶
func (i *MetricsInterceptor) AfterCompletion(ctx context.Context, req fiber.Request, queue fiber.ResponseQueue)
AfterCompletion computes and submits the request completion time
func (*MetricsInterceptor) BeforeDispatch ¶
BeforeDispatch records count of the requests through a component and the request start time
type MetricsKey ¶
type MetricsKey string
MetricsKey is an alias for a string
var (
CtxDispatchStartTimeKey MetricsKey = "CTX_DISPATCH_START_TIME"
)
CtxDispatchStartTimeKey is used to record the start time of a request
type ResponseLoggingInterceptor ¶
type ResponseLoggingInterceptor struct { fiber.NoopBeforeDispatchInterceptor fiber.NoopAfterCompletionInterceptor // contains filtered or unexported fields }
ResponseLoggingInterceptor is the structural interceptor used for logging responses
func (*ResponseLoggingInterceptor) AfterDispatch ¶
func (i *ResponseLoggingInterceptor) AfterDispatch(ctx context.Context, req fiber.Request, queue fiber.ResponseQueue)
AfterDispatch logs the success or failure information of a request
type StatsdClient ¶
type StatsdClient interface { Increment(string) Unique(string, string) Timing(string, interface{}) }
StatsdClient is an interface for a stats listener
type TracingInterceptor ¶
type TracingInterceptor struct { fiber.NoopAfterDispatchInterceptor // contains filtered or unexported fields }
TracingInterceptor allows for tracing requests
func (*TracingInterceptor) AfterCompletion ¶
func (i *TracingInterceptor) AfterCompletion(ctx context.Context, req fiber.Request, queue fiber.ResponseQueue)
AfterCompletion returns the Span previously associated with context
func (*TracingInterceptor) BeforeDispatch ¶
BeforeDispatch starts and returns a span with the given operation name