envoy

package
v0.3.39 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 370 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReadyChecker added in v0.3.35

func NewReadyChecker(adminHost string, listeners ...*Listener) *readyChecker

NewReadyChecker creates a new readyChecker.

Types

type FatalError

type FatalError struct {
	Err error
}

FatalError is an error that should cause the runtime to exit.

func (FatalError) Error

func (e FatalError) Error() string

Error implements the error interface.

type GitHubRelease

type GitHubRelease struct {
	Version string
	Sha     string
	Contrib bool
}

GitHubRelease represents a release from GitHub.

func (*GitHubRelease) DownloadBinary

func (r *GitHubRelease) DownloadBinary(ctx context.Context) (io.ReadCloser, error)

func (*GitHubRelease) String

func (r *GitHubRelease) String() string

type Listener added in v0.3.30

type Listener struct {
	Name    string
	Address corev3.Address
}

type Option

type Option func(*Runtime)

Option configures a Runtime.

func WithAdminHost

func WithAdminHost(host string) Option

WithAdminHost sets the host for the Envoy admin interface.

func WithArgs

func WithArgs(args ...string) Option

WithArgs sets additional arguments to pass to Envoy. The arguments are appended to the default arguments.

func WithBootstrapConfigYAML

func WithBootstrapConfigYAML(yaml string) Option

WithBootstrapConfigYAML sets the Envoy bootstrap config YAML.

func WithCluster

func WithCluster(cluster string) Option

WithCluster sets the Envoy cluster name. If this is not set, a random cluster name is used. The cluster name is used in the Envoy bootstrap config.

func WithDrainTimeout

func WithDrainTimeout(timeout *time.Duration) Option

If this is not set, the default timeout is used (30 seconds).

func WithGoPluginDir

func WithGoPluginDir(dir string) Option

WithGoPluginDir sets the directory to load Go plugins from.

func WithLogsCollector

func WithLogsCollector(c logs.LogsCollector) Option

WithLogsCollector sets the logs collector.

func WithRelease

func WithRelease(release ReleaseDownloader) Option

WithRelease sets the Envoy release to use. If this is not set, the latest release is used.

type ReleaseDownloader

type ReleaseDownloader interface {
	// String returns the release version.
	String() string

	// DownloadBinary downloads the release binary.
	DownloadBinary(ctx context.Context) (io.ReadCloser, error)
}

type Runtime

type Runtime struct {
	EnvoyPath           string
	BootstrapConfigYAML string
	Release             ReleaseDownloader
	Cluster             string
	// Args are additional arguments to pass to Envoy.
	Args []string
	// contains filtered or unexported fields
}

func (*Runtime) RuntimeStatus

func (r *Runtime) RuntimeStatus() RuntimeStatus

RuntimeStatus returns the status of the Envoy process.

func (*Runtime) Shutdown

func (r *Runtime) Shutdown(ctx context.Context) error

Shutdown gracefully drains connections and shuts down the Envoy process.

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, opts ...Option) error

Start starts the Envoy binary.

type RuntimeStatus

type RuntimeStatus struct {
	StartedAt time.Time
	Running   bool
	ProcState *os.ProcessState
}

type URLRelease

type URLRelease struct {
	URL string
}

func (*URLRelease) DownloadBinary

func (r *URLRelease) DownloadBinary(ctx context.Context) (io.ReadCloser, error)

func (*URLRelease) String

func (r *URLRelease) String() string

Jump to

Keyboard shortcuts

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