globals

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEnvoyVersionsURL is the default value for GlobalOpts.EnvoyVersionsURL
	DefaultEnvoyVersionsURL = "https://archive.tetratelabs.io/envoy/envoy-versions.json"
	// DefaultEnvoyVersionsSchemaURL is the JSON schema used to validate GlobalOpts.EnvoyVersionsURL
	DefaultEnvoyVersionsSchemaURL = "https://archive.tetratelabs.io/release-versions-schema.json"
	// DefaultPlatform is the current platform of the host machine
	DefaultPlatform = version.Platform(runtime.GOOS + "/" + runtime.GOARCH)
)

Variables

View Source
var (
	// DefaultHomeDir is the default value for GlobalOpts.HomeDir
	DefaultHomeDir = moreos.ReplacePathSeparator("${HOME}/.func-e")
	// 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)?$`)
)

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
	// Version is the version of the CLI, used in help statements and HTTP requests via "User-Agent".
	// Override this via "-X main.version=XXX"
	Version version.Version
	// 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
	// Quiet means don't Logf to Out
	Quiet bool
	// Out is where status messages are written. Defaults to os.Stdout
	Out io.Writer
	// The platform to target for the Envoy install.
	Platform version.Platform
}

GlobalOpts represents options that affect more than one func-e commands.

Fields representing non-hidden flags have values set according to the following rules:

  1. value that precedes flag parsing, used in tests
  2. to a value of the command line argument, e.g. `--home-dir`
  3. optional mapping to an environment variable, e.g. `FUNC_E_HOME` (not all flags are mapped to ENV)
  4. otherwise, to the default value, e.g. DefaultHomeDir

func (*GlobalOpts) Logf added in v0.7.0

func (o *GlobalOpts) Logf(format string, a ...interface{})

Logf is used for shared functions that log conditionally on GlobalOpts.Quiet

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"

Jump to

Keyboard shortcuts

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