routing

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package routing provides dynamic HTTP routing with versioning and health checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMetricsRoutes added in v0.0.9

func RegisterMetricsRoutes(mux *http.ServeMux, m *metrics.Metrics)

RegisterMetricsRoutes adds routes for Prometheus metrics

Types

type Router

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

Router handles dynamic HTTP routing with versioning and health checks. It utilizes chi for routing and provides middleware support for metrics and authentication.

func NewRouter

func NewRouter(cfg *config.Config, handlers map[string]http.Handler, logger *zap.Logger, metrics *metrics.Metrics) *Router

NewRouter creates a new router with the given configuration and initializes routes.

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP implements the http.Handler interface. It handles incoming HTTP requests.

Jump to

Keyboard shortcuts

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