gensample

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

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

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

type ResourceName

type ResourceName struct {
	EntityName  string `yaml:"entity_name"`
	NamePattern string `yaml:"name_pattern"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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