https

package
v1.23.0-rc Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

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

Jump to

Keyboard shortcuts

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