schemafunc

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyUnknowns added in v1.26.1

func CopyUnknowns(ctx context.Context, src, dest any, keepUnknown []string, keepUnknownCall KeepUnknownFunc)

CopyUnknowns use reflection to copy unknown fields from src to dest. The implementation is similar to internal/common/conversion/model_generation.go#CopyModel keepUnknown is a list of fields that should not be copied, should always use the TF config name (snake_case) nestedStructMapping is a map of field names to their type: object, list. (`set` not implemented yet)

func EqualJSON

func EqualJSON(old, newStr, errContext string) bool

func HasUnknowns added in v1.26.1

func HasUnknowns(obj any) bool

HasUnknowns uses reflection to check if the object has any unknown fields Pass &TFModel{} Will only check the root level attributes

Types

type AttributeChanges added in v1.28.0

type AttributeChanges []string

func NewAttributeChanges added in v1.29.0

func NewAttributeChanges(ctx context.Context, src, dest any) AttributeChanges

NewAttributeChanges iterates through TFModel of state+plan and returns AttributeChanges for querying changed attributes. The implementation is similar to KeepUnknown, it doesn't support types.Set or types.Tuple yet.

func (AttributeChanges) AttributeChanged added in v1.28.0

func (a AttributeChanges) AttributeChanged(name string) bool

func (AttributeChanges) KeepUnknown added in v1.28.0

func (a AttributeChanges) KeepUnknown(attributeEffectedMapping map[string][]string) []string

func (AttributeChanges) LeafChanges added in v1.28.0

func (a AttributeChanges) LeafChanges() map[string]bool

func (AttributeChanges) ListIndexChanged added in v1.28.0

func (a AttributeChanges) ListIndexChanged(name string, index int) bool

ListIndexChanged returns true if the list at the given index has changed, false if it was added or removed

func (AttributeChanges) ListLenChanges added in v1.28.0

func (a AttributeChanges) ListLenChanges(name string) bool

func (AttributeChanges) NestedListLenChanges added in v1.28.0

func (a AttributeChanges) NestedListLenChanges(fullPath string) bool

NestedListLenChanges accepts a fullPath, e.g., "replication_specs[0].region_configs" and returns true if the length of the nested list has changed

type KeepUnknownFunc added in v1.29.0

type KeepUnknownFunc func(string, attr.Value) bool

func KeepUnknownFuncOr added in v1.29.0

func KeepUnknownFuncOr(calls ...KeepUnknownFunc) KeepUnknownFunc

type UpdateOnlyString added in v1.22.0

type UpdateOnlyString struct{}

func PlanModifyStringUpdateOnly added in v1.22.0

func PlanModifyStringUpdateOnly() UpdateOnlyString

func (UpdateOnlyString) Description added in v1.22.0

func (u UpdateOnlyString) Description(ctx context.Context) string

func (UpdateOnlyString) MarkdownDescription added in v1.22.0

func (u UpdateOnlyString) MarkdownDescription(ctx context.Context) string

func (UpdateOnlyString) PlanModifyString added in v1.22.0

Jump to

Keyboard shortcuts

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