server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAutoTLS

func WithAutoTLS(autoTLS bool) func(*Server)

WithAutoTLS configures the ability to use automatic TLS or not.

func WithDomains

func WithDomains(domains []string) func(*Server)

WithDomain configures the domain name(s) to issue a cert for with auto TLS.

func WithLogFormat

func WithLogFormat(logformat string) func(*Server)

WithLogFormat configures the log format of the server.

func WithLogLevel

func WithLogLevel(loglevel string) func(*Server)

WithLogLevel configures the log level of the server.

func WithMetrics

func WithMetrics(metrics bool) func(*Server)

WithMetrics configures the enablement of Prometheus metrics or not.

func WithMiddlewares

func WithMiddlewares(mws ...func(http.Handler) http.Handler) func(*Server)

WithMiddlewares adds middleware to the mux.

func WithPort

func WithPort(port int) func(*Server)

WithPort configures the server to listen on the specified port when calling Start().

func WithTLSCert

func WithTLSCert(tlsCertPath string) func(*Server)

WithTLSCert configures the certificate path for a custom certificate.

func WithTLSKey

func WithTLSKey(tlsKeyPath string) func(*Server)

WithTLSKey configures the certificate key path for a custom key.

func WithValidation

func WithValidation(validate bool) func(*Server)

WithValidation ensures configuration options are valid when creating a new server.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is our web server that runs the network mirror.

func New

func New(options ...func(*Server)) (*Server, error)

New returns a new network mirror server.

func (*Server) Start

func (s *Server) Start() error

Start starts the listener of the server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳