https://github.com/monax/peptide
Protobuf generator supporting custom types
https://github.com/monax/peptide
Last synced: 11 months ago
JSON representation
Protobuf generator supporting custom types
- Host: GitHub
- URL: https://github.com/monax/peptide
- Owner: monax
- License: bsd-3-clause
- Created: 2021-01-13T15:21:16.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-24T12:36:46.000Z (over 5 years ago)
- Last Synced: 2025-01-08T21:58:06.216Z (over 1 year ago)
- Language: Go
- Size: 374 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# I just want to say sorry
_**This is a proof-of-concept**_
Peptide is an anti-homage to amino the now defunct semi-protobuf-compatible library (https://github.com/tendermint/go-amino) (thanks for all the fish amino :) ).
This aims to provide support for custom types with the Google Go Protobuf V2 API (https://github.com/protocolbuffers/protobuf-go)
Following the approach suggested protobuf-go maintainer here: https://github.com/xen0n/protobuf-gogogo/issues/1
## Theft
I have _borrowed_ the implementations provided by @xen0n (see: https://github.com/gogo/protobuf/issues/691) for the `gogoproto` extensions listed below:
> I took the time to re-implement the top 3 extensions needed by our projects, in the form of protobuf-gogogo (pardon the name). Note this is very preliminary work without testing infrastructure set up, don't use in (your) production yet.
The extensions implemented:
- `gogoproto.moretags`
- `gogoproto.jsontag`
- `gogoproto.enumvalue_customname`
## Test
Run:
```bash
./test.bash
```
Perhaps some tea?
### Extensions
To test additional extensions add a `.proto` file to [testdata](./cmd/protoc-gen-go-peptide/testdata)
Then run:
```bash
./regenerate.bash
```
Then `./test.bash` again to see if the `.pb.go` files compile. If they compile they are probably fine and should be shipped.
## Credits
- This is a partial fork of: https://github.com/protocolbuffers/protobuf-go
- This is based on: https://github.com/xen0n/protobuf-gogogo