toproto

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package toproto contains an implementation to encode a Go structure into a structure generated from *.proto. This package is not intended to be used directly from plugins.

Many primitives can be handled as-is, but some interfaces and errors require special encoding. The `hcl.Expression` encodes into the range and the text representation as bytes. Error is encoded into gRPC error details to represent wrapped errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributePath

func AttributePath(path cty.Path) (*proto.AttributePath, error)

AttributePath converts cty.Path to proto.AttributePath

func BodyContent

func BodyContent(body *hclext.BodyContent, sources map[string][]byte) *proto.BodyContent

BodyContent converts schema.BodyContent to proto.BodyContent

func BodySchema

func BodySchema(body *hclext.BodySchema) *proto.BodySchema

BodySchema converts schema.BodySchema to proto.BodySchema

func Config

Config converts tflint.Config to proto.ApplyGlobalConfig_Config

func Error

func Error(code codes.Code, err error) error

Error converts error to gRPC error status with details

func ExpandMode

ExpandMode converts tflint.ExpandMode to proto.GetModuleContent_ExpandMode

func Expression

func Expression(expr hcl.Expression, source []byte) *proto.Expression

Expression converts hcl.Expression to proto.Expression

func GetModuleContentHint

func GetModuleContentHint(hint tflint.GetModuleContentHint) *proto.GetModuleContent_Hint

GetModuleContentHint converts tflint.GetModuleContentHint to proto.GetModuleContentHint

func GetModuleContentOption

func GetModuleContentOption(opts *tflint.GetModuleContentOption) *proto.GetModuleContent_Option

GetModuleContentOption converts tflint.GetModuleContentOption to proto.GetModuleContent_Option

func ModuleCtxType

func ModuleCtxType(ty tflint.ModuleCtxType) proto.ModuleCtxType

ModuleCtxType converts tflint.ModuleCtxType to proto.ModuleCtxType

func Pos

func Pos(pos hcl.Pos) *proto.Range_Pos

Pos converts hcl.Pos to proto.Range_Pos

func Range

func Range(rng hcl.Range) *proto.Range

Range converts hcl.Range to proto.Range

func Rule

func Rule(rule tflint.Rule) *proto.EmitIssue_Rule

Rule converts tflint.Rule to proto.EmitIssue_Rule

func SchemaMode

func SchemaMode(mode hclext.SchemaMode) proto.SchemaMode

SchemaMode converts hclext.SchemaMode to proto.SchemaMode

func Severity

func Severity(severity tflint.Severity) proto.EmitIssue_Severity

Severity converts severity to proto.EmitIssue_Severity

func Value

func Value(value cty.Value, ty cty.Type) ([]byte, []*proto.ValueMark, error)

Value converts cty.Value to msgpack and serialized value marks

Types

This section is empty.

Jump to

Keyboard shortcuts

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