A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework@v1.15.1/internal/fwschema below:

fwschema package - github.com/hashicorp/terraform-plugin-framework/internal/fwschema - Go Packages

Package fwschema implements shared logic for describing the structure, data types, and behaviors of framework data for data sources, providers, and resources.

Refer to the internal/fwschemadata package for logic built on values based on this schema information.

This section is empty.

View Source
var (
	
	
	
	
	ErrPathInsideAtomicAttribute = errors.New("path leads to element, attribute, or block of a schema.Attribute that has no schema associated with it")

	
	
	ErrPathIsBlock = errors.New("path leads to block, not an attribute")

	
	
	ErrPathInsideDynamicAttribute = errors.New("path leads to element or attribute nested in a schema.DynamicAttribute")
)

NumericPrefixRegex is a regular expression which matches whether a string begins with a numeric (0-9).

ReservedProviderAttributeNames contains the list of root attribute names which should not be included in provider-defined provider schemas since they require practitioners to implement special syntax in their configurations to be usable by the provider.

View Source
var ReservedResourceAttributeNames = []string{

	"connection",

	"count",

	"depends_on",

	"for_each",

	"lifecycle",

	"provider",

	"provisioner",
}

ReservedResourceAttributeNames contains the list of root attribute names which should not be included in provider-defined managed resource and data source schemas since they require practitioners to implement special syntax in their configurations to be usable by the provider resource.

ValidAttributeNameRegex contains the regular expression to validate attribute names, which are considered identifiers in the Terraform configuration language.

Hyphen characters (-) are technically valid in identifiers, however they are explicitly not validated due to the provider ecosystem conventionally never including them in attribute names. Introducing them could cause practitioner confusion.

AttributeInvalidElementTypeDiag returns an error diagnostic to provider developers about using non-primitive types in their Attribute implementation. This is not allowed.

AttributesEqual is a helper function to perform equality testing on two Attribute. Attribute Equal implementations should still compare the concrete types in addition to using this helper.

func BlockContainsAnyWriteOnlyChildAttributes(block Block) bool

BlockContainsAnyWriteOnlyChildAttributes will return true if any child attribute for the given nested block has WriteOnly set to true.

BlockPathExpressions recursively returns a slice of the current path expression and all underlying path expressions which represent a Block.

BlocksEqual is a helper function to perform equality testing on two Block. Attribute Equal implementations should still compare the concrete types in addition to using this helper.

ContainsAllWriteOnlyChildAttributes will return true if all child attributes for the given nested attribute have WriteOnly set to true.

ContainsAnyWriteOnlyChildAttributes will return true if any child attribute for the given nested attribute has WriteOnly set to true.

IsReservedProviderAttributeName returns an error diagnostic if the given attribute path represents a root attribute name in ReservedProviderAttributeNames. Other paths are automatically skipped without error.

IsReservedResourceAttributeName returns an error diagnostic if the given attribute path represents a root attribute name in ReservedResourceAttributeNames. Other paths are automatically skipped without error.

IsValidAttributeName returns an error diagnostic if the given attribute path has an invalid attribute name according to ValidAttributeNameRegex. Non-AttributeName paths are automatically skipped without error.

NestedAttributeObjectApplyTerraform5AttributePathStep is a helper function to perform base tftypes.AttributePathStepper handling using the GetAttributes method. NestedAttributeObject implementations should still include custom type functionality in addition to using this helper.

NestedAttributeObjectEqual is a helper function to perform base equality testing on two NestedAttributeObject. NestedAttributeObject implementations should still compare the concrete types and other custom functionality in addition to using this helper.

NestedAttributeObjectType is a helper function to perform base type handling using the GetAttributes and GetBlocks methods. NestedAttributeObject implementations should still include custom type functionality in addition to using this helper.

NestedAttributesEqual is a helper function to perform equality testing on two NestedAttribute. NestedAttribute Equal implementations should still compare the concrete types in addition to using this helper.

NestedBlockObjectApplyTerraform5AttributePathStep is a helper function to perform base tftypes.AttributePathStepper handling using the GetAttributes and GetBlocks methods. NestedBlockObject implementations should still include custom type functionality in addition to using this helper.

NestedBlockObjectEqual is a helper function to perform base equality testing on two NestedBlockObject. NestedBlockObject implementations should still compare the concrete types and other custom functionality in addition to using this helper.

NestedBlockObjectType is a helper function to perform base type handling using the GetAttributes and GetBlocks methods. NestedBlockObject implementations should still include custom type functionality in addition to using this helper.

SchemaApplyTerraform5AttributePathStep is a helper function to perform base tftypes.AttributePathStepper handling using the GetAttributes and GetBlocks methods.

SchemaBlockPathExpressions returns a slice of all path expressions which represent a Block according to the Schema.

SchemaType is a helper function to perform base type handling using the GetAttributes and GetBlocks methods.

SchemaTypeAtPath is a helper function to perform base type handling using the TypeAtTerraformPath method.

SchemaTypeAtTerraformPath is a helper function to perform base type handling using the tftypes.AttributePathStepper interface.

ValidateImplementation contains the generic Attribute implementation validation logic for all types.

This logic currently:

ValidateBlockImplementation contains the generic Block implementation validation logic for all types.

This logic currently:

Attribute is the core interface required for implementing Terraform schema functionality that can accept a value. Refer to NestedAttribute for the additional interface that defines nested attributes.

Refer to the internal/fwschema/fwxschema package for optional interfaces that define framework-specific functionality, such a plan modification and validation.

SchemaAttributeAtPath is a helper function to perform base type handling using the AttributeAtTerraformPath method.

SchemaAttributeAtTerraformPath is a helper function to perform base type handling using the tftypes.AttributePathStepper interface.

AttributeWithBoolDefaultValue is an optional interface on Attribute which enables Bool default value support.

AttributeWithDynamicDefaultValue is an optional interface on Attribute which enables Dynamic default value support.

AttributeWithFloat32DefaultValue is an optional interface on Attribute which enables Float32 default value support.

AttributeWithFloat64DefaultValue is an optional interface on Attribute which enables Float64 default value support.

AttributeWithInt32DefaultValue is an optional interface on Attribute which enables Int32 default value support.

AttributeWithInt64DefaultValue is an optional interface on Attribute which enables Int64 default value support.

AttributeWithListDefaultValue is an optional interface on Attribute which enables List default value support.

AttributeWithMapDefaultValue is an optional interface on Attribute which enables Map default value support.

AttributeWithNumberDefaultValue is an optional interface on Attribute which enables Number default value support.

AttributeWithObjectDefaultValue is an optional interface on Attribute which enables Object default value support.

AttributeWithSetDefaultValue is an optional interface on Attribute which enables Set default value support.

AttributeWithStringDefaultValue is an optional interface on Attribute which enables String default value support.

AttributeWithValidateImplementation is an optional interface on Attribute which enables validation of the provider-defined implementation for the Attribute. This logic runs during Validate* RPCs, or via provider-defined unit testing, to ensure the provider's definition is valid before further usage could cause other unexpected errors or panics.

Block is the core interface required for implementing Terraform schema functionality that structurally holds attributes and blocks. This is intended to be the first abstraction of tfsdk.Block functionality into data source, provider, and resource specific functionality.

Refer to the internal/fwschema/fwxschema package for optional interfaces that define framework-specific functionality, such a plan modification and validation.

Note that MaxItems and MinItems support, while defined in the Terraform protocol, is intentially not present. Terraform can only perform limited static analysis of blocks and errors generated occur before the provider is called for configuration validation, which means that practitioners do not get all configuration errors at the same time. Provider developers can implement validators to achieve the same validation functionality.

type BlockNestingMode uint8

BlockNestingMode is an enum type of the ways attributes and blocks can be nested in a block. They can be a list or a set.

While the protocol and theoretically Terraform itself support map and group nesting modes, this framework intentionally only supports list, set, and single blocks as those other modes were not typically implemented or tested with Terraform since the older Terraform Plugin SDK did not support them.

BlockWithValidateImplementation is an optional interface on Block which enables validation of the provider-defined implementation for the Block. This logic runs during Validate* RPCs, or via provider-defined unit testing, to ensure the provider's definition is valid before further usage could cause other unexpected errors or panics.

NestedAttribute defines a schema attribute that contains nested attributes.

NestedAttributeObject represents the Object inside a NestedAttribute. Refer to the fwxschema package for validation and plan modification extensions to this interface.

NestedBlockObject represents the Object inside a Block. Refer to the fwxschema package for validation and plan modification extensions to this interface.

NestingMode is an enum type of the ways nested attributes can be nested in an attribute. They can be a list, a set, a map (with string keys), or they can be nested directly, like an object.

Schema is the core interface required for data sources, providers, and resources.

UnderlyingAttributes represents attributes under a nested attribute.

ApplyTerraform5AttributePathStep performs an AttributeName step on the underlying attributes or returns an error.

Equal returns true if all underlying attributes are equal.

Type returns the framework type of the underlying attributes.

type ValidateImplementationRequest struct {
	
	Name string

	
	
	
	
	
	
	Path path.Path
}

ValidateImplementationRequest contains the information available during a ValidateImplementation call to validate the Attribute definition. ValidateImplementationResponse is the type used for responses.

type ValidateImplementationResponse struct {
	
	
	
	Diagnostics diag.Diagnostics
}

ValidateImplementationResponse contains the returned data from a ValidateImplementation method call to validate the Attribute implementation. ValidateImplementationRequest is the type used for requests.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4