handlers

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package handlers provides HTTP handlers.

Index

Constants

View Source
const (
	MaxRequestBodyBytes = int64(6 * 1024 * 1024)
	DefaultTimeout      = 15 * time.Second
	MinTimeout          = 5 * time.Second
)

MaxRequestBodyBytes represents the max size of Kubernetes objects we read. Kubernetes allows a 2x buffer on the max etcd size (https://github.com/kubernetes/kubernetes/blob/0afa569499d480df4977568454a50790891860f5/staging/src/k8s.io/apiserver/pkg/server/config.go#L362). We allow an additional 2x buffer, as it is still fairly cheap (6mb) Taken from https://github.com/istio/istio/commit/6ca5055a4db6695ef5504eabdfde3799f2ea91fd

View Source
const MaxPayloadSize = 16 * 1024 * 1024

Variables

This section is empty.

Functions

func NewShipperAPI

func NewShipperAPI(base string, d *shipper.MetricShipper) server.API

func NewValidationWebhookAPI

func NewValidationWebhookAPI(base string, controller webhook.WebhookController) server.API

Types

type ProfilingAPI

type ProfilingAPI struct {
	api.Service
}

func NewProfilingAPI

func NewProfilingAPI(base string) *ProfilingAPI

NewProfilingAPI creates a new handler for pprof endpoints

The standard is for this API to live at /debug/pprof

func (*ProfilingAPI) Register

func (a *ProfilingAPI) Register(app server.Server) error

func (*ProfilingAPI) Routes

func (a *ProfilingAPI) Routes() *chi.Mux

type PromMetricsAPI

type PromMetricsAPI struct {
	api.Service
}

PromMetricsAPI is a thin wrapper around the Prometheus HTTP handler to integrate with the go-obvious server API.

func NewPromMetricsAPI

func NewPromMetricsAPI(base string) *PromMetricsAPI

func (*PromMetricsAPI) Register

func (a *PromMetricsAPI) Register(app server.Server) error

func (*PromMetricsAPI) Routes

func (a *PromMetricsAPI) Routes() *chi.Mux

type RemoteWriteAPI

type RemoteWriteAPI struct {
	api.Service
	// contains filtered or unexported fields
}

func NewRemoteWriteAPI

func NewRemoteWriteAPI(base string, d *domain.MetricCollector) *RemoteWriteAPI

func (*RemoteWriteAPI) PostMetrics

func (a *RemoteWriteAPI) PostMetrics(w http.ResponseWriter, r *http.Request)

func (*RemoteWriteAPI) Register

func (a *RemoteWriteAPI) Register(app server.Server) error

func (*RemoteWriteAPI) Routes

func (a *RemoteWriteAPI) Routes() *chi.Mux

type ShipperAPI

type ShipperAPI struct {
	api.Service
	// contains filtered or unexported fields
}

func (*ShipperAPI) Register

func (a *ShipperAPI) Register(app server.Server) error

func (*ShipperAPI) Routes

func (a *ShipperAPI) Routes() *chi.Mux

type ValidationWebhookAPI

type ValidationWebhookAPI struct {
	api.Service
	// contains filtered or unexported fields
}

func (*ValidationWebhookAPI) PostAdmissionRequest

func (a *ValidationWebhookAPI) PostAdmissionRequest(w http.ResponseWriter, r *http.Request)

func (*ValidationWebhookAPI) Register

func (a *ValidationWebhookAPI) Register(app server.Server) error

func (*ValidationWebhookAPI) Routes

func (a *ValidationWebhookAPI) Routes() *chi.Mux

Jump to

Keyboard shortcuts

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