Help us shape the future of Go! Take the 2026 Go Developer Survey

https

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 5 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(_ int, stop <-chan struct{}) 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