httphandler

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAdmissionWebhook

func HandleAdmissionWebhook(webhook controllermanager.Webhook) http.HandlerFunc

HandleAdmissionWebhook returns a http.HandlerFunc for a Webhook.

func ListenAndServe

func ListenAndServe(ctx context.Context, config *configv1alpha1.HTTPSpec, mgr Manager) error

ListenAndServe listens on the given TCP address and gracefully stops when the given context is canceled, setting up all HTTP handlers.

func ListenAndServeWebhooks

func ListenAndServeWebhooks(
	ctx context.Context,
	config *configv1alpha1.WebhookServerSpec,
	webhooks []controllermanager.Webhook,
) error

ListenAndServeWebhooks listens on the given TCP address and gracefully stops when the given context is canceled, setting up all webhooks handlers.

func ServeHealth

func ServeHealth(mux *http.ServeMux, cfg *configv1alpha1.HealthSpec, mgr Manager)

ServeHealth adds health probe handlers to the given serve mux.

func ServeMetrics

func ServeMetrics(mux *http.ServeMux, cfg *configv1alpha1.MetricsSpec)

ServeMetrics adds Prometheus metrics handlers to the given serve mux.

func ServeWebhooks

func ServeWebhooks(mux *http.ServeMux, webhooks []controllermanager.Webhook)

ServeWebhooks prepares admission webhooks to be served. TODO(irvinlim): Handle conversion webhooks here in the future too.

Types

type Manager

type Manager interface {
	GetReadiness() error
	GetHealth() []controllermanager.HealthStatus
}

type Server

type Server interface {
	ListenAndServe() error
	Shutdown(context.Context) error
}

Jump to

Keyboard shortcuts

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