mw

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Overview

Package ginmw offers a collection of middleware to enforce cross service policies, such as observabilities and context passing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context() gin.HandlerFunc

Context is a gin middleware that adds request context to contract keys.

func Log

func Log(logger log.Logger, keyer contract.Keyer, ignore ...string) gin.HandlerFunc

Log is a gin middleware that logs access record via kitlog. The paths defined by "ignore" argument are ignored.

func Metrics

func Metrics(hist metrics.Histogram, keyer contract.Keyer, addPath bool) gin.HandlerFunc

Metrics is a gin middleware that adds request histogram. Setting addPath to true will make histogram to use request path as a dimension. This is ok with few total number of paths, but incurs performance issue if the cardinality of request path is high.

func Trace

func Trace(tracer stdtracing.Tracer, keyer contract.Keyer) gin.HandlerFunc

Trace is a gin middleware that adds opentracing support.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL