Hello,
I'm trying to use
protobuf
as an interface for our storage layer. Idea is to get RPC and execute
some SQL/NoSQL code based on configuration. I'm trying to use
gorm.io
for SQL like databases.
I have proto file with message definition:
message Token {
string uuid = 1;
...
}
This got generated into Go code:
type Token struct {
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
...
}
How can I extend the formatting string for the fields and add some extra information, not related to protobufor or json, and add gorm: "primary_key" to the field, e.g.:
type Token struct {
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty" gorm:"primary_key"`
....
}
Is this even possible to change the generated code?
Thank you in
advance
!