api

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RunFunc added in v1.2.0

type RunFunc func(ctx context.Context, args []string, options ...RunOption) error

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

type RunOption func(*opts.RunOpts)

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 EnvoyErr added in v1.2.0

func EnvoyErr(w io.Writer) RunOption

EnvoyErr sets the writer for Envoy stderr

func EnvoyOut added in v1.2.0

func EnvoyOut(w io.Writer) RunOption

EnvoyOut sets the writer for Envoy stdout

func EnvoyVersion

func EnvoyVersion(envoyVersion string) RunOption

EnvoyVersion overrides the version of Envoy to run. Defaults to the contents of "$HomeDir/versions/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

func EnvoyVersionsURL(envoyVersionsURL string) RunOption

EnvoyVersionsURL is the path to the envoy-versions.json. Defaults to "https://archive.tetratelabs.io/envoy/envoy-versions.json"

func HomeDir

func HomeDir(homeDir string) RunOption

HomeDir is an absolute path which most importantly contains "versions" installed from EnvoyVersionsURL. Defaults to "${HOME}/.func-e"

func Out

func Out(out io.Writer) RunOption

Out is where status messages are written. Defaults to os.Stdout

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL