v1.42.0 Latest Latest

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0



Package https provides HTTPS helpers.



This section is empty.


This section is empty.


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


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) *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