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/reflect below:

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

Package reflect contains the implementation for converting framework-defined data into and from provider-defined Go types.

This section is empty.

This section is empty.

BuildValue constructs a reflect.Value of the same type as `target`, populated with the data in `val`. It will defensively instantiate new values to set, making it safe for use with pointer types which may be nil. It tries to give consumers the ability to override its default behaviors wherever possible.

FromAttributeValue creates an attr.Value from an attr.Value. It just returns the attr.Value it is passed or an error if there is an unexpected mismatch between the attr.Type and attr.Value.

It is meant to be called through FromValue, not directly.

FromBigFloat creates an attr.Value using `typ` from a *big.Float.

It is meant to be called through FromValue, not directly.

FromBigInt creates an attr.Value using `typ` from a *big.Int.

It is meant to be called through FromValue, not directly.

FromBool returns an attr.Value as produced by `typ` from a bool.

It is meant to be called through FromValue, not directly.

FromFloat creates an attr.Value using `typ` from a float64.

It is meant to be called through FromValue, not directly.

FromInt creates an attr.Value using `typ` from an int64.

It is meant to be called through FromValue, not directly.

FromMap returns an attr.Value representing the data contained in `val`. `val` must be a map type with keys that are a string type. The attr.Value will be of the type produced by `typ`.

It is meant to be called through FromValue, not directly.

FromNullable creates an attr.Value from the data in a Nullable.

It is meant to be called through FromValue, not directly.

FromPointer turns a pointer into an attr.Value using `typ`. If the pointer is nil, the attr.Value will use its null representation. If it is not nil, it will recurse into FromValue to find the attr.Value of the type the value the pointer is referencing.

It is meant to be called through FromValue, not directly.

FromSlice returns an attr.Value as produced by `typ` using the data in `val`. `val` must be a slice. `typ` must be an attr.TypeWithElementType or attr.TypeWithElementTypes. If the slice is nil, the representation of null for `typ` will be returned. Otherwise, FromSlice will recurse into FromValue for each element in the slice, using the element type or types defined on `typ` to construct values for them.

It is meant to be called through FromValue, not directly.

FromString returns an attr.Value as produced by `typ` from a string.

It is meant to be called through FromValue, not directly.

FromStruct builds an attr.Value as produced by `typ` from the data in `val`. `val` must be a struct type, and must have all its properties tagged and be a 1:1 match with the attributes reported by `typ`. FromStruct will recurse into FromValue for each attribute, using the type of the attribute as reported by `typ`.

It is meant to be called through FromValue, not directly.

FromUint creates an attr.Value using `typ` from a uint64.

It is meant to be called through FromValue, not directly.

FromUnknownable creates an attr.Value from the data in an Unknownable.

It is meant to be called through FromValue, not directly.

FromValue is the inverse of Into, taking a Go value (`val`) and transforming it into an attr.Value using the attr.Type supplied. `val` will first be transformed into a tftypes.Value, then passed to `typ`'s ValueFromTerraform method.

FromValueCreator creates an attr.Value from the data in a tftypes.ValueCreator, calling its ToTerraform5Value method and converting the result to an attr.Value using `typ`.

It is meant to be called from FromValue, not directly.

Into uses the data in `val` to populate `target`, using the reflection package to recursively reflect into structs and slices. If `target` is an attr.Value, its assignment method will be used instead of reflecting. If `target` is a tftypes.ValueConverter, the FromTerraformValue method will be used instead of using reflection. Primitives are set using the val.As method. Structs use reflection: each exported struct field must have a "tfsdk" tag with the name of the field in the tftypes.Value, and all fields in the tftypes.Value must have a corresponding property in the struct. Into will be called for each struct field. Slices will have Into called for each element.

Map creates a map value that matches the type of `target`, and populates it with the contents of `val`.

NewAttributeValue creates a new reflect.Value by calling the ValueFromTerraform method on `typ`. It will return an error if the returned `attr.Value` is not the same type as `target`.

It is meant to be called through Into, not directly.

NewNullable creates a zero value of `target` (or the concrete type it's referencing, if it's a pointer) and calls its SetNull method.

It is meant to be called through Into, not directly.

NewUnknownable creates a zero value of `target` (or the concrete type it's referencing, if it's a pointer) and calls its SetUnknown method.

It is meant to be called through Into, not directly.

NewValueConverter creates a zero value of `target` (or the concrete type it's referencing, if it's a pointer) and calls its FromTerraform5Value method.

It is meant to be called through Into, not directly.

Number creates a *big.Float and populates it with the data in `val`. It then gets converted to the type of `target`, as long as `target` is a valid number type (any of the built-in int, uint, or float types, *big.Float, and *big.Int).

Number will loudly fail when a number cannot be losslessly represented using the requested type.

It is meant to be called through Into, not directly.

Pointer builds a new zero value of the concrete type that `target` references, populates it with BuildValue, and takes a pointer to it.

It is meant to be called through Into, not directly.

Primitive builds a string or boolean, depending on the type of `target`, and populates it with the data in `val`.

It is meant to be called through `Into`, not directly.

Struct builds a new struct using the data in `object`, as long as `object` is a `tftypes.Object`. It will take the struct type from `target`, which must be a struct type.

The properties on `target` must be tagged with a "tfsdk" label containing the field name to map to that property. Every property must be tagged, and every property must be present in the type of `object`, and all the attributes in the type of `object` must have a corresponding property. Properties that don't map to object attributes must have a `tfsdk:"-"` tag, explicitly defining them as not part of the object. This is to catch typos and other mistakes early.

Struct is meant to be called from Into, not directly.

Nullable is an interface for types that can be explicitly set to null.

type Options struct {
	
	
	
	UnhandledNullAsEmpty bool

	
	
	
	UnhandledUnknownAsEmpty bool
}

Options provides configuration settings for how the reflection behavior works, letting callers tweak different behaviors based on their needs.

Unknownable is an interface for types that can be explicitly set to known or unknown.


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