middleware

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPFromContext

func IPFromContext(ctx context.Context) (string, bool)

func NewIPContext

func NewIPContext(ctx context.Context, ip string) context.Context

func NewRequestIDContext

func NewRequestIDContext(ctx context.Context, id string) context.Context

func RealIP

func RealIP(h http.Handler) http.Handler

func RequestID

func RequestID(h http.Handler) http.Handler

func RequestIDFromContext

func RequestIDFromContext(ctx context.Context) string

Types

type ContextID

type ContextID struct {
	// contains filtered or unexported fields
}

A ContextID represents context key for middleware.

func ContextKey

func ContextKey(name string) *ContextID

ContextKey constructs context key using name supplied.

func (*ContextID) String

func (k *ContextID) String() string

String returns formatted context key identifier.

type Recovery

type Recovery struct {
	Logger RecoveryLogger
	// contains filtered or unexported fields
}

func NewRecovery

func NewRecovery(agent notify.Notifier) *Recovery

func (*Recovery) Handler

func (v *Recovery) Handler(h http.Handler) http.Handler

type RecoveryLogger

type RecoveryLogger interface {
	Error(err interface{}, stackTrace []byte)
}

Jump to

Keyboard shortcuts

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