toto

package
v0.0.0-...-347683b Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputFormatOptions = map[OutputFormat][]string{
	TextOutputFormat:  {"text"},
	JsonOutputFormat:  {"json"},
	DebugOutputFormat: {"debug"},
}

OutputFormatOptions contains the textual value of the output format, which can be used in command-line flags.

Functions

func CompileProto

func CompileProto(root string) (io.ReadCloser, error)

CompileProto invokes protoc to generate a file descriptor set. The caller is responsible for calling Close() on the reader.

func ConvertFilesToTypes

func ConvertFilesToTypes(files *protoregistry.Files) (*protoregistry.Types, error)

func FindProtoFiles

func FindProtoFiles(root string) ([]string, error)

func LoadImage

func LoadImage(r io.Reader) (*descriptorpb.FileDescriptorSet, error)

LoadImage loads a preprocessed FileDescriptorSet from an image. Said image could be generated using:

find . -name '*.proto' | xargs protoc--descriptor_set_out=all.image

whereby 'all.image' would be passed into this function.

func NewCommand

func NewCommand() *cobra.Command

Types

type OutputFormat

type OutputFormat enumflag.Flag
const (
	// TextOutputFormat emits prototext representation.
	TextOutputFormat OutputFormat = iota
	// JsonOutputFormat emits protojson representation.
	JsonOutputFormat
	// DebugOutputFormat emits internal go structure. It mostly looks like
	// prototext, except it does not attempt to parse certain well-known fields,
	// such as google.protobuf.Any. Such fields may be displayed as raw bytes.
	DebugOutputFormat
)

type TypedDescriptor

type TypedDescriptor interface {
	Enums() protoreflect.EnumDescriptors
	Extensions() protoreflect.ExtensionDescriptors
	Messages() protoreflect.MessageDescriptors
}

Jump to

Keyboard shortcuts

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