Documentation ¶
Index ¶
Constants ¶
const ( DefaultHost = "0.0.0.0" DefaultPort = "2015" DefaultRoot = "." // DefaultConfigFile is the name of the configuration file that is loaded // by default if no other file is specified. DefaultConfigFile = "Caddyfile" )
Variables ¶
var ( Root = DefaultRoot Host = DefaultHost Port = DefaultPort )
These three defaults are configurable through the command line
Functions ¶
func ArrangeBindings ¶ added in v0.7.0
ArrangeBindings groups configurations by their bind address. For example, a server that should listen on localhost and another on 127.0.0.1 will be grouped into the same address: 127.0.0.1. It will return an error if an address is malformed or a TLS listener is configured on the same address as a plaintext HTTP listener. The return value is a map of bind address to list of configs that would become VirtualHosts on that server. Use the keys of the returned map to create listeners, and use the associated values to set up the virtualhosts.
Types ¶
type SetupFunc ¶ added in v0.7.2
type SetupFunc func(c *setup.Controller) (middleware.Middleware, error)
A setup function takes a setup controller. Its return values may both be nil. If middleware is not nil, it will be chained into the HTTP handlers in the order specified in this package.