proto6server

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package proto6server contains the provider server implementation compatible with protocol version 6 (tfprotov6.ProviderServer).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeModifyPlan

AttributeModifyPlan runs all AttributePlanModifiers

TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func AttributeValidate

AttributeValidate performs all Attribute validation.

TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func AttributeValidateNestedAttributes

func AttributeValidateNestedAttributes(ctx context.Context, a tfsdk.Attribute, req tfsdk.ValidateAttributeRequest, resp *tfsdk.ValidateAttributeResponse)

AttributeValidateNestedAttributes performs all nested Attributes validation.

TODO: Clean up this abstraction back into an internal Attribute type method. The extra Attribute parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func BlockModifyPlan

BlockModifyPlan performs all Block plan modification.

TODO: Clean up this abstraction back into an internal Block type method. The extra Block parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func BlockValidate

BlockValidate performs all Block validation.

TODO: Clean up this abstraction back into an internal Block type method. The extra Block parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func ConfigGetAttributeValue

func ConfigGetAttributeValue(ctx context.Context, c tfsdk.Config, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)

ConfigGetAttributeValue is a duplicate of tfsdk.Config.getAttributeValue, except it calls a local duplicate to Config.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.Config.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.

TODO: Clean up this abstraction back into an internal Config type method. The extra Config parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func ConfigTerraformValueAtPath

func ConfigTerraformValueAtPath(c tfsdk.Config, path *tftypes.AttributePath) (tftypes.Value, error)

ConfigTerraformValueAtPath is a duplicate of tfsdk.Config.terraformValueAtPath.

TODO: Clean up this abstraction back into an internal Config type method. The extra Config parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func PlanGetAttributeValue

func PlanGetAttributeValue(ctx context.Context, p tfsdk.Plan, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)

PlanGetAttributeValue is a duplicate of tfsdk.Plan.getAttributeValue, except it calls a local duplicate to Plan.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.Plan.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.

TODO: Clean up this abstraction back into an internal Plan type method. The extra Plan parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func PlanTerraformValueAtPath

func PlanTerraformValueAtPath(p tfsdk.Plan, path *tftypes.AttributePath) (tftypes.Value, error)

PlanTerraformValueAtPath is a duplicate of tfsdk.Plan.terraformValueAtPath.

TODO: Clean up this abstraction back into an internal Plan type method. The extra Plan parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func SchemaBlockAtPath

func SchemaBlockAtPath(s tfsdk.Schema, path *tftypes.AttributePath) (tfsdk.Block, error)

SchemaBlockAtPath returns the Block at the passed path. If the path points to an element or attribute of a complex type, rather than to a Block, it will return an ErrPathInsideAtomicAttribute error.

TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func SchemaModifyPlan

func SchemaModifyPlan(ctx context.Context, s tfsdk.Schema, req ModifySchemaPlanRequest, resp *ModifySchemaPlanResponse)

SchemaModifyPlan runs all AttributePlanModifiers in all schema attributes and blocks.

TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func SchemaValidate

func SchemaValidate(ctx context.Context, s tfsdk.Schema, req ValidateSchemaRequest, resp *ValidateSchemaResponse)

SchemaValidate performs all Attribute and Block validation.

TODO: Clean up this abstraction back into an internal Schema type method. The extra Schema parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func StateGetAttributeValue

func StateGetAttributeValue(ctx context.Context, s tfsdk.State, path *tftypes.AttributePath) (attr.Value, diag.Diagnostics)

StateGetAttributeValue is a duplicate of tfsdk.State.getAttributeValue, except it calls a local duplicate to State.terraformValueAtPath as well. It is duplicated to prevent any oddities with trying to use tfsdk.State.GetAttribute, which has some potentially undesirable logic. Refer to the tfsdk package for the large amount of testing done there.

TODO: Clean up this abstraction back into an internal State type method. The extra State parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

func StateTerraformValueAtPath

func StateTerraformValueAtPath(s tfsdk.State, path *tftypes.AttributePath) (tftypes.Value, error)

StateTerraformValueAtPath is a duplicate of tfsdk.State.terraformValueAtPath.

TODO: Clean up this abstraction back into an internal State type method. The extra State parameter is a carry-over of creating the proto6server package from the tfsdk package and not wanting to export the method. Reference: https://github.com/hashicorp/terraform-plugin-framework/issues/215

Types

type ModifySchemaPlanRequest

type ModifySchemaPlanRequest struct {
	// Config is the configuration the user supplied for the resource.
	Config tfsdk.Config

	// State is the current state of the resource.
	State tfsdk.State

	// Plan is the planned new state for the resource.
	Plan tfsdk.Plan

	// ProviderMeta is metadata from the provider_meta block of the module.
	ProviderMeta tfsdk.Config
}

ModifySchemaPlanRequest represents a request for a schema to run all attribute plan modification functions.

type ModifySchemaPlanResponse

type ModifySchemaPlanResponse struct {
	// Plan is the planned new state for the resource.
	Plan tfsdk.Plan

	// RequiresReplace is a list of tftypes.AttributePaths that require the
	// resource to be replaced. They should point to the specific field
	// that changed that requires the resource to be destroyed and
	// recreated.
	RequiresReplace []*tftypes.AttributePath

	// Diagnostics report errors or warnings related to running all attribute
	// plan modifiers. Returning an empty slice indicates a successful
	// plan modification with no warnings or errors generated.
	Diagnostics diag.Diagnostics
}

ModifySchemaPlanResponse represents a response to a ModifySchemaPlanRequest.

type Server

type Server struct {
	FrameworkServer fwserver.Server

	// Provider will be migrated to FrameworkServer over time.
	Provider tfsdk.Provider
	// contains filtered or unexported fields
}

Provider server implementation.

func (*Server) ImportResourceState

ImportResourceState satisfies the tfprotov6.ProviderServer interface.

func (*Server) ReadResource

type ValidateSchemaRequest

type ValidateSchemaRequest struct {
	// Config contains the entire configuration of the data source, provider, or resource.
	//
	// This configuration may contain unknown values if a user uses
	// interpolation or other functionality that would prevent Terraform
	// from knowing the value at request time.
	Config tfsdk.Config
}

ValidateSchemaRequest repesents a request for validating a Schema.

type ValidateSchemaResponse

type ValidateSchemaResponse struct {
	// Diagnostics report errors or warnings related to validating the schema.
	// An empty slice indicates success, with no warnings or errors generated.
	Diagnostics diag.Diagnostics
}

ValidateSchemaResponse represents a response to a ValidateSchemaRequest.

Jump to

Keyboard shortcuts

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