Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EmptyProtoType is the type name for the Empty message type EmptyProtoType = "google.protobuf.Empty" // LROProtoType is the type name for the LRO message type LROProtoType = "google.longrunning.Operation" )
View Source
const ( // ShortDescMax is the maximum length accepted for // the Short usage docs ShortDescMax = 50 // LongDescMax is the maximum length accepted for // the Long usage docs LongDescMax = 150 )
Variables ¶
This section is empty.
Functions ¶
func Gen ¶
func Gen(genReq *pluginpb.CodeGeneratorRequest) (*pluginpb.CodeGeneratorResponse, error)
Gen is the main entry point for code generation of a command line utility
Types ¶
type Command ¶
type Command struct { Service string ServiceClientType string Method string MethodCmd string InputMessageType string InputMessage string InputMessageVar string ShortDesc string LongDesc string Imports map[string]*pbinfo.ImportSpec Flags []*Flag OneOfSelectors map[string]*Flag NestedMessages []*NestedMessage EnvPrefix string OutputMessageType string ServerStreaming bool ClientStreaming bool Paged bool HasPageSize bool HasPageToken bool IsLRO bool IsLRORespEmpty bool HasEnums bool HasOptional bool SubCommands []*Command }
Command intermediate representation of a RPC/Method as a CLI command
type Flag ¶
type Flag struct { Name string Type descriptorpb.FieldDescriptorProto_Type Message string Repeated bool Required bool Usage string MessageImport pbinfo.ImportSpec OneOfs map[string]*Flag OneOfSelector string OneOfDesc *desc.OneOfDescriptor VarName string FieldName string SliceAccessor string IsOneOfField bool IsNested bool IsMap bool Optional bool // Accessor is only set after calling GenFlag Accessor string MsgDesc *desc.MessageDescriptor }
Flag is used to represent fields as flags
func (*Flag) EnumFieldAccess ¶ added in v0.13.0
EnumFieldAccess constructs the input message field accessor for an enum assignment.
func (*Flag) GoTypeForPrim ¶ added in v0.14.0
GoTypeForPrim returns the name of the Go type for a primitive proto type.
func (*Flag) IsBytes ¶ added in v0.4.0
IsBytes is a helper that reports if the flag is of a type bytes
func (*Flag) OptionalVarName ¶ added in v0.14.0
OptionalVarName constructs the place holder variable name for a proto3 optional field.
type NestedMessage ¶
NestedMessage represents a nested message that will need to be initialized in the generated code
Click to show internal directories.
Click to hide internal directories.