Documentation ¶
Overview ¶
Package config contains configuration for the AIP Spanner Go code generator.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeGenerationConfig ¶
type CodeGenerationConfig struct { // Databases to generate code for. Databases []DatabaseConfig `yaml:"databases"` }
CodeGenerationConfig contains config for code generation.
type DatabaseConfig ¶
type DatabaseConfig struct { // Name of the database. Name string `yaml:"name"` // SchemaGlobs are read in ass SchemaGlobs []string `yaml:"schema"` // Package is the config for database's generated Go package. Package GoPackageConfig `yaml:"package"` // Resources are the config for the databases generated resource APIs. Resources []ResourceConfig `yaml:"resources"` }
DatabaseConfig contains code generation config for a database.
func (*DatabaseConfig) LoadDatabase ¶
func (c *DatabaseConfig) LoadDatabase() (*spanddl.Database, error)
LoadDatabase loads the configured database.
type GoPackageConfig ¶
type GoPackageConfig struct { // Name is the package name. Name string `yaml:"name"` // Path is the package import path. Path string `yaml:"path"` }
GoPackageConfig contains code generation config for a Go package.
type ResourceConfig ¶
type ResourceConfig struct { // Message contains the Go package path and message name to use for the resource. // Example: go.einride.tech/aip/examples/proto/gen/einride/example/freight/v1.Shipper. Message string `yaml:"message"` // Table is the name of the table used for storing the resource. Table string `yaml:"table"` }
ResourceConfig contains code generation config for a resource.
func (*ResourceConfig) LoadMessageDescriptor ¶
func (r *ResourceConfig) LoadMessageDescriptor() (protoreflect.MessageDescriptor, error)
LoadMessageDescriptor loads the protobuf descriptor for the configured message.
Click to show internal directories.
Click to hide internal directories.