middleware

package
v0.0.0-...-90b204c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

RequestIDFromContext get requestID from context

func SetRequestIDToContext

func SetRequestIDToContext(ctx context.Context, requestID string) context.Context

SetRequestIDToContext save the requestID into context

Types

type LoggerMW

type LoggerMW struct {
}

LoggerMW is a logger middleware struct

func NewLoggerMW

func NewLoggerMW() *LoggerMW

NewLoggerMW returns LoggerMW middlware instance

func (*LoggerMW) Invoke

func (m *LoggerMW) Invoke(c *web.Context, next web.HandlerFunc)

Invoke function is a middleware entry

type RequestIDMW

type RequestIDMW struct {
}

RequestIDMW is a request_id middleware struct TODO: move to napnap

func NewRequestIDMW

func NewRequestIDMW() *RequestIDMW

NewRequestIDMW returns NewRequestID middlware instance

func (*RequestIDMW) Invoke

func (m *RequestIDMW) Invoke(c *web.Context, next web.HandlerFunc)

Invoke function is a middleware entry

type TracerMW

type TracerMW struct {
}

TracerMW is tracer middleware struct

func NewTracerMW

func NewTracerMW() *TracerMW

NewTracerMW returns TracerMW middlware instance

func (*TracerMW) Invoke

func (m *TracerMW) Invoke(c *web.Context, next web.HandlerFunc)

Invoke function is a middleware entry

Jump to

Keyboard shortcuts

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