gin

package
v1.3.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGinContextAdapter added in v1.1.1

func NewGinContextAdapter() func(context.Context) context.Context

NewGinContextAdapter is used to run logrus/trace with gin.Context() rather than gin.Context.Request.Context(), however this will not work when ctx is wrapped (such as kitex) Deprecated Recommended solution: 1. Use gin.Context.Request.Context() when tracing 2. For gin version>=1.8.1, set engin.ContextWithFallback=true, which solve this problem perfectly.

func NewMiddleware

func NewMiddleware(tracer aitracer.Tracer, opts ...Option) gin.HandlerFunc

Types

type Config added in v1.3.4

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

type Option added in v1.3.4

type Option func(*Config)

func WithIgnoreRequest added in v1.3.4

func WithIgnoreRequest(f func(c *gin.Context) bool) Option

func WithPathNormalizer added in v1.3.4

func WithPathNormalizer(f func(escapedPath string) string) Option

func WithTagsExtractor added in v1.3.7

func WithTagsExtractor(f func(c *gin.Context) map[string]string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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