Documentation
¶
Overview ¶
Technically this file is specific to go, but the functions themselves are useful in general. We should generalize this to work in all langs but have the logic shared somehow. For now we are hacking shit across files.
Index ¶
- func FieldValueToString(parent protoreflect.Message, f protoreflect.FieldDescriptor, ...) string
- func FieldValueToTS(f protoreflect.FieldDescriptor, val protoreflect.Value) string
- func GenFormattedTS(ctx context.Context, repoPath, ns, outFilename string) error
- func GenGoCmd() *cobra.Command
- func GenTS(ctx context.Context, repoPath, ns string, getWriter func() (io.Writer, error)) error
- func GenTSCmd() *cobra.Command
- type ProtoImport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldValueToString ¶ added in v0.3.23
func FieldValueToString(parent protoreflect.Message, f protoreflect.FieldDescriptor, val protoreflect.Value, protoType *ProtoImport) string
func FieldValueToTS ¶
func FieldValueToTS(f protoreflect.FieldDescriptor, val protoreflect.Value) string
returns only the formatted value
func GenFormattedTS ¶ added in v0.3.23
Pipe `GenTS` to prettier
Types ¶
type ProtoImport ¶
func UnpackProtoType ¶
func UnpackProtoType(moduleRoot string, typeURL string) *ProtoImport
This function handles both the google.protobuf.Any.TypeURL variable which has the format of `types.googleapis.com/fully.qualified.v1beta1.Proto` and purely `fully.qualified.v1beta1.Proto`
return nil if typeURL is empty. Panics on any problems like the rest of the file.
Click to show internal directories.
Click to hide internal directories.