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

server

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotListening = errors.New("Server is not listening yet")
)

Functions

This section is empty.

Types

type Server

type Server struct {
	// ListenAddr is the address the HTTP server should listen on
	// This must be specified.
	ListenAddr int

	// HealthzAddr is the address the healthz HTTP server should listen on
	// If not specified, the healthz endpoint will not be exposed.
	HealthzAddr *int

	// PprofAddress is the address the pprof endpoint should be served on if enabled.
	PprofAddress string
	// EnablePprof determines whether pprof is enabled.
	EnablePprof bool

	// ResourceScheme is used to decode resources and convert them to
	// internal types when validating.
	ResourceScheme *runtime.Scheme

	// If specified, the server will listen with TLS using certificates
	// provided by this CertificateSource.
	CertificateSource servertls.CertificateSource

	ValidationWebhook cmadmission.ValidationInterface
	MutationWebhook   cmadmission.MutationInterface

	// CipherSuites is the list of allowed cipher suites for the server.
	// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
	CipherSuites []string

	// MinTLSVersion is the minimum TLS version supported.
	// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
	MinTLSVersion string

	// The host and port that the metrics endpoint should listen on.
	MetricsListenAddress string

	// If specified, the metrics server will listen with TLS using certificates
	// provided by this CertificateSource.
	MetricsCertificateSource servertls.CertificateSource

	// MetricsCipherSuites is the list of allowed cipher suites for the server.
	// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
	MetricsCipherSuites []string

	// MetricsMinTLSVersion is the minimum TLS version supported.
	// Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants).
	MetricsMinTLSVersion string

	// EnableClientVerification turns on client verification of requests
	// made to the webhook server
	EnableClientVerification bool

	// ClientCAPath is the CA certificate name which server used to verify remote(client)'s certificate.
	// Defaults to "", which means server does not verify client's certificate.
	ClientCAPath string

	// ClientCertificateSubjects is a list of expected subject names for client
	// certificates used by callers (for example, the apiserver). Each entry
	// will be matched against the certificate CommonName and the DNS SANs. If
	// empty, the server will only verify that the client certificate chains to
	// the provided ClientCAPath and will not enforce specific subject names.
	ClientCertificateSubjects []string
}

func (*Server) Port

func (s *Server) Port() (int, error)

Port returns the port number that the webhook listener is listening on

func (*Server) Run

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

Jump to

Keyboard shortcuts

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