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 *plugin.CodeGeneratorRequest) (*plugin.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
IsLRO bool
HasEnums bool
SubCommands []*Command
}
Command intermediate representation of a RPC/Method as a CLI command
type Flag ¶
type Flag struct {
Name string
Type descriptor.FieldDescriptorProto_Type
Message string
Repeated bool
Required bool
Usage string
MessageImport pbinfo.ImportSpec
OneOfs map[string]*Flag
OneOfSelector string
VarName string
FieldName string
SliceAccessor string
IsOneOfField bool
IsNested bool
}
Flag is used to represent fields as flags
func (*Flag) IsBytes ¶ added in v0.4.0
IsBytes is a helper that reports if the flag is of a type bytes
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.