server

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Listen

func Listen(network, addr string, options ...ListenerOption) (net.Listener, error)

Listen will listen on a given network and port, with additional options available for enabling TLS and obtaining certificates.

Types

type ListenerConfig

type ListenerConfig struct {
	TLSEnabled bool
	TLSConfig  tls.Config
}

ListenerConfig defines the config of the listener, this mainly deals with configuring the TLSConfig

type ListenerOption

type ListenerOption func(*ListenerConfig) error

ListenerOption is function used to mutate the config, it allows for convenience methods such as WithCertificateSource

func WithCertificateSource

func WithCertificateSource(certificateSource servertls.CertificateSource) ListenerOption

WithCertificateSource specifies the certificate source for TLS, this also implicitly enables TLS for the listener when not nil

func WithTLSCipherSuites

func WithTLSCipherSuites(suites []string) ListenerOption

WithTLSCipherSuites specifies the allowed ciper suites, when an empty/nil array is passed the go defaults are used

func WithTLSMinVersion

func WithTLSMinVersion(version string) ListenerOption

WithTLSMinVersion specifies the minimum TLS version, when an empty string is passed the go defaults are used

Directories

Path Synopsis
tls

Jump to

Keyboard shortcuts

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