chi

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouteParamManager

func NewRouteParamManager() routing.RouteParamManager

NewRouteParamManager provides a new RouteParamManager.

func NewRouter

func NewRouter(logger logging.Logger, tracerProvider tracing.TracerProvider, metricProvider metrics.Provider, cfg *Config) routing.Router

NewRouter constructs a new router.

func RequestIDFunc

func RequestIDFunc(req *http.Request) string

RequestIDFunc returns the request ID assigned to a request with Chi's middleware.

Types

type Config

type Config struct {
	ServiceName            string   `env:"SERVICE_NAME"              json:"serviceName,omitempty"`
	ValidDomains           []string `env:"VALID_DOMAINS"             json:"validDomains,omitempty"`
	EnableCORSForLocalhost bool     `env:"ENABLE_CORS_FOR_LOCALHOST" json:"enableCORSForLocalhost"`
	SilenceRouteLogging    bool     `env:"SILENCE_ROUTE_LOGGING"     json:"silenceRouteLogging,omitempty"`
	// contains filtered or unexported fields
}

Config configures our router.

func (*Config) ValidateWithContext

func (cfg *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates a router config struct.

Jump to

Keyboard shortcuts

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