peptide

module
v0.0.0-...-2f92e1c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2021 License: BSD-3-Clause

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:

./test.bash

Perhaps some tea?

Extensions

To test additional extensions add a .proto file to testdata

Then run:

./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

Directories

Path Synopsis
cmd
protoc-gen-go-peptide/internal_gengo
Package internal_gengo is internal to the protobuf module.
Package internal_gengo is internal to the protobuf module.
internal
encoding/tag/tag
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go.
Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go.
genid
Package genid contains constants for declarations in descriptor.proto and the well-known types.
Package genid contains constants for declarations in descriptor.proto and the well-known types.
types
Package version records versioning information about this module.
Package version records versioning information about this module.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL