Skip to content

Commit 05a9040

Browse files
authored
feat: bootstrap Go bindings for trogon-proto (#1)
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1 parent 71bc2fd commit 05a9040

25 files changed

Lines changed: 4128 additions & 1 deletion

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text=auto eol=lf
2+
3+
# Mark generated protobuf bindings so GitHub collapses diffs and excludes
4+
# them from language statistics.
5+
gen/** linguist-generated=true
6+
*.pb.go linguist-generated=true
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "go",
4+
"include-v-in-tag": true,
5+
"include-component-in-tag": false,
6+
"signoff": "Straw Hat Team Bot <61149376+sht-bot@users.noreply.github.com>",
7+
"changelog-sections": [
8+
{
9+
"type": "feat",
10+
"section": "Features",
11+
"hidden": false
12+
},
13+
{
14+
"type": "fix",
15+
"section": "Bug Fixes",
16+
"hidden": false
17+
}
18+
],
19+
"packages": {
20+
".": {
21+
"component": "trogonproto"
22+
}
23+
},
24+
"plugins": [
25+
{
26+
"type": "sentence-case"
27+
}
28+
]
29+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1"
3+
}

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: "monthly"
7+
open-pull-requests-limit: 3
8+
9+
- package-ecosystem: github-actions
10+
directory: /
11+
schedule:
12+
interval: "monthly"
13+
open-pull-requests-limit: 3

.github/semantic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
titleOnly: true
2+
allowRevertCommits: true

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
10+
permissions:
11+
contents: read
12+
pull-requests: read
13+
14+
jobs:
15+
generated-code-up-to-date:
16+
name: Generated Code Up-To-Date
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5.0.0
20+
- uses: bufbuild/buf-setup-action@v1.50.0
21+
with:
22+
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
- name: Regenerate Go bindings
24+
run: buf generate
25+
- name: Verify clean working tree
26+
run: |
27+
if ! git diff --quiet --exit-code; then
28+
echo "Generated code is out of date. Run 'buf generate' and commit the result."
29+
git diff
30+
exit 1
31+
fi
32+
33+
quality-assurance:
34+
name: Quality Assurance
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
go-version: [1.26.x]
39+
40+
steps:
41+
- uses: actions/checkout@v5.0.0
42+
- uses: actions/setup-go@v6.0.0
43+
with:
44+
go-version: ${{ matrix.go-version }}
45+
- uses: golangci/golangci-lint-action@v8.0.0
46+
with:
47+
version: latest
48+
- run: go test -race -v ./...
49+
- run: go vet ./...
50+
- run: golangci-lint run
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Release Please
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
issues: write
12+
pull-requests: write
13+
14+
jobs:
15+
release-please:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Release Please
19+
id: release
20+
uses: googleapis/release-please-action@v4.3.0
21+
with:
22+
token: ${{ secrets.GH_PAT_RELEASE_PLEASE_ACTION }}
23+
config-file: .github/.release-please-config.json
24+
manifest-file: .github/.release-please-manifest.json

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
# trogonproto
1+
# trogonproto
2+
3+
**trogonproto is the Go bindings module for the [trogon-proto](https://github.com/TrogonStack/trogon-proto) contract.**
4+
5+
**trogonproto exposes the generated Go types for every schema defined in `trogon-proto` — errors, env vars, UUIDs, consistency, streams, relay pagination, and more.** It tracks each release of the upstream proto module and ships pre-compiled `.pb.go` files under a stable import prefix so consumers never need to run `protoc` or `buf` themselves. Importing a contract is the same as importing any other Go package.
6+
7+
**trogonproto removes the toolchain burden that usually comes with adopting a shared protobuf contract in Go.** Without it, every service has to install `buf`, wire up codegen into its build, and keep generated output in sync with the proto repo on every bump — work that has nothing to do with the service itself and that drifts the moment one team forgets to regenerate.
8+
9+
**trogonproto is useful for any Go service, library, or tool that consumes the TrogonStack contracts.** Service teams pick up new fields by `go get`-bumping a single dependency. Library authors (e.g. `trogonerror`) can rely on stable Go types for the contract without taking a transitive dependency on the protobuf toolchain. Platform teams get a single place to publish, version, and audit the Go-facing surface of every TrogonStack proto.

buf.gen.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: v2
2+
3+
managed:
4+
enabled: true
5+
override:
6+
- file_option: go_package_prefix
7+
value: github.com/TrogonStack/trogonproto/gen
8+
- file_option: go_package
9+
path: elixirpb.proto
10+
value: buf.build/gen/go/elixir-protobuf/protobuf/protocolbuffers/go
11+
12+
plugins:
13+
- remote: buf.build/protocolbuffers/go:v1.36.5
14+
out: gen
15+
opt:
16+
- paths=source_relative
17+
18+
inputs:
19+
- module: buf.build/trogonstack/trogon-proto

0 commit comments

Comments
 (0)