toproto

package
v0.0.0-...-9baa396 Latest Latest
Warning

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

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

Documentation

Overview

This is duplicated from github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto (v0.23.0)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributePaths

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

func CtyType

func CtyType(in tftypes.Type) []byte

func Deferred

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

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

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

func RawState

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

func Schema

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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