toproto

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package toproto converts terraform-plugin-go tfprotov6 types to Protocol Buffers generated tfplugin6 types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributePaths

func AttributePaths(in []*tftypes.AttributePath) []*tfplugin6.AttributePath

func CallFunction_Response added in v0.20.0

func ConfigureProvider_Response added in v0.21.0

func CtyType

func CtyType(in tftypes.Type) []byte

func Diagnostic

func Diagnostic(in *tfprotov6.Diagnostic) *tfplugin6.Diagnostic

func Diagnostics

func Diagnostics(in []*tfprotov6.Diagnostic) []*tfplugin6.Diagnostic

func ForceValidUTF8 added in v0.21.0

func ForceValidUTF8(s string) string

ForceValidUTF8 returns a string guaranteed to be valid UTF-8 even if the input isn't, by replacing any invalid bytes with a valid UTF-8 encoding of the Unicode Replacement Character (\uFFFD).

The protobuf serialization library will reject invalid UTF-8 with an unhelpful error message:

string field contains invalid UTF-8

Passing a string result through this function makes invalid UTF-8 instead emerge as placeholder characters on the other side of the wire protocol, giving a better chance of still returning a partially-legible message instead of a generic character encoding error.

This is intended for user-facing messages such as diagnostic summary and detail messages, where Terraform will just treat the value as opaque and it's ultimately up to the user and their terminal or web browser to interpret the result. Don't use this for strings that have machine-readable meaning.

func Function added in v0.20.0

func Function(in *tfprotov6.Function) *tfplugin6.Function

func Function_Parameter added in v0.20.0

func Function_Return added in v0.20.0

func Function_Return(in *tfprotov6.FunctionReturn) *tfplugin6.Function_Return

func GetFunctions_Response added in v0.20.0

func GetMetadata_DataSourceMetadata added in v0.19.0

func GetMetadata_DataSourceMetadata(in *tfprotov6.DataSourceMetadata) *tfplugin6.GetMetadata_DataSourceMetadata

func GetMetadata_FunctionMetadata added in v0.20.0

func GetMetadata_FunctionMetadata(in *tfprotov6.FunctionMetadata) *tfplugin6.GetMetadata_FunctionMetadata

func GetMetadata_ResourceMetadata added in v0.19.0

func GetMetadata_ResourceMetadata(in *tfprotov6.ResourceMetadata) *tfplugin6.GetMetadata_ResourceMetadata

func GetMetadata_Response added in v0.19.0

func MoveResourceState_Response added in v0.21.0

func Schema

func Schema(in *tfprotov6.Schema) *tfplugin6.Schema

func ServerCapabilities added in v0.19.0

func StopProvider_Response added in v0.21.0

Types

This section is empty.

Jump to

Keyboard shortcuts

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