• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build protobufs in Go, easily

protobuild

Build Status Go Report Card

Build protobufs in Go, easily.

protobuild works by scanning the go package in a project and emitting correct protoc commands, configured with the plugins, packages and details of your choice.

The main benefit is that it makes it much easier to consume external types from vendored projects. By integrating the protoc include paths with Go's vendoring and GOPATH, builds are much easier to keep consistent across a project.

This comes from experience with generating protobufs with go generate in swarmkit and the tool used with containerd. It should replace both.

Status

Very early stages.

Installation

To ensure easy use with builds, we'll try to support go get. Install with the following command:

go get -u github.com/containerd/protobuild

Usage

Protobuild works by providing a list of Go packages in which to build the protobufs. To get started with a project, you must do the following:

  1. Create a Protobuild.toml file in the root of your Go project. Use the example as a starting point.

  2. Make sure that the packages where you want your protobuf files have a Go file in place. Usually, adding a doc.go file is sufficient. A package for protobuf should look like this:

    foo.proto
    doc.go
    

    Where the contents of doc.go will have a package declaration in it. See the example for details. Make sure the package name corresponds to what is in the go_package option.

  3. Run the protobuild command:

    go list ./... | grep -v vendor | xargs protobuild
    

Version Compatibility

Originally protoc-gen-go was supporting gRPC through its plugins mechanism. However gRPC support is later extracted as protoc-gen-go-gprc binary.

To use protoc-gen-go and protoc-gen-go-grpc. Please specify version = "2" and both code generators instead of plugins like below.

version = "2"
generators = ["go", "go-grpc"]

Project details

protobuild is a containerd sub-project, licensed under the Apache 2.0 license. As a containerd sub-project, you will find the:

information in our containerd/project repository.

More Repositories

1

containerd

An open and reliable container runtime
Go
16,882
star
2

nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Go
7,909
star
3

cgroups

cgroups package for Go
Go
1,085
star
4

runwasi

Facilitates running Wasm / WASI workloads managed by containerd
Rust
1,047
star
5

cri

Moved to https://github.com/containerd/containerd/tree/master/pkg/cri . If you wish to submit issues/PRs, please submit to https://github.com/containerd/containerd
Go
905
star
6

stargz-snapshotter

Fast container image distribution plugin with lazy pulling
Go
884
star
7

ttrpc

GRPC for low-memory environments
Go
548
star
8

accelerated-container-image

A production-ready remote container image format (overlaybd) and snapshotter based on block-device.
Go
405
star
9

imgcrypt

OCI Image Encryption Package
Go
332
star
10

overlaybd

Overlaybd: a block based remote image format. The storage backend of containerd/accelerated-container-image.
C++
257
star
11

ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Rust
196
star
12

console

console package for Go
Go
178
star
13

rust-extensions

Rust crates to extend containerd
Rust
170
star
14

nydus-snapshotter

A containerd snapshotter with data deduplication and lazy loading in P2P fashion
Go
165
star
15

go-runc

runc bindings for Go
Go
163
star
16

go-cni

A generic CNI library to provide APIs for CNI plugin interactions
Go
146
star
17

continuity

A transport-agnostic, filesystem metadata manifest system
Go
142
star
18

nri

Node Resource Interface
Go
128
star
19

fifo

fifo pkg for Go
Go
86
star
20

project

Cross-project utilities, scripts, etc.
Shell
72
star
21

btrfs

Btrfs bindings for Go
Go
68
star
22

zfs

ZFS snapshotter plugin for containerd
Go
64
star
23

typeurl

Go package for managing marshaled types to protobuf.Any
Go
49
star
24

containerd.io

Website repo for https://containerd.io
JavaScript
37
star
25

fuse-overlayfs-snapshotter

fuse-overlayfs plugin for rootless containerd
Go
37
star
26

release-tool

A release tool for generating detailed release notes
Go
34
star
27

aufs

AUFS Snapshotter for containerd
Go
26
star
28

ltag

Prepends project files with given template.
Go
16
star
29

project-checks

This cross-project repository holds utilities, scripts, and common files used across the containerd master project and many sub-projects within the containerd organization
Shell
5
star