server

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug bool
	// Default: max cpu (0)
	NumCPU         int
	ListenAddr     string
	ListenAddrTLS  string
	DisableTLS     bool
	FallbackDomain string
	Graceful       bool
	CachePath      string
	// Change this to use a different letsencrypt url for handling cert requests.
	LetsEncryptURL string
	// APIListen lets you host the REST api on "host:port"
	// The API will not be available if the config is empty.
	APIListen string
	// API key to use for API commands/communication
	APIKey string
	// If not empty, APIDomain will spin a domain/route for the API
	APIDomain         string
	APIDomainAutocert bool
	//
	S3Cache  bool
	S3ID     string
	S3Secret string
	S3Region string
	S3Bucket string
	S3Folder string
	//
	AutocertAll bool
}

Config contains the root configuration of a sandpiper server

type Server

type Server interface {
	Add(r route.Route) error
	Run() error
	Close()
	Init()
	ServeHTTP(w http.ResponseWriter, r *http.Request)
	Routes() map[string]route.Route
	GetConfig() Config
	SetConfig(cfg Config)
}

Server is the structure that controls, routes and certificates.

func Default

func Default(cfg *Config) Server

Default starts a server with the default configuration options

Jump to

Keyboard shortcuts

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