tracking

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHeader = "X-Track-ID"
	Header        = DefaultHeader
	Key           = "track_id"
)

Variables

This section is empty.

Functions

func Get

func Get(c *gin.Context) string

func Middleware

func Middleware(configs ...Config) gin.HandlerFunc

func MustTrackID

func MustTrackID(ctx context.Context) string

func NewTrackID

func NewTrackID() string

func TrackID

func TrackID(ctx context.Context) string

func WithTrackID

func WithTrackID(ctx context.Context, trackID string) context.Context

Types

type Config

type Config struct {
	Enabled        bool   `mapstructure:"enabled" yaml:"enabled"`
	Header         string `mapstructure:"header" yaml:"header"`
	ResponseHeader string `mapstructure:"response_header" yaml:"response_header"`
	Generator      string `mapstructure:"generator" yaml:"generator"`
	ForceNew       bool   `mapstructure:"force_new" yaml:"force_new"`
}

func DefaultConfig

func DefaultConfig() Config

Jump to

Keyboard shortcuts

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