Skip to content

cybozu/protobuf

Repository files navigation

Cybozu Public Protocol Buffers Schema

This repository contains public Protocol Buffer files and related tools from Cybozu.

This repository forms a Buf module to publish protobuf files on BSR. You can import packages in this repository by adding the following lines to buf.yaml.

version: v1
deps:
- buf.build/cybozu/protobuf

If you are not familiar with buf, read https://docs.buf.build/manuals/cli/overview

cybozu.validate

This protobuf package provides custom options to normalize and validate messages. Read examples/validation.proto for example usage.

You can get the code generator for Go as follows:

$ go install github.com/cybozu/protobuf/cmd/protoc-gen-go-cybozu-validate@latest

or download prebuilt binaries from Releases.

The following is an example buf.gen.yaml to generate validation code:

version: v1
plugins:
  - plugin: go
    out: .
    opt: paths=source_relative
  - plugin: go-cybozu-validate
    out: .
    opt: paths=source_relative

API documentation

Visit https://buf.build/cybozu/protobuf

Versioning and backward-compatibility

We keep backward-compatibility of Protocol Buffers files. When we want to add breaking changes to Protocol Buffers files, we create a different package like cybozu.foo.v2 not to break the current package.

However, the generated code in this repository may not be backward compatible. For example, Go code generated by protoc-gen-go may not be always backward compatible.

So, we use a semver with major version zero (0.y.z) to tag this repository to declare the generated code may bring breaking changes.

For developers

Running make create-tag creates a new tag and push it to GitHub automatically. The rest of the release process will be done by GitHub Actions.

License

All code in this repository is licensed under the Apache License Version 2.0. Read LICENSE for terms and conditions.