Documentation
¶
Index ¶
Constants ¶
const DefaultAddr = ":8080"
DefaultAddr is the address used when neither the command line nor the configuration file names one.
const Name = "Serve multiple sites by domain from a config file"
Name is the command title.
Variables ¶
This section is empty.
Functions ¶
func DirFS ¶
DirFS opens a vhost path as a directory on disk, reporting a path that is missing or is not a directory.
Types ¶
type Module ¶
type Module struct {
platform.UnimplementedModule
// contains filtered or unexported fields
}
Module routes requests to a per-domain module. Every virtual host gets its own router, so the modules keep mounting at their absolute paths and stay unaware of each other.
func NewModule ¶
NewModule builds a virtual hosting module from a configuration. The configuration is expected to be valid, as config.Load returns it. Each vhost's content filesystem is opened here, so a path that does not exist is reported before the server starts.
func (*Module) Mount ¶
Mount gives every virtual host its own router and installs the dispatcher as a catch all on the shared router. A vhost that fails to mount aborts startup: a site silently missing from a running server is worse than a server that refuses to start.
type Option ¶
type Option func(*Module)
Option configures a Module.
func WithResolver ¶
WithResolver replaces the filesystem resolver used to open vhost content.