Documentation
¶
Overview ¶
Package deploy manages Caddy as an automatic TLS reverse proxy. Caddy is started as a managed subprocess with a generated Caddyfile. Auto-TLS via Let's Encrypt is enabled by default when a domain is provided.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Domain is the public domain name, e.g. "example.com".
// When set, Caddy enables automatic HTTPS via Let's Encrypt.
Domain string
// Email is the ACME account email for Let's Encrypt notifications.
Email string
// AppAddr is the address your Go app listens on (Caddy proxies to this).
// Default: "localhost:8080"
AppAddr string
// CaddyBin is the path to the caddy binary (default: "caddy" in PATH).
CaddyBin string
// DataDir is where Caddy stores TLS certificates and state.
// Default: "./data/caddy"
DataDir string
// AdminAddr is Caddy's admin API address.
// Default: "localhost:2019"
AdminAddr string
// ExtraDirectives are appended verbatim to the site block.
ExtraDirectives string
// Logger defaults to slog.Default().
Logger *slog.Logger
}
Config holds the Caddy reverse-proxy configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager controls a Caddy subprocess.
func NewManager ¶
NewManager creates a Manager. Call Start to launch Caddy.
func (*Manager) GenerateCaddyJSON ¶
GenerateCaddyJSON generates a Caddy JSON config (useful for advanced scenarios).
func (*Manager) Reload ¶
Reload triggers a configuration reload via the Caddy admin API (zero-downtime).
Click to show internal directories.
Click to hide internal directories.