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 ¶
- func AttributePath(path cty.Path) (*proto.AttributePath, error)
- func BodyContent(body *hclext.BodyContent, sources map[string][]byte) *proto.BodyContent
- func BodySchema(body *hclext.BodySchema) *proto.BodySchema
- func Config(config *tflint.Config) *proto.ApplyGlobalConfig_Config
- func Error(code codes.Code, err error) error
- func ExpandMode(mode tflint.ExpandMode) proto.GetModuleContent_ExpandMode
- func Expression(expr hcl.Expression, source []byte) *proto.Expression
- func GetModuleContentHint(hint tflint.GetModuleContentHint) *proto.GetModuleContent_Hint
- func GetModuleContentOption(opts *tflint.GetModuleContentOption) *proto.GetModuleContent_Option
- func ModuleCtxType(ty tflint.ModuleCtxType) proto.ModuleCtxType
- func Pos(pos hcl.Pos) *proto.Range_Pos
- func Range(rng hcl.Range) *proto.Range
- func Rule(rule tflint.Rule) *proto.EmitIssue_Rule
- func SchemaMode(mode hclext.SchemaMode) proto.SchemaMode
- func Severity(severity tflint.Severity) proto.EmitIssue_Severity
- func Value(value cty.Value, ty cty.Type) ([]byte, []*proto.ValueMark, error)
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 ¶
func Config(config *tflint.Config) *proto.ApplyGlobalConfig_Config
Config converts tflint.Config to proto.ApplyGlobalConfig_Config
func ExpandMode ¶
func ExpandMode(mode tflint.ExpandMode) proto.GetModuleContent_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 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
Types ¶
This section is empty.