Documentation
¶
Overview ¶
Package tfsdk contains core framework functionality for schema data.
Index ¶
- func ConvertValue(ctx context.Context, val attr.Value, typ attr.Type) (attr.Value, diag.Diagnostics)
- func ValueAs(ctx context.Context, val attr.Value, target interface{}) diag.Diagnostics
- func ValueFrom(ctx context.Context, val interface{}, targetType attr.Type, target interface{}) diag.Diagnostics
- type Config
- type Plan
- func (p Plan) Get(ctx context.Context, target interface{}) diag.Diagnostics
- func (p Plan) GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics
- func (p Plan) PathMatches(ctx context.Context, pathExpr path.Expression) (path.Paths, diag.Diagnostics)
- func (p *Plan) Set(ctx context.Context, val interface{}) diag.Diagnostics
- func (p *Plan) SetAttribute(ctx context.Context, path path.Path, val interface{}) diag.Diagnostics
- type State
- func (s State) Get(ctx context.Context, target interface{}) diag.Diagnostics
- func (s State) GetAttribute(ctx context.Context, path path.Path, target interface{}) diag.Diagnostics
- func (s State) PathMatches(ctx context.Context, pathExpr path.Expression) (path.Paths, diag.Diagnostics)
- func (s *State) RemoveResource(ctx context.Context)
- func (s *State) Set(ctx context.Context, val interface{}) diag.Diagnostics
- func (s *State) SetAttribute(ctx context.Context, path path.Path, val interface{}) diag.Diagnostics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertValue ¶ added in v0.4.0
func ConvertValue(ctx context.Context, val attr.Value, typ attr.Type) (attr.Value, diag.Diagnostics)
ConvertValue creates a new attr.Value of the attr.Type `typ`, using the data in `val`, which can be of any attr.Type so long as its TerraformType method returns a tftypes.Type that `typ`'s ValueFromTerraform method can accept.
func ValueAs ¶ added in v0.3.0
ValueAs takes the attr.Value `val` and populates the Go value `target` with its content.
This is achieved using reflection rules provided by the internal/reflect package.
func ValueFrom ¶ added in v0.9.0
func ValueFrom(ctx context.Context, val interface{}, targetType attr.Type, target interface{}) diag.Diagnostics
ValueFrom takes the Go value `val` and populates `target` with an attr.Value, based on the type definition provided in `targetType`.
This is achieved using reflection rules provided by the internal/reflect package.