Documentation
¶
Overview ¶
Package api allows Go projects to use func-e as a library, decoupled from how the func-e binary reads environment variables or CLI args.
Index ¶
- type RunFunc
- type RunOption
- func ConfigHome(configHome string) RunOption
- func DataHome(dataHome string) RunOption
- func EnvoyErr(w io.Writer) RunOption
- func EnvoyOut(w io.Writer) RunOption
- func EnvoyVersion(envoyVersion string) RunOption
- func EnvoyVersionsURL(envoyVersionsURL string) RunOption
- func HomeDir(homeDir string) RunOptiondeprecated
- func Out(out io.Writer) RunOption
- func RunID(runID string) RunOption
- func RuntimeDir(runtimeDir string) RunOption
- func StateHome(stateHome string) RunOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunFunc ¶ added in v1.2.0
RunFunc downloads Envoy and runs it as a process with the arguments passed to it. Use api.RunOption for configuration options.
On success, this blocks and returns nil when either `ctx` is done, or the process exits with status zero.
The default implementation of RunFunc is func_e.Run.
type RunOption ¶
RunOption is a configuration for RunFunc.
Note: None of these default to values read from OS environment variables. If you wish to introduce such behavior, populate them in calling code.
func ConfigHome ¶ added in v1.3.0
ConfigHome is the directory containing configuration files. Defaults to "~/.config/func-e"
Files stored here: - envoy-version (selected version preference)
func DataHome ¶ added in v1.3.0
DataHome is the directory containing downloaded Envoy binaries. Defaults to "~/.local/share/func-e"
Files stored here: - envoy-versions/{version}/bin/envoy (downloaded Envoy binaries)
func EnvoyVersion ¶
EnvoyVersion overrides the version of Envoy to run. Defaults to the contents of "$ConfigHome/envoy-version".
When that file is missing, it is generated from ".latestVersion" from the EnvoyVersionsURL. Its value can be in full version major.minor.patch format, e.g. 1.18.1 or without patch component, major.minor, e.g. 1.18.
func EnvoyVersionsURL ¶
EnvoyVersionsURL is the path to the envoy-versions.json. Defaults to "https://archive.tetratelabs.io/envoy/envoy-versions.json"
func RunID ¶ added in v1.3.0
RunID sets a custom run identifier used in StateDir and RuntimeDir paths. By default, a timestamp-based runID is auto-generated (e.g., "20250115_123456_789").
Use this to: - Create predictable directories for Docker/K8s (e.g., RunID("0")) - Implement custom naming schemes
Validation: runID cannot contain path separators (/ or \)
func RuntimeDir ¶ added in v1.3.0
RuntimeDir is the directory containing ephemeral runtime files. Defaults to "/tmp/func-e-${UID}"
Files stored here: - {runID}/admin-address.txt (Envoy admin API endpoint)
Note: Runtime files are ephemeral and may be cleaned up on system restart.