Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Env map[string]string `json:"env,omitempty"`
// How processes are restarted: "always", "never", "on_failure"
RestartPolicy string `json:"restart_policy,omitempty"`
RedirectStdout *outputTarget `json:"redirect_stdout,omitempty"`
RedirectStderr *outputTarget `json:"redirect_stderr,omitempty"`
// contains filtered or unexported fields
}
App is the main substrate application that manages the substrate server and provides configuration for substrate processes.
func (App) CaddyModule ¶
func (h App) CaddyModule() caddy.ModuleInfo
func (*App) GetWatcher ¶ added in v0.2.0
type DebugInfo ¶ added in v0.2.0
type DebugInfo struct {
// Version string `json:"version"`
BuildInfo *debug.BuildInfo `json:"build_info,omitempty"`
GoVersion string `json:"go_version"`
GOOS string `json:"goos"`
GOARCH string `json:"goarch"`
NumGoroutine int `json:"num_goroutine"`
NumCPU int `json:"num_cpu"`
Uptime string `json:"uptime"`
StartTime time.Time `json:"start_time"`
MemStats runtime.MemStats `json:"mem_stats"`
Watchers map[string]string `json:"watchers,omitempty"`
}
DebugInfo contains information about the substrate system
func GetDebugInfo ¶ added in v0.2.0
type HostReverseProxy ¶
type HostReverseProxy interface {
caddyhttp.MiddlewareHandler
caddy.Provisioner
SetHost(string)
}
type Order ¶
type Order struct {
// Host is the upstream server to proxy requests to
Host string `json:"host,omitempty"`
// Match contains patterns for matching files by extension
// Format: "/path/*.ext" where path is a directory and ext is a file extension
Match []string `json:"match,omitempty"`
// Paths contains exact paths that should be proxied to the upstream
Paths []string `json:"paths,omitempty"`
// CatchAll contains fallback paths to use when no other match is found for a path
CatchAll []string `json:"catch_all,omitempty"`
// contains filtered or unexported fields
}
Order represents a command from a substrate process
type ReverseProxy ¶
type ReverseProxy struct{ *reverseproxy.Handler }
func (*ReverseProxy) SetHost ¶
func (s *ReverseProxy) SetHost(host string)
type Server ¶
func (*Server) WaitForStart ¶
type SubstrateHandler ¶
type SubstrateHandler struct {
Prefix string `json:"prefix,omitempty"`
// contains filtered or unexported fields
}
SubstrateHandler handles requests by proxying to a substrate process
func (SubstrateHandler) CaddyModule ¶
func (s SubstrateHandler) CaddyModule() caddy.ModuleInfo
func (*SubstrateHandler) ServeHTTP ¶
func (s *SubstrateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
type Watcher ¶ added in v0.2.0
type Watcher struct {
// Root is the directory to watch for a substrate file
Root string
// Order is the current active order from the substrate process
Order *Order
// contains filtered or unexported fields
}
Watcher watches for a substrate file in a root directory and manages the lifecycle of substrate processes.
func (*Watcher) Close ¶ added in v0.2.0
func (w *Watcher) Close()
Close stops watching and cleans up resources
func (*Watcher) GetCmd ¶ added in v0.2.0
func (w *Watcher) GetCmd() *execCmd
GetCmd returns the current command
func (*Watcher) IsReady ¶ added in v0.2.0
IsReady returns true if the watcher has a command with an order
Click to show internal directories.
Click to hide internal directories.