Documentation ¶
Index ¶
- func GatherDatasources[F func(Schema) shim.SchemaMap](ctx context.Context, prov provider.Provider, f F) (runtypes.DataSources, error)
- func GatherResources[F func(Schema) shim.SchemaMap](ctx context.Context, prov provider.Provider, f F) (runtypes.Resources, error)
- func NewRawState(t tftypes.Type, v tftypes.Value) (*tfprotov6.RawState, error)
- func ProposedNew(ctx context.Context, schema runtypes.Schema, priorState, config tftypes.Value) (tftypes.Value, error)
- func ValueToJSON(typ tftypes.Type, v tftypes.Value) ([]byte, error)
- type Attr
- type AttrLike
- type Block
- type BlockLike
- type BlockNestingMode
- type Eq
- type LookupResult
- type NestingMode
- type Schema
- type SchemaType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatherDatasources ¶
func GatherResources ¶
func GatherResources[F func(Schema) shim.SchemaMap]( ctx context.Context, prov provider.Provider, f F, ) (runtypes.Resources, error)
Collects all resources from prov and indexes them by TypeName.
Types ¶
type Attr ¶
type Attr interface { AttrLike IsNested() bool Nested() map[string]Attr NestingMode() NestingMode HasNestedObject() bool }
Attr type works around not being able to link to fwschema.Attribute from "github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
Most methods from fwschema.Attribute have simple signatures and are copied into attrLike interface. Casting to attrLike exposes these methods.
GetAttributes method is special since it returns a NestedAttributes interface that is also internal and cannot be linked to. Instead, NestedAttriutes information is recorded in a dedicated new field.
func FromAttrLike ¶
func FromDataSourceAttribute ¶
func FromProviderAttribute ¶
func FromResourceAttribute ¶
type Block ¶
type Block interface { BlockLike NestedAttrs() map[string]Attr NestedBlocks() map[string]Block GetMaxItems() int64 GetMinItems() int64 HasNestedObject() bool }
Block type works around not being able to link to fwschema.Block from "github.com/hashicorp/terraform-plugin-framework/internal/fwschema".
func FromBlockLike ¶
func FromDataSourceBlock ¶
func FromProviderBlock ¶
func FromResourceBlock ¶
type BlockNestingMode ¶
type BlockNestingMode uint8
const ( BlockNestingModeUnknown BlockNestingMode = 0 BlockNestingModeList BlockNestingMode = 1 BlockNestingModeSet BlockNestingMode = 2 BlockNestingModeSingle BlockNestingMode = 3 )
type Eq ¶
var DefaultEq Eq = defaultEq(0)
Default equality for tftype.Value.
func NonComputedEq ¶
func NonComputedEq(schema tftypes.AttributePathStepper) Eq
Considers two tftype.Value values equal if all their non-computed attributes are equal.
type LookupResult ¶
type LookupResult struct { IsAttr bool IsBlock bool IsNestedObject bool IsMisc bool Attr Attr Block Block }
Classifies the results of LookupTerraformPath. The only valid cases are:
1. IsAttr=true, and Attr is set; this means an Attribute was found 2. IsBlock=true, and Block is set; this means a Block was found 3. IsNestedObject=true; this means the path is a nested object one level down from Attr or Block 4. IsMisc=true; this groups all other cases, such as resolving to a simple atomic type as String
All other combinations should not be valid.
func LookupTerraformPath ¶
func LookupTerraformPath( schema tftypes.AttributePathStepper, path *tftypes.AttributePath, ) (LookupResult, error)
Drills down a Schema with a given AttributePath to classify what is found at that path, see LookupResult.
type NestingMode ¶
type NestingMode uint8
const ( NestingModeUnknown NestingMode = 0 NestingModeSingle NestingMode = 1 NestingModeList NestingMode = 2 NestingModeSet NestingMode = 3 NestingModeMap NestingMode = 4 )
type Schema ¶
type Schema interface { SchemaType Attrs() map[string]Attr Blocks() map[string]Block DeprecationMessage() string ResourceProtoSchema(ctx context.Context) (*tfprotov6.Schema, error) }
Attr type works around not being able to link to fwschema.Schema from "github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
func FromDataSourceSchema ¶
func FromProviderSchema ¶
func FromResourceSchema ¶
type SchemaType ¶
type SchemaType interface { tftypes.AttributePathStepper Type(context.Context) tftypes.Type // Resource schemas are versioned for [State Upgrade]. // // [State Upgrade]: https://developer.hashicorp.com/terraform/plugin/framework/resources/state-upgrade ResourceSchemaVersion() int64 }