toproto

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package toproto converts terraform-plugin-go tfprotov5 types to Protocol Buffers generated tfplugin5 types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributePaths

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

func CallFunction_Response added in v0.20.0

func CtyType

func CtyType(in tftypes.Type) []byte

func Deferred added in v0.23.0

func Deferred(in *tfprotov5.Deferred) *tfplugin5.Deferred

func Diagnostic

func Diagnostic(in *tfprotov5.Diagnostic) *tfplugin5.Diagnostic

func Diagnostics

func Diagnostics(in []*tfprotov5.Diagnostic) []*tfplugin5.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 *tfprotov5.Function) *tfplugin5.Function

func FunctionError added in v0.22.0

func FunctionError(in *tfprotov5.FunctionError) *tfplugin5.FunctionError

func Function_Parameter added in v0.20.0

func Function_Return added in v0.20.0

func Function_Return(in *tfprotov5.FunctionReturn) *tfplugin5.Function_Return

func GetFunctions_Response added in v0.20.0

func GetMetadata_DataSourceMetadata added in v0.19.0

func GetMetadata_DataSourceMetadata(in *tfprotov5.DataSourceMetadata) *tfplugin5.GetMetadata_DataSourceMetadata

func GetMetadata_FunctionMetadata added in v0.20.0

func GetMetadata_FunctionMetadata(in *tfprotov5.FunctionMetadata) *tfplugin5.GetMetadata_FunctionMetadata

func GetMetadata_ResourceMetadata added in v0.19.0

func GetMetadata_ResourceMetadata(in *tfprotov5.ResourceMetadata) *tfplugin5.GetMetadata_ResourceMetadata

func GetMetadata_Response added in v0.19.0

func MoveResourceState_Response added in v0.21.0

func Schema

func Schema(in *tfprotov5.Schema) *tfplugin5.Schema

func ServerCapabilities added in v0.19.0

func Timestamp added in v0.25.0

func Timestamp(in time.Time) *timestamppb.Timestamp

Types

This section is empty.

Jump to

Keyboard shortcuts

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