Documentation ¶
Index ¶
- Constants
- Variables
- func FileName(name string) string
- func FindValue(field protoreflect.FieldDescriptor) string
- func GetKind(kind protoreflect.Kind) string
- func GetKindLUT(kind protoreflect.Kind) string
- func GetLUTDecoder(kind protoreflect.Kind) string
- func GetLUTEncoder(kind protoreflect.Kind) string
- type DecodingFields
- type EncodingFields
- type Generator
- func (g *Generator) ExecuteTemplate(genFile *protogen.GeneratedFile, protoFile *protogen.File, packageName string, ...) error
- func (g *Generator) Generate(req *pluginpb.CodeGeneratorRequest) (res *pluginpb.CodeGeneratorResponse, err error)
- func (*Generator) MarshalResponse(res *pluginpb.CodeGeneratorResponse) ([]byte, error)
- func (*Generator) UnmarshalRequest(buf []byte) (*pluginpb.CodeGeneratorRequest, error)
Constants ¶
View Source
const ( Extension = ".polyglot.go" Pointer = "*" MapSuffix = "Map" Slice = "[]" PolyglotAnyKind = "polyglot.AnyKind" )
Variables ¶
View Source
var (
RequiredImports = []string{
"github.com/loopholelabs/polyglot",
"errors",
}
)
Functions ¶
func FindValue ¶
func FindValue(field protoreflect.FieldDescriptor) string
func GetKind ¶
func GetKind(kind protoreflect.Kind) string
func GetKindLUT ¶
func GetKindLUT(kind protoreflect.Kind) string
func GetLUTDecoder ¶
func GetLUTDecoder(kind protoreflect.Kind) string
func GetLUTEncoder ¶
func GetLUTEncoder(kind protoreflect.Kind) string
Types ¶
type DecodingFields ¶
type DecodingFields struct { MessageFields []protoreflect.FieldDescriptor SliceFields []protoreflect.FieldDescriptor Other []protoreflect.FieldDescriptor }
func GetDecodingFields ¶
func GetDecodingFields(fields protoreflect.FieldDescriptors) DecodingFields
type EncodingFields ¶
type EncodingFields struct { MessageFields []protoreflect.FieldDescriptor SliceFields []protoreflect.FieldDescriptor Values []string }
func GetEncodingFields ¶
func GetEncodingFields(fields protoreflect.FieldDescriptors) EncodingFields
type Generator ¶
type Generator struct { CustomFields func() string CustomEncode func() string CustomDecode func() string // contains filtered or unexported fields }
func (*Generator) ExecuteTemplate ¶
func (*Generator) Generate ¶
func (g *Generator) Generate(req *pluginpb.CodeGeneratorRequest) (res *pluginpb.CodeGeneratorResponse, err error)
func (*Generator) MarshalResponse ¶
func (*Generator) MarshalResponse(res *pluginpb.CodeGeneratorResponse) ([]byte, error)
func (*Generator) UnmarshalRequest ¶
func (*Generator) UnmarshalRequest(buf []byte) (*pluginpb.CodeGeneratorRequest, error)
Click to show internal directories.
Click to hide internal directories.