http

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

package http handles serving HTTP(s) requests, HTTP middleware, and defines common handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogRequest

func LogRequest(next http.Handler, logger logr.Logger) http.Handler

Types

type ConfigHTTP

type ConfigHTTP struct {
	Logger         logr.Logger
	TrustedProxies []string
}

ConfigHTTP is the configuration for the http server.

func (*ConfigHTTP) ServeHTTP

func (c *ConfigHTTP) ServeHTTP(ctx context.Context, addr string, handlers HandlerMapping) error

ServeHTTP sets up all the HTTP routes using a stdlib mux and starts the http server, which will block. App functionality is instrumented in Prometheus and OpenTelemetry.

type ConfigHTTPS

type ConfigHTTPS struct {
	Logger         logr.Logger
	TrustedProxies []string
	TLSCerts       []tls.Certificate
}

ConfigHTTPS is the configuration for the HTTPS server.

func (*ConfigHTTPS) ServeHTTPS

func (c *ConfigHTTPS) ServeHTTPS(ctx context.Context, addrPort string, handlers HandlerMapping) error

ServeHTTPS sets up all the HTTP routes using a stdlib mux and starts the https server, which will block. App functionality is instrumented in Prometheus and OpenTelemetry.

type HandlerMapping

type HandlerMapping map[string]http.HandlerFunc

HandlerMapping is a map of routes to http.HandlerFuncs.

type HealthCheck

type HealthCheck struct {
	StartTime time.Time
	GitRev    string
}

func (HealthCheck) HandlerFunc

func (h HealthCheck) HandlerFunc(log logr.Logger) http.HandlerFunc

Jump to

Keyboard shortcuts

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