Documentation
¶
Index ¶
Constants ¶
const (
LRUCacheSize = 256
)
Variables ¶
This section is empty.
Functions ¶
func GetFreePort ¶ added in v0.2.1
GetFreePort finds an available TCP port by binding to port 0 and retrieving the assigned port number.
Types ¶
type App ¶
type App struct {
Env map[string]string `json:"env,omitempty"`
StatusLog outputTarget `json:"status_log,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
GetWatcher retrieves an existing watcher for the given root directory or creates a new one if it doesn't exist.
type HostReverseProxy ¶
type HostReverseProxy interface {
caddyhttp.MiddlewareHandler
caddy.Provisioner
SetHost(string)
}
type ReverseProxy ¶
type ReverseProxy struct{ *reverseproxy.Handler }
func (*ReverseProxy) SetHost ¶
func (s *ReverseProxy) SetHost(host string)
type SubstrateHandler ¶
type SubstrateHandler struct {
Prefix string `json:"prefix,omitempty"`
// contains filtered or unexported fields
}
SubstrateHandler handles requests by proxying to a substrate process. It manages the lifecycle of substrate processes and routes HTTP requests to the appropriate backend based on path matching.
func (SubstrateHandler) CaddyModule ¶
func (s SubstrateHandler) CaddyModule() caddy.ModuleInfo
func (*SubstrateHandler) Provision ¶
func (s *SubstrateHandler) Provision(ctx caddy.Context) error
Provision sets up the handler.
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
Port int
// contains filtered or unexported fields
}
Watcher watches for a substrate file in a root directory and manages the lifecycle of substrate processes.
func (*Watcher) WriteStatusLog ¶ added in v0.2.1
WriteStatusLog writes a message to the status log The output destination is determined by the app's StatusLog configuration.