ceb

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 46 Imported by: 0

Documentation

Overview

Package ceb contains the core logic for the custom entrypoint binary ("ceb").

The CEB does not work on Windows.

Index

Constants

View Source
const (
	DefaultPort = 5000
)

Variables

View Source
var ErrURLSetup = errors.New("error configuring url service")

Functions

func Run

func Run(ctx context.Context, os ...Option) error

Run runs a CEB with the given options.

This will run until the context is cancelled. If the context is cancelled, we will attempt to gracefully exit the underlying program and attempt to clean up all resources.

Types

type CEB

type CEB struct {
	// contains filtered or unexported fields
}

CEB represents the state of a running CEB.

func (*CEB) Close

func (ceb *CEB) Close() error

Close cleans up any resources created by the CEB and should be called to gracefully exit.

func (*CEB) DeploymentId

func (ceb *CEB) DeploymentId() string

DeploymentId returns the deployment ID that this CEB represents.

type Option

type Option func(*CEB, *config) error

func WithClient

func WithClient(client pb.WaypointClient) Option

WithClient specifies the Waypoint client to use directly. This will override any env vars or any other form of client connection configuration.

func WithEnvDefaults

func WithEnvDefaults() Option

WithEnvDefaults sets the configuration based on well-known accepted environment variables. If this is NOT called, then the environment variable based confiugration will be ignored.

func WithExec

func WithExec(args []string) Option

WithExec sets the binary and arguments for the child process that the ceb execs. If the first value is not absolute then we'll look for it on the PATH.

type TestCEBData

type TestCEBData struct {
	CEB     *CEB
	Horizon hzntest.DevSetup
}

func TestCEB

func TestCEB(t testing.T, opts ...Option) *TestCEBData

TestCEB runs a CEB for test purposes. This will start an in-memory server automatically if connection information is not configured.

Directories

Path Synopsis
Package execwriter contains helpers for writing "waypoint exec" streams via an io.Writer.
Package execwriter contains helpers for writing "waypoint exec" streams via an io.Writer.
Package ssh contains the login for the custom entrypoint binary to run an SSH server.
Package ssh contains the login for the custom entrypoint binary to run an SSH server.
Package virtualceb is used to provide "virtual" CEB functionality.
Package virtualceb is used to provide "virtual" CEB functionality.

Jump to

Keyboard shortcuts

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