Documentation ¶
Index ¶
- Variables
- func NewRuntime(options ...RuntimeOption) (binary.FetchRunner, error)
- type Config
- type Mode
- type Runtime
- func (r *Runtime) AlreadyDownloaded(key *manifest.Key) bool
- func (r *Runtime) AppendArgs(args []string)
- func (r *Runtime) BinaryStore() string
- func (r *Runtime) DebugStore() string
- func (r *Runtime) Fetch(key *manifest.Key, binaryLocation string) error
- func (r *Runtime) FetchAndRun(reference string, args []string) error
- func (r *Runtime) GetPid() (int, error)
- func (r *Runtime) RegisterDone()
- func (r *Runtime) RegisterPreStart(f ...func(binary.Runner) error)
- func (r *Runtime) RegisterPreTermination(f ...func(binary.Runner) error)
- func (r *Runtime) RegisterWait(delta int)
- func (r *Runtime) Run(key *manifest.Key, args []string) error
- func (r *Runtime) RunPath(path string, args []string) error
- func (r *Runtime) SaveConfig(name, config string) (string, error)
- func (r *Runtime) SendSignal(s os.Signal)
- func (r *Runtime) SetStderr(fn func(io.Writer) io.Writer)
- func (r *Runtime) SetStdout(fn func(io.Writer) io.Writer)
- func (r *Runtime) Status() int
- func (r *Runtime) Wait(state int)
- func (r *Runtime) WaitWithContext(ctx context.Context, state int)
- type RuntimeOption
- type RuntimeOptions
Constants ¶
This section is empty.
Variables ¶
var SupportedModes = []string{string(LoadBalancer)}
SupportedModes indicate the modes that are current supported by GetEnvoy
Functions ¶
func NewRuntime ¶
func NewRuntime(options ...RuntimeOption) (binary.FetchRunner, error)
NewRuntime creates a new Runtime with the local file storage set to the home directory
Types ¶
type Config ¶ added in v0.1.1
type Config struct { XDSAddress string Mode Mode IPAddresses []string ALSAddresss string DrainDuration *durationpb.Duration ConnectTimeout *durationpb.Duration AdminAddress string AdminPort int32 StatNameLength int32 }
Config store Envoy config information for use by bootstrap and arg mutators
func NewConfig ¶ added in v0.1.1
NewConfig creates and mutates a config object based on passed params
func (*Config) GetAdminAddress ¶ added in v0.2.1
GetAdminAddress returns a host:port formatted address of the Envoy admin listener.
type Runtime ¶
type Runtime struct { RootDir string TmplDir string Config *Config WorkingDir string IO ioutil.StdStreams // contains filtered or unexported fields }
Runtime manages an Envoy lifecycle including fetching (if necessary) and running
func (*Runtime) AlreadyDownloaded ¶
AlreadyDownloaded returns true if there is a cached Envoy binary matching the passed Key
func (*Runtime) AppendArgs ¶ added in v0.1.1
AppendArgs appends the passed args to the child process' args
func (*Runtime) BinaryStore ¶
BinaryStore returns the location at which the runtime instance persists binaries Getters typically aren't idiomatic Go, however, this one is deliberately part of the fetcher interface
func (*Runtime) DebugStore ¶
DebugStore returns the location at which the runtime instance persists debug data for this given instance Getters typically aren't idiomatic Go, however, this one is deliberately part of the runner interface
func (*Runtime) FetchAndRun ¶ added in v0.2.1
FetchAndRun downloads an Envoy binary, if necessary, and runs it.
func (*Runtime) RegisterDone ¶
func (r *Runtime) RegisterDone()
RegisterDone informs the runtime that you have completed It is a wrapper around sync.WaitGroup.Done()
func (*Runtime) RegisterPreStart ¶
RegisterPreStart registers the passed functions to be run before Envoy has started
func (*Runtime) RegisterPreTermination ¶
RegisterPreTermination registers the passed functions to be run after Envoy has started and just before GetEnvoy instructs Envoy to terminate
func (*Runtime) RegisterWait ¶
RegisterWait informs the runtime it needs to wait for you to complete It is a wrapper around sync.WaitGroup.Add()
func (*Runtime) Run ¶
Run execs the binary defined by the key with the args passed It is a blocking function that can only be terminated via SIGINT
func (*Runtime) RunPath ¶
RunPath execs the binary at the path with the args passed It is a blocking function that can only be terminated via SIGINT
func (*Runtime) SaveConfig ¶ added in v0.2.0
SaveConfig saves configuration string in getenvoy directory.
func (*Runtime) SendSignal ¶
SendSignal sends a signal to the parent process
func (*Runtime) Wait ¶
Wait blocks until the child process reaches the state passed Note: It does not guarantee that it is in the specified state just that it has reached it
func (*Runtime) WaitWithContext ¶ added in v0.1.1
WaitWithContext blocks until the child process reaches the state passed or the context is canceled Note: It does not guarantee that it is in the specified state just that it has reached it
type RuntimeOption ¶ added in v0.2.1
type RuntimeOption func(*Runtime)
RuntimeOption represents a configuration option to NewRuntime.
func (RuntimeOption) And ¶ added in v0.2.1
func (o RuntimeOption) And(opts ...RuntimeOption) RuntimeOptions
And returns a combined list of configuration options.
func (RuntimeOption) AndAll ¶ added in v0.2.1
func (o RuntimeOption) AndAll(opts RuntimeOptions) RuntimeOptions
AndAll returns a combined list of configuration options.
type RuntimeOptions ¶ added in v0.2.1
type RuntimeOptions []RuntimeOption
RuntimeOptions represents a list of configuration options to NewRuntime.
func (RuntimeOptions) And ¶ added in v0.2.1
func (o RuntimeOptions) And(opts ...RuntimeOption) RuntimeOptions
And returns a combined list of configuration options.
func (RuntimeOptions) AndAll ¶ added in v0.2.1
func (o RuntimeOptions) AndAll(opts RuntimeOptions) RuntimeOptions
AndAll returns a combined list of configuration options.