Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultHomeDir is the default value for GlobalOpts.HomeDir DefaultHomeDir = "${HOME}/.func-e" // DefaultEnvoyVersionsURL is the default value for GlobalOpts.EnvoyVersionsURL DefaultEnvoyVersionsURL = "https://archive.tetratelabs.io/envoy/envoy-versions.json" )
Variables ¶
View Source
var ( // EnvoyVersionPattern is used to validate versions and is the same pattern as release-versions-schema.json. EnvoyVersionPattern = regexp.MustCompile(`^[1-9][0-9]*\.[0-9]+\.[0-9]+(_debug)?$`) // CurrentPlatform is the platform of the current process. This is used as a key in EnvoyVersion.Tarballs. CurrentPlatform = version.Platform(runtime.GOOS + "/" + runtime.GOARCH) )
Functions ¶
This section is empty.
Types ¶
type GlobalOpts ¶
type GlobalOpts struct {
// RunOpts are inlined to allow tests to override parameters without changing ENV variables or flags
RunOpts
// EnvoyVersionsURL is the path to the envoy-versions.json. Defaults to DefaultEnvoyVersionsURL
EnvoyVersionsURL string
// EnvoyVersion is the default 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.
EnvoyVersion version.Version
// HomeDir is an absolute path which most importantly contains "versions" installed from EnvoyVersionsURL. Defaults to DefaultHomeDir
HomeDir string
// Out is where status messages are written. Defaults to os.Stdout
Out io.Writer
}
GlobalOpts represents options that affect more than one func-e commands.
Fields representing non-hidden flags have values set according to the following rules:
- value that precedes flag parsing, used in tests
- to a value of the command line argument, e.g. `--home-dir`
- optional mapping to an environment variable, e.g. `FUNC_E_HOME` (not all flags are mapped to ENV)
- otherwise, to the default value, e.g. DefaultHomeDir
type RunOpts ¶
type RunOpts struct {
// EnvoyPath is the exec.Cmd path to "envoy". Defaults to "$HomeDir/versions/$version/bin/envoy"
EnvoyPath string
// RunDir is the location any generated files are written.
// This is not Envoy's working directory, which remains the same as the $PWD of func-e.
//
// Upon shutdown, this directory is archived as "../$(basename $RunDir).tar.gz"
// Defaults to "$HomeDir/runs/$epochtime"
RunDir string
// DontArchiveRunDir is used in testing and prevents archiving the RunDir
DontArchiveRunDir bool
}
RunOpts support invocations of "func-e run"
Click to show internal directories.
Click to hide internal directories.