Documentation
¶
Index ¶
- Constants
- func NewReadyChecker(adminHost string, listeners ...*Listener) *readyChecker
- type ChecksumDownloader
- type ExitInfo
- type FatalError
- type GitHubRelease
- type LatestCachedRelease
- type Listener
- type Option
- func WithAdminHost(host string) Option
- func WithArgs(args ...string) Option
- func WithBootstrapConfigYAML(yaml string) Option
- func WithCluster(cluster string) Option
- func WithDrainTimeout(timeout *time.Duration) Option
- func WithGoPluginDir(dir string) Option
- func WithLogsCollector(c logs.LogsCollector) Option
- func WithLogsDir(dir string) Option
- func WithMinDrainTime(timeout *time.Duration) Option
- func WithNodeMetadata(metadata *xdstypes.NodeMetadata) Option
- func WithOtelCollector(c *otel.Collector) Option
- func WithRelease(release ReleaseDownloader) Option
- type ReleaseDownloader
- type Runtime
- type RuntimeStatus
- type URLRelease
Constants ¶
const ( // DefaultVersion is the Envoy release that backplane images bake in and // that the runtime downloads. The Envoy version must not float, because a // new minor release can break the Go filter. Bump it only after a soak // test of the new release. DefaultVersion = "v1.35.13" )
Variables ¶
This section is empty.
Functions ¶
func NewReadyChecker ¶
NewReadyChecker creates a new readyChecker.
Types ¶
type ChecksumDownloader ¶ added in v0.23.0
type ChecksumDownloader interface {
// DownloadChecksum returns the published SHA-256 digest of the binary in
// lowercase hex. It returns an empty digest when no checksum is published.
DownloadChecksum(ctx context.Context) (string, error)
}
ChecksumDownloader is implemented by releases that can publish a ".sha256" sidecar next to the binary.
type ExitInfo ¶ added in v0.23.0
type ExitInfo struct {
// At is the time the exit was recorded.
At time.Time
// ProcState is the state of the exited process. It is nil if the process
// never started.
ProcState *os.ProcessState
// Err is the error returned by the wait on the process, if any.
Err error
}
ExitInfo records the last exit of the Envoy process.
type FatalError ¶
type FatalError struct {
Err error
}
FatalError is an error that should cause the runtime to exit.
type GitHubRelease ¶
GitHubRelease represents a release from GitHub.
func (*GitHubRelease) DownloadBinary ¶
func (r *GitHubRelease) DownloadBinary(ctx context.Context) (io.ReadCloser, error)
func (*GitHubRelease) DownloadChecksum ¶ added in v0.23.0
func (r *GitHubRelease) DownloadChecksum(ctx context.Context) (string, error)
DownloadChecksum returns the digest published next to the release binary.
func (*GitHubRelease) String ¶
func (r *GitHubRelease) String() string
type LatestCachedRelease ¶
type LatestCachedRelease struct {
Path string
// contains filtered or unexported fields
}
func (*LatestCachedRelease) DownloadBinary ¶
func (r *LatestCachedRelease) DownloadBinary(ctx context.Context) (io.ReadCloser, error)
func (*LatestCachedRelease) String ¶
func (r *LatestCachedRelease) String() string
type Option ¶
type Option func(*Runtime)
Option configures a Runtime.
func WithAdminHost ¶
WithAdminHost sets the host for the Envoy admin interface.
func WithArgs ¶
WithArgs sets additional arguments to pass to Envoy. The arguments are appended to the default arguments.
func WithBootstrapConfigYAML ¶
WithBootstrapConfigYAML sets the Envoy bootstrap config YAML.
func WithCluster ¶
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 ¶
If this is not set, the default timeout is used (30 seconds).
func WithGoPluginDir ¶
WithGoPluginDir sets the directory to load Go plugins from.
func WithLogsCollector ¶
func WithLogsCollector(c logs.LogsCollector) Option
WithLogsCollector sets the logs collector.
func WithLogsDir ¶
WithLogsDir sets the directory where Envoy logs will be written. If this option is set, logs will be piped to files in the format envoy.<pid>.<pipe>.log in the specified directory.
func WithMinDrainTime ¶
If this is not set, the default timeout is used (30 seconds).
func WithNodeMetadata ¶
func WithNodeMetadata(metadata *xdstypes.NodeMetadata) Option
WithNodeMetadata sets the metadata for the Envoy node in XDS discovery requests. The metadata will be included in the node configuration and sent to the control plane.
func WithOtelCollector ¶
WithOtelCollector sets the OpenTelemetry 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 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.
type RuntimeStatus ¶
type RuntimeStatus struct {
StartedAt time.Time
Starting bool
Running bool
ProcState *os.ProcessState
// LastExit is the last recorded exit of the Envoy process. It is nil until
// the process exits for the first time.
LastExit *ExitInfo
// Restarts counts how many times the runtime started Envoy again after an
// exit.
Restarts int
}
type URLRelease ¶
type URLRelease struct {
URL string
}
func (*URLRelease) DownloadBinary ¶
func (r *URLRelease) DownloadBinary(ctx context.Context) (io.ReadCloser, error)
func (*URLRelease) DownloadChecksum ¶ added in v0.23.0
func (r *URLRelease) DownloadChecksum(ctx context.Context) (string, error)
DownloadChecksum returns the digest published next to the release binary.
func (*URLRelease) String ¶
func (r *URLRelease) String() string