protobuf
Provides generate, lint, and format functions backed by buf,with an configurable container image for repeatable CI workflows.
Installation
dagger install github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cacEntrypoint
Return Type
Protobuf !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Source directory containing the buf.yaml and proto files |
| container | Container | - | buf container image to use |
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
func (m *MyModule) Example() *dagger.Protobuf {
return dag.
Protobuf()
}@function
def example() -> dagger.Protobuf:
return (
dag.protobuf()
)@func()
example(): Protobuf {
return dag
.protobuf()
}Types
Protobuf 🔗
container() 🔗
Return Type
Container ! Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Protobuf().
Container()
}@function
def example() -> dagger.Container:
return (
dag.protobuf()
.container()
)@func()
example(): Container {
return dag
.protobuf()
.container()
}format() 🔗
Format runs buf format and returns the formatted proto files.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] | - | Additional arguments passed to `buf format` |
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
formatfunc (m *MyModule) Example() *dagger.Directory {
return dag.
Protobuf().
Format()
}@function
def example() -> dagger.Directory:
return (
dag.protobuf()
.format()
)@func()
example(): Directory {
return dag
.protobuf()
.format()
}generate() 🔗
Generate runs buf generate and returns the container with generated output under /out/.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] | - | Additional arguments passed to `buf generate` |
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
generatefunc (m *MyModule) Example() *dagger.Container {
return dag.
Protobuf().
Generate()
}@function
def example() -> dagger.Container:
return (
dag.protobuf()
.generate()
)@func()
example(): Container {
return dag
.protobuf()
.generate()
}lint() 🔗
Lint runs buf lint on the proto files.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] | - | Additional arguments passed to `buf lint` |
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
lintfunc (m *MyModule) Example(ctx context.Context) {
return dag.
Protobuf().
Lint(ctx)
}@function
async def example() -> None:
return await (
dag.protobuf()
.lint()
)@func()
async example(): Promise<void> {
return dag
.protobuf()
.lint()
}