echo

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ParseComplete is a helper to indicate an empty parse completion.
	ParseComplete = []*proto.Parse_Response{{
		Type: &proto.Parse_Response_Complete{
			Complete: &proto.Parse_Complete{},
		},
	}}
	// ProvisionComplete is a helper to indicate an empty provision completion.
	ProvisionComplete = []*proto.Provision_Response{{
		Type: &proto.Provision_Response_Complete{
			Complete: &proto.Provision_Complete{},
		},
	}}

	// ProvisionFailed is a helper to convey a failed provision
	// operation.
	ProvisionFailed = []*proto.Provision_Response{{
		Type: &proto.Provision_Response_Complete{
			Complete: &proto.Provision_Complete{
				Error: "failed!",
			},
		},
	}}
)

Functions

func ProvisionApplyWithAgent

func ProvisionApplyWithAgent(authToken string) []*proto.Provision_Response

ProvisionApplyWithAgent returns provision responses that will mock a fake "aws_instance" resource with an agent that has the given auth token.

func Serve

func Serve(ctx context.Context, filesystem afero.Fs, options *provisionersdk.ServeOptions) error

Serve starts the echo provisioner.

func Tar

func Tar(responses *Responses) ([]byte, error)

Tar returns a tar archive of responses to provisioner operations.

Types

type Responses

type Responses struct {
	Parse []*proto.Parse_Response

	// ProvisionApply and ProvisionPlan are used to mock ALL responses of
	// Apply and Plan, regardless of transition.
	ProvisionApply []*proto.Provision_Response
	ProvisionPlan  []*proto.Provision_Response

	// ProvisionApplyMap and ProvisionPlanMap are used to mock specific
	// transition responses. They are prioritized over the generic responses.
	ProvisionApplyMap map[proto.WorkspaceTransition][]*proto.Provision_Response
	ProvisionPlanMap  map[proto.WorkspaceTransition][]*proto.Provision_Response
}

Responses is a collection of mocked responses to Provision operations.

Jump to

Keyboard shortcuts

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