Documentation
¶
Index ¶
- Variables
- func ParameterTerraform(param *proto.RichParameter) (string, error)
- func ProvisionGraphWithAgent(authToken string, muts ...func(g *proto.GraphComplete)) []*proto.Response
- func ProvisionGraphWithAgentAndAPIKeyScope(authToken string, apiKeyScope 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{}, }, }} // InitComplete is a helper to indicate an empty init completion. InitComplete = []*proto.Response{{ Type: &proto.Response_Init{ Init: &proto.InitComplete{ ModuleFiles: []byte{}, }, }, }} // 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{}, }, }} GraphComplete = []*proto.Response{{ Type: &proto.Response_Graph{ Graph: &proto.GraphComplete{}, }, }} InitFailed = []*proto.Response{{ Type: &proto.Response_Init{ Init: &proto.InitComplete{ Error: "failed!", }, }, }} // 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!", }, }, }} GraphFailed = []*proto.Response{{ Type: &proto.Response_Graph{ Graph: &proto.GraphComplete{ Error: "failed!", }, }, }} )
Functions ¶
func ParameterTerraform ¶ added in v2.25.0
func ParameterTerraform(param *proto.RichParameter) (string, error)
ParameterTerraform will create a Terraform data block for the provided parameter.
func ProvisionGraphWithAgent ¶ added in v2.30.0
func ProvisionGraphWithAgent(authToken string, muts ...func(g *proto.GraphComplete)) []*proto.Response
ProvisionGraphWithAgent returns provision responses that will mock a fake "aws_instance" resource with an agent that has the given auth token.
func ProvisionGraphWithAgentAndAPIKeyScope ¶ added in v2.30.0
ProvisionGraphWithAgentAndAPIKeyScope 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
// Used to mock ALL responses regardless of transition.
ProvisionInit []*proto.Response
ProvisionPlan []*proto.Response
ProvisionApply []*proto.Response
ProvisionGraph []*proto.Response
// Used to mock specific transition responses. They are prioritized over the generic responses.
ProvisionPlanMap map[proto.WorkspaceTransition][]*proto.Response
ProvisionApplyMap map[proto.WorkspaceTransition][]*proto.Response
ProvisionGraphMap map[proto.WorkspaceTransition][]*proto.Response
ExtraFiles map[string][]byte
}
Responses is a collection of mocked responses to Provision operations.
func WithExtraFiles ¶ added in v2.22.0
func WithResources ¶ added in v2.1.4
Click to show internal directories.
Click to hide internal directories.