server

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run added in v1.9.0

func Run()

Types

type WebServer

type WebServer interface {
	// SetPorts sets the ports for the server.
	SetPorts(httpPort, httpsPort int) WebServer
	// SetMetricsEnabled enables Prometheus metrics export.
	SetMetricsEnabled(enabled bool) WebServer
	// SetServePath specifies the path to serve the file system.
	SetServePath(fileSystemServePath string, metricsServePath string) WebServer
	// SetPath sets the directory to serve.
	SetPath(path string) error
	// SetCertificateFile sets the certificates that should be used to serve HTTPS traffic.
	SetCertificateFile(certificateFilePath string) WebServer
	// SetPrivateKey sets the private key file path for HTTPS traffic encryption.
	SetPrivateKey(privateKeyFilePath string) WebServer
	// SetVerbose sets verbose logging.
	SetVerbose(verbose bool) WebServer
	// SetUpload sets the upload endpoint and upload directory.
	SetUpload(uploadPath string, uploadServePath string) error
	// Serve starts serving the HTTP/HTTPS server synchronously.
	Serve(<-chan error) error
}

WebServer is a convience wrapper for Go's HTTP/HTTPS Web serving API.

func NewWebServer

func NewWebServer() WebServer

NewWebServer creates a new web server instance.

Jump to

Keyboard shortcuts

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