toproto5

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package toproto5 contains functions to convert from framework types to protocol version 5 (tfprotov5) types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyResourceChangeResponse

ApplyResourceChangeResponse returns the *tfprotov5.ApplyResourceChangeResponse equivalent of a *fwserver.ApplyResourceChangeResponse.

func Block

Block returns the *tfprotov5.SchemaNestedBlock equivalent of a Block. Errors will be tftypes.AttributePathErrors based on `path`. `name` is the name of the attribute.

func CallFunctionResponse added in v1.5.0

CallFunctionResponse returns the *tfprotov5.CallFunctionResponse equivalent of a *fwserver.CallFunctionResponse.

func Config

Config returns the *tfprotov5.DynamicValue for a *tfsdk.Config.

func ConfigureProviderResponse

func ConfigureProviderResponse(ctx context.Context, fw *provider.ConfigureResponse) *tfprotov5.ConfigureProviderResponse

ConfigureProviderResponse returns the *tfprotov5.ConfigureProviderResponse equivalent of a *fwserver.ConfigureProviderResponse.

func DataSourceMetadata added in v1.4.0

DataSourceMetadata returns the tfprotov5.DataSourceMetadata for a fwserver.DataSourceMetadata.

func DiagnosticSeverity

func DiagnosticSeverity(s diag.Severity) tfprotov5.DiagnosticSeverity

DiagnosticSeverity converts diag.Severity into tfprotov5.DiagnosticSeverity.

func Diagnostics

func Diagnostics(ctx context.Context, diagnostics diag.Diagnostics) []*tfprotov5.Diagnostic

Diagnostics converts the diagnostics into the tfprotov5 collection type.

func DynamicValue added in v1.1.0

DynamicValue returns the *tfprotov5.DynamicValue for a given fwschemadata.Data.

If necessary, the underlying data is modified to convert list and set block values from a null collection to an empty collection. This is to prevent developers from needing to understand Terraform's differences between block and attribute values where blocks are technically never null, but from a developer perspective this distinction introduces unnecessary complexity.

func Function added in v1.5.0

Function returns the *tfprotov5.Function for a function.Definition.

func FunctionError added in v1.6.0

func FunctionError(ctx context.Context, funcErr *function.FuncError) *tfprotov5.FunctionError

FunctionError converts the function error into the tfprotov5 function error.

func FunctionMetadata added in v1.5.0

FunctionMetadata returns the tfprotov5.FunctionMetadata for a fwserver.FunctionMetadata.

func FunctionParameter added in v1.5.0

func FunctionParameter(ctx context.Context, fw function.Parameter) *tfprotov5.FunctionParameter

FunctionParameter returns the *tfprotov5.FunctionParameter for a function.Parameter.

func FunctionResultData added in v1.5.0

func FunctionResultData(ctx context.Context, data function.ResultData) (*tfprotov5.DynamicValue, *function.FuncError)

FunctionResultData returns the *tfprotov5.DynamicValue for a given function.ResultData.

func FunctionReturn added in v1.5.0

func FunctionReturn(ctx context.Context, fw function.Return) *tfprotov5.FunctionReturn

FunctionReturn returns the *tfprotov5.FunctionReturn for a function.Return.

func GetFunctionsResponse added in v1.5.0

GetFunctionsResponse returns the *tfprotov5.GetFunctionsResponse equivalent of a *fwserver.GetFunctionsResponse.

func GetMetadataResponse added in v1.4.0

GetMetadataResponse returns the *tfprotov5.GetMetadataResponse equivalent of a *fwserver.GetMetadataResponse.

func GetProviderSchemaResponse

GetProviderSchemaResponse returns the *tfprotov5.GetProviderSchemaResponse equivalent of a *fwserver.GetProviderSchemaResponse.

func ImportResourceStateResponse

ImportResourceStateResponse returns the *tfprotov5.ImportResourceStateResponse equivalent of a *fwserver.ImportResourceStateResponse.

func ImportedResource

ImportedResource returns the *tfprotov5.ImportedResource equivalent of a *fwserver.ImportedResource.

func MoveResourceStateResponse added in v1.6.0

MoveResourceStateResponse returns the *tfprotov5.MoveResourceStateResponse equivalent of a *fwserver.MoveResourceStateResponse.

func PlanResourceChangeResponse

PlanResourceChangeResponse returns the *tfprotov5.PlanResourceChangeResponse equivalent of a *fwserver.PlanResourceChangeResponse.

func PrepareProviderConfigResponse

PrepareProviderConfigResponse returns the *tfprotov5.PrepareProviderConfigResponse equivalent of a *fwserver.ValidateProviderConfigResponse.

func ReadDataSourceResponse

ReadDataSourceResponse returns the *tfprotov5.ReadDataSourceResponse equivalent of a *fwserver.ReadDataSourceResponse.

func ReadResourceResponse

ReadResourceResponse returns the *tfprotov5.ReadResourceResponse equivalent of a *fwserver.ReadResourceResponse.

func ResourceMetadata added in v1.4.0

ResourceMetadata returns the tfprotov5.ResourceMetadata for a fwserver.ResourceMetadata.

func Schema

func Schema(ctx context.Context, s fwschema.Schema) (*tfprotov5.Schema, error)

Schema returns the *tfprotov5.Schema equivalent of a Schema.

func SchemaAttribute

SchemaAttribute returns the *tfprotov5.SchemaAttribute equivalent of an Attribute. Errors will be tftypes.AttributePathErrors based on `path`. `name` is the name of the attribute.

func ServerCapabilities added in v0.10.0

ServerCapabilities returns the *tfprotov5.ServerCapabilities for a *fwserver.ServerCapabilities.

func State

State returns the *tfprotov5.DynamicValue for a *tfsdk.State.

func UpgradeResourceStateResponse

UpgradeResourceStateResponse returns the *tfprotov5.UpgradeResourceStateResponse equivalent of a *fwserver.UpgradeResourceStateResponse.

func ValidateDataSourceConfigResponse

ValidateDataSourceConfigResponse returns the *tfprotov5.ValidateDataSourceConfigResponse equivalent of a *fwserver.ValidateDataSourceConfigResponse.

func ValidateResourceTypeConfigResponse

ValidateResourceTypeConfigResponse returns the *tfprotov5.ValidateResourceTypeConfigResponse equivalent of a *fwserver.ValidateResourceConfigResponse.

Types

This section is empty.

Jump to

Keyboard shortcuts

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