Documentation
¶
Index ¶
- func AddSite(site Site) error
- func BinDir() string
- func CertsDir() string
- func ConfigDir() string
- func DataDir() string
- func DataSubDir(name string) string
- func DnsmasqDir() string
- func GlobalConfigFile() string
- func NginxConfD() string
- func NginxDir() string
- func PHPImageHashFile() string
- func QuadletDir() string
- func RemoveSite(name string) error
- func SaveGlobal(cfg *GlobalConfig) error
- func SaveSites(reg *SiteRegistry) error
- func SitesFile() string
- func SystemdUserDir() string
- type GlobalConfig
- type ServiceConfig
- type Site
- type SiteRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDir ¶
func ConfigDir() string
ConfigDir returns ~/.config/lerd/ (or $XDG_CONFIG_HOME/lerd/).
func DataDir ¶
func DataDir() string
DataDir returns ~/.local/share/lerd/ (or $XDG_DATA_HOME/lerd/).
func DataSubDir ¶
DataSubDir returns a named subdirectory under data.
func GlobalConfigFile ¶
func GlobalConfigFile() string
GlobalConfigFile returns the path to config.yaml.
func PHPImageHashFile ¶ added in v0.1.25
func PHPImageHashFile() string
PHPImageHashFile returns the path to the stored PHP-FPM Containerfile hash.
func RemoveSite ¶
RemoveSite removes a site by name from the registry.
func SaveGlobal ¶
func SaveGlobal(cfg *GlobalConfig) error
SaveGlobal writes the configuration to config.yaml.
func SaveSites ¶
func SaveSites(reg *SiteRegistry) error
SaveSites writes the registry to sites.yaml.
func SystemdUserDir ¶
func SystemdUserDir() string
SystemdUserDir returns the systemd user unit directory.
Types ¶
type GlobalConfig ¶
type GlobalConfig struct {
PHP struct {
DefaultVersion string `yaml:"default_version" mapstructure:"default_version"`
} `yaml:"php" mapstructure:"php"`
Node struct {
DefaultVersion string `yaml:"default_version" mapstructure:"default_version"`
} `yaml:"node" mapstructure:"node"`
Nginx struct {
HTTPPort int `yaml:"http_port" mapstructure:"http_port"`
HTTPSPort int `yaml:"https_port" mapstructure:"https_port"`
} `yaml:"nginx" mapstructure:"nginx"`
DNS struct {
TLD string `yaml:"tld" mapstructure:"tld"`
} `yaml:"dns" mapstructure:"dns"`
ParkedDirectories []string `yaml:"parked_directories" mapstructure:"parked_directories"`
Services map[string]ServiceConfig `yaml:"services" mapstructure:"services"`
}
GlobalConfig is the top-level lerd configuration.
func LoadGlobal ¶
func LoadGlobal() (*GlobalConfig, error)
LoadGlobal reads config.yaml via viper, returning defaults if the file is absent.
type ServiceConfig ¶
type ServiceConfig struct {
Enabled bool `yaml:"enabled" mapstructure:"enabled"`
Image string `yaml:"image" mapstructure:"image"`
Port int `yaml:"port" mapstructure:"port"`
}
ServiceConfig holds configuration for an optional service.
type Site ¶
type Site struct {
Name string `yaml:"name"`
Domain string `yaml:"domain"`
Path string `yaml:"path"`
PHPVersion string `yaml:"php_version"`
NodeVersion string `yaml:"node_version"`
Secured bool `yaml:"secured"`
}
Site represents a single registered Lerd site.
type SiteRegistry ¶
type SiteRegistry struct {
Sites []Site `yaml:"sites"`
}
SiteRegistry holds all registered sites.
func LoadSites ¶
func LoadSites() (*SiteRegistry, error)
LoadSites reads sites.yaml, returning an empty registry if the file does not exist.