https

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package https provides HTTPS helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHTTPHandler

func ErrorHTTPHandler(logger *logrus.Entry, f ErrorHandlerFunc) http.HandlerFunc

ErrorHTTPHandler is a conversion function that sets up a http.StatusInternalServerError if an error is returned

func FourZeroFour

func FourZeroFour(logger *logrus.Entry, w http.ResponseWriter, r *http.Request)

FourZeroFour is the standard 404 handler.

func LogRequest

func LogRequest(logger *logrus.Entry, r *http.Request) *logrus.Entry

LogRequest logs all the JSON parsable fields in a request as otherwise, the request is not marshable

Types

type ErrorHandlerFunc

type ErrorHandlerFunc func(http.ResponseWriter, *http.Request) error

ErrorHandlerFunc is a http handler that can return an error for standard logging and a 500 response

type Server

type Server struct {
	Mux *http.ServeMux
	// contains filtered or unexported fields
}

Server is a HTTPs server that conforms to the runner interface we use in /cmd/controller, and has a public Mux that can be updated has a default 404 handler, to make discovery of k8s services a bit easier.

func NewServer

func NewServer(certFile, keyFile string, port string) *Server

NewServer returns a Server instance.

func (*Server) Run

func (s *Server) Run(ctx context.Context, _ int) error

Run runs the webhook server, starting a https listener. Will close the http server on stop channel close.

func (*Server) WatchForCertificateChanges added in v1.38.0

func (s *Server) WatchForCertificateChanges() (func(), error)

WatchForCertificateChanges watches for changes in the certificate files

Jump to

Keyboard shortcuts

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