Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateWorkspace ¶
func GenerateWorkspace() error
Types ¶
type GenerateCodeOption ¶
type GenerateCodeOption func(*GenerateCodeOptions)
func WithGenerateStrategy ¶
func WithGenerateStrategy(strategy GenerateStrategy) GenerateCodeOption
type GenerateCodeOptions ¶
type GenerateCodeOptions struct {
// contains filtered or unexported fields
}
type GenerateStrategy ¶
type GenerateStrategy int
const ( // Generates only workspace-local descriptors WorkspaceLocalDescriptorsOnly GenerateStrategy = iota // Generates all descriptors, including those from dependencies, except // package google.protobuf. AllDescriptorsExceptGoogleProtobuf )
type GeneratedFile ¶
type GeneratedFile struct { // Basename of the generated file. Name string // Path where this file can be written to, such that it will be in the same // directory as the source proto it was generated from. Calling WriteToDisk // will write the file to this path. This will be a relative path if // the source file was given as a relative path. SourceRelPath string // Go package (not including the file name) defined in the source proto. Package string // Generated file content. Content string }
func GenerateCode ¶
func GenerateCode(generators []Generator, searchDirs []string, opts ...GenerateCodeOption) ([]*GeneratedFile, error)
Generates code for each source file found in the given search directories, using one or more code generators.
func (*GeneratedFile) WriteToDisk ¶
func (g *GeneratedFile) WriteToDisk() error
Click to show internal directories.
Click to hide internal directories.