Documentation
¶
Index ¶
- Variables
- func ProvisionApplyWithAgent(authToken string) []*proto.Response
- func Serve(ctx context.Context, options *provisionersdk.ServeOptions) error
- func Tar(responses *Responses) ([]byte, error)
- func TarWithOptions(ctx context.Context, logger slog.Logger, responses *Responses) ([]byte, error)
- type Responses
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ParseComplete is a helper to indicate an empty parse completion. ParseComplete = []*proto.Response{{ Type: &proto.Response_Parse{ Parse: &proto.ParseComplete{}, }, }} // PlanComplete is a helper to indicate an empty provision completion. PlanComplete = []*proto.Response{{ Type: &proto.Response_Plan{ Plan: &proto.PlanComplete{ Plan: []byte("{}"), }, }, }} // ApplyComplete is a helper to indicate an empty provision completion. ApplyComplete = []*proto.Response{{ Type: &proto.Response_Apply{ Apply: &proto.ApplyComplete{}, }, }} // PlanFailed is a helper to convey a failed plan operation PlanFailed = []*proto.Response{{ Type: &proto.Response_Plan{ Plan: &proto.PlanComplete{ Error: "failed!", }, }, }} // ApplyFailed is a helper to convey a failed apply operation ApplyFailed = []*proto.Response{{ Type: &proto.Response_Apply{ Apply: &proto.ApplyComplete{ Error: "failed!", }, }, }} )
Functions ¶
func ProvisionApplyWithAgent ¶
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, options *provisionersdk.ServeOptions) error
Serve starts the echo provisioner.
Types ¶
type Responses ¶
type Responses struct { Parse []*proto.Response // ProvisionApply and ProvisionPlan are used to mock ALL responses of // Apply and Plan, regardless of transition. ProvisionApply []*proto.Response ProvisionPlan []*proto.Response // ProvisionApplyMap and ProvisionPlanMap are used to mock specific // transition responses. They are prioritized over the generic responses. ProvisionApplyMap map[proto.WorkspaceTransition][]*proto.Response ProvisionPlanMap map[proto.WorkspaceTransition][]*proto.Response }
Responses is a collection of mocked responses to Provision operations.
func WithResources ¶ added in v2.1.4
Click to show internal directories.
Click to hide internal directories.