Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGen ¶
func InitGen(desc []*descriptor.FileDescriptorProto, sampleFnames []string, gapicFname string, clientPkg string, nofmt bool) (*generator, error)
InitGen creates a new sample generator. sampleFnames is the filenames of all sample config files. gapicFname is the filename of gapic config. clientPkg is the Go package of the generated gapic client library. nofmt set to true will instruct the generator not to format the generated code. This could be useful for debugging purposes.
func PluginEntry ¶
func PluginEntry(genReq *plugin.CodeGeneratorRequest) (*plugin.CodeGeneratorResponse, error)
PluginEntry is the entry point of SampleGen as a protoc plugin. If gapic-generator-go is called as a protoc plugin or docker image with the intention to generate samples, it will eventually call this function to do so.
Types ¶
type GAPICConfig ¶
type GAPICConfig struct { Interfaces []GAPICInterface Collections []ResourceName }
type GAPICInterface ¶
type GAPICInterface struct { Name string Methods []GAPICMethod }
type GAPICMethod ¶
type GAPICMethod struct { Name string // map[fieldName]ResourceName.EntityName FieldNamePatterns map[string]string `yaml:"field_name_patterns"` LongRunning LongRunningConfig `yaml:"long_running"` }
type LongRunningConfig ¶
type LongRunningConfig struct { ReturnType string `yaml:"return_type"` MetadataType string `yaml:"metadata_type"` }
All other fields are left out because samples do not need to know polling config, and we are moving to annotations anyway