Documentation ¶
Index ¶
- func AccessTokenFrom(ctx context.Context) (string, bool)
- func CorrelationIDHandler(next http.Handler) http.Handler
- func Cors(cfg *config.Config, methods []string) func(http.Handler) http.Handler
- func IngressFrom(ctx context.Context) (ingress.Ingress, bool)
- func LogEntryFrom(r *http.Request) *log.Entry
- func PathFrom(ctx context.Context) (string, bool)
- func RequestWithIngress(r *http.Request, ing ingress.Ingress) *http.Request
- func RequestWithPath(r *http.Request, path string) *http.Request
- func WithAccessToken(ctx context.Context, accessToken string) context.Context
- func WithIngress(ctx context.Context, ingress ingress.Ingress) context.Context
- func WithPath(ctx context.Context, path string) context.Context
- type IngressMiddleware
- type IngressSource
- type LogEntryMiddleware
- type PrometheusMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestWithIngress ¶
func WithAccessToken ¶
Types ¶
type IngressMiddleware ¶
type IngressMiddleware struct {
IngressSource
}
func Ingress ¶
func Ingress(source IngressSource) IngressMiddleware
type IngressSource ¶
type LogEntryMiddleware ¶
type LogEntryMiddleware struct{}
func LogEntry ¶
func LogEntry(provider string) LogEntryMiddleware
LogEntry is copied verbatim from httplog package to replace with our own requestLogger implementation.
type PrometheusMiddleware ¶
type PrometheusMiddleware struct {
// contains filtered or unexported fields
}
PrometheusMiddleware is a handler that exposes prometheus metrics for the number of requests, the latency and the response size, partitioned by status code, method and HTTP path.
func Prometheus ¶
func Prometheus(provider string, buckets ...float64) *PrometheusMiddleware
Prometheus returns a new PrometheusMiddleware handler.
func (*PrometheusMiddleware) Handler ¶
func (m *PrometheusMiddleware) Handler(next http.Handler) http.Handler
func (*PrometheusMiddleware) Initialize ¶
func (m *PrometheusMiddleware) Initialize(path, method string, code int)
Click to show internal directories.
Click to hide internal directories.