fwschemadata

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package fwschemadata implements the shared schema-based data implementation for configuration, plan, and state values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateParentTerraformValue

func CreateParentTerraformValue(_ context.Context, parentPath path.Path, parentType tftypes.Type, childValue interface{}) (tftypes.Value, diag.Diagnostics)

CreateParentTerraformValue ensures that the given parent value can have children values upserted. If the parent value is known and not null, it is returned without modification. A null Object or Tuple is converted to known with null children. An unknown Object or Tuple is converted to known with unknown children. List, Map, and Set are created with empty elements.

func UpsertChildTerraformValue

func UpsertChildTerraformValue(_ context.Context, parentPath path.Path, parentValue tftypes.Value, childStep path.PathStep, childValue tftypes.Value) (tftypes.Value, diag.Diagnostics)

UpsertChildTerraformValue will upsert a child value into a parent value. If the path step already has a value, it will be overwritten. Otherwise, the child value will be added.

Lists can only have the next element added according to the current length.

func ValueSemanticEquality added in v1.3.0

func ValueSemanticEquality(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEquality runs all semantic equality logic for a value, including recursive checking against collection and structural types.

func ValueSemanticEqualityBool added in v1.3.0

func ValueSemanticEqualityBool(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityBool performs bool type semantic equality.

func ValueSemanticEqualityFloat64 added in v1.3.0

func ValueSemanticEqualityFloat64(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityFloat64 performs float64 type semantic equality.

func ValueSemanticEqualityInt64 added in v1.3.0

func ValueSemanticEqualityInt64(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityInt64 performs int64 type semantic equality.

func ValueSemanticEqualityList added in v1.3.0

func ValueSemanticEqualityList(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityList performs list type semantic equality.

This will perform semantic equality checking on elements, regardless of whether the collection type implements the expected interface, since it cannot be assumed that the collection type implementation runs all possible element implementations.

func ValueSemanticEqualityListElements added in v1.3.0

func ValueSemanticEqualityListElements(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityListElements performs list type semantic equality on elements, returning a modified list as necessary.

func ValueSemanticEqualityMap added in v1.3.0

func ValueSemanticEqualityMap(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityMap performs map type semantic equality.

This will perform semantic equality checking on elements, regardless of whether the collection type implements the expected interface, since it cannot be assumed that the collection type implementation runs all possible element implementations.

func ValueSemanticEqualityMapElements added in v1.3.0

func ValueSemanticEqualityMapElements(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityMapElements performs list type semantic equality on elements, returning a modified list as necessary.

func ValueSemanticEqualityNumber added in v1.3.0

func ValueSemanticEqualityNumber(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityNumber performs number type semantic equality.

func ValueSemanticEqualityObject added in v1.3.0

func ValueSemanticEqualityObject(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityObject performs object type semantic equality.

This will perform semantic equality checking on attributes, regardless of whether the structural type implements the expected interface, since it cannot be assumed that the structural type implementation runs all possible attribute implementations.

func ValueSemanticEqualityObjectAttributes added in v1.3.0

func ValueSemanticEqualityObjectAttributes(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualityObjectAttributes performs object type semantic equality on attributes, returning a modified object as necessary.

func ValueSemanticEqualitySet added in v1.3.0

func ValueSemanticEqualitySet(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualitySet performs set type semantic equality.

This will perform semantic equality checking on elements, regardless of whether the collection type implements the expected interface, since it cannot be assumed that the collection type implementation runs all possible element implementations.

func ValueSemanticEqualitySetElements added in v1.3.0

func ValueSemanticEqualitySetElements(ctx context.Context, req ValueSemanticEqualityRequest, resp *ValueSemanticEqualityResponse)

ValueSemanticEqualitySetElements performs list type semantic equality on elements, returning a modified list as necessary.

func ValueSemanticEqualityString added in v1.3.0

func ValueSemanticEqualityString(ctx context.Context, req