Documentation
¶
Overview ¶
Package config defines the config/config.yml configuration model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRuntimeConfig []byte
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Runner runner.Options `yaml:"runner"`
Flatstack Flatstack `yaml:"flatstack"`
Routes Routes `yaml:"routes"`
Server Server `yaml:"server"`
Telemetry Telemetry `yaml:"telemetry"`
Env []string `yaml:"env"`
}
Config configures phpscript runtimes and HTTP modules.
func New ¶
func New() Config
New returns the default configuration, which is config/config.yml as it is compiled into the binary. Defaults live in that file and nowhere else, so a file passed with -f is read on top of it and only has to name what it changes.
func NewTestConfig ¶ added in v0.3.0
func NewTestConfig() Config
NewTestConfig returns the default configuration with the parts a test has no use for turned off: a port picked by the kernel, no lifecycle logging, and no recorder, so parallel tests neither collide on a port nor record into each other.
func (Config) PlatformOptions ¶ added in v0.3.0
PlatformOptions returns the platform options `phpscript server` runs under.
There is one recorder and the platform owns it: given these options it builds the tracer, wraps every module in the tracing middleware and mounts the debug front end under Telemetry.Path. phpscript registers no recorder of its own. It observes the interpreter onto the trace that middleware started, so interpreter spans show up on the same front end as the request that caused them.
type Flatstack ¶
type Flatstack struct {
Enabled bool `yaml:"enabled"`
}
Flatstack selects the flat bytecode runtime when enabled.
type Routes ¶
type Routes struct {
Enabled bool `yaml:"enabled"`
}
Routes controls loading of annotated PHP routes by HTTP servers.
type Server ¶ added in v0.3.0
type Server struct {
// Addr is the address the HTTP server listens on.
Addr string `yaml:"addr"`
// Quiet turns down platform lifecycle logging.
Quiet bool `yaml:"quiet"`
// Modules limits which platform modules load, by name. An empty list
// loads all of them.
Modules []string `yaml:"modules"`
}
Server is the YAML spelling of platform.Options: everything a configuration file gets to say about the platform `phpscript server` runs on. The options the platform takes from the process rather than from a file, such as the config filesystem a composed service embeds, are not part of it, and neither is the recorder: that one is the top level telemetry block, applied by Config.PlatformOptions.