Documentation
¶
Overview ¶
Package themehost validates and runs the prebuilt theme artifacts a site is served from.
Index ¶
Constants ¶
View Source
const MaxSize = 64 << 20
MaxSize is the largest a theme directory may be.
Variables ¶
View Source
var ErrNotInstalled = errors.New("themehost: theme not installed")
ErrNotInstalled reports that no theme is installed under the name.
Functions ¶
This section is empty.
Types ¶
type Supervisor ¶
type Supervisor struct {
// contains filtered or unexported fields
}
Supervisor runs one theme server and keeps it running.
func NewSupervisor ¶
func NewSupervisor(config SupervisorConfig) *Supervisor
NewSupervisor returns a supervisor for one theme.
func (*Supervisor) Group ¶
func (s *Supervisor) Group() int
Group returns the process group the theme runs in, zero while it is down.
func (*Supervisor) Healthy ¶
func (s *Supervisor) Healthy() bool
Healthy reports whether the theme is serving.
func (*Supervisor) Stop ¶
func (s *Supervisor) Stop()
Stop ends the theme and waits for its process group to go.
func (*Supervisor) Target ¶
func (s *Supervisor) Target() string
Target returns the address the theme serves on, empty while it is down.
type SupervisorConfig ¶
type SupervisorConfig struct {
Theme *Theme
NodeBin string
APIAddr string
Logger *slog.Logger
ReadyTimeout time.Duration
Backoff time.Duration
MaxBackoff time.Duration
MaxAttempts int
StopGrace time.Duration
StubDelay time.Duration
}
SupervisorConfig is what a supervisor needs to run one theme.
Click to show internal directories.
Click to hide internal directories.