ceb

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MPL-2.0 Imports: 36 Imported by: 0

Documentation

Overview

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

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 {
	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.

Jump to

Keyboard shortcuts

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