Documentation
¶
Overview ¶
Package generate runs `buf generate` against a prepared workspace, either in a Docker container (default) or with a host buf binary. A single backend is reused across all language jobs so per-language toolchain setup happens once.
Index ¶
Constants ¶
View Source
const ( RunnerAuto = "auto" RunnerDocker = "docker" RunnerHost = "host" )
Runner selection values for Options.Runner.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator interface {
Generate(ctx context.Context, workspaceDir, outDir string, jobs []*Job) error
}
Generator runs buf for a set of jobs against a prepared workspace, writing generated code into outDir.
type Job ¶
type Job struct {
Lang string // "go" | "js"
TemplateFile string // buf gen template file name, relative to the workspace root
}
Job is a single language generation: which template within the workspace to run buf with.
type Options ¶
type Options struct {
Runner string // auto | docker | host
Image string // Docker image, default "bufbuild/buf"
Tag string // Docker image tag, default "1.54.0"
MemoryGiB int // container memory limit in GiB, default 2
}
Options configures the generator. Zero values are replaced by defaults.
Click to show internal directories.
Click to hide internal directories.