typeset

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElemField

type ElemField interface {
	Normalizer

	// Schema returns the schema for the element field.
	Schema() *schema.Schema
}

ElemField defines a set element field. ElemField must always implement Normalizer to ensure that each set element hash is stable.

func NotNormalized

func NotNormalized(s *schema.Schema) ElemField

NotNormalized returns an ElemField for a element field schema which already encodes stable values and thus does need to implement Normalizer.

Note that any field which implements a DiffSuppressFunc will be rejected if it is declared as NotNormalized.

type Normalizer

type Normalizer interface {
	Normalize(v any) any
}

Normalizer takes a value and converts it to a stable representation.

type Set

type Set struct {
	Required bool
	MinItems int

	// ElemFields defines the element field schema, where the keys are the name
	// of the element fields and the values are the schemas for said field.
	ElemFields map[string]ElemField
}

Set defines the parameters of a TypeSet field in a Terraform schema. Set must be used to build any TypeSet schemas which contains complex objects to ensure that diff-ing is implemented correctly (TL;DR TypeSet has tons of bugs and requires very specific configuration).

func (Set) Schema

func (s Set) Schema() *schema.Schema

Schema returns the Terraform schema of the Set.

Jump to

Keyboard shortcuts

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