Dagger
Search

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@fd3662f8169fc78d2ef5851acd055259cceb4cac

Entrypoint

Return Type
Protobuf !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory containing the buf.yaml and proto files
containerContainer -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 \
 container
func (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
NameTypeDefault ValueDescription
args[String ! ] -Additional arguments passed to `buf format`
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
 format
func (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
NameTypeDefault ValueDescription
args[String ! ] -Additional arguments passed to `buf generate`
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
 generate
func (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
NameTypeDefault ValueDescription
args[String ! ] -Additional arguments passed to `buf lint`
Example
dagger -m github.com/bcachet/dagger/protobuf@fd3662f8169fc78d2ef5851acd055259cceb4cac call \
 lint
func (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()
}