[#120] protogen: Marshal enum as string
Be compatible with protojson. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
f812b1ae5b
commit
805da79319
9 changed files with 121 additions and 20 deletions
21
object/grpc/service_frostfs.pb.go
generated
21
object/grpc/service_frostfs.pb.go
generated
|
@ -4117,7 +4117,12 @@ func (x *SearchRequest_Body_Filter) MarshalEasyJSON(out *jwriter.Writer) {
|
|||
{
|
||||
const prefix string = ",\"matchType\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int32(int32(x.MatchType))
|
||||
v := int32(x.MatchType)
|
||||
if vv, ok := MatchType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"key\":"
|
||||
|
@ -6246,7 +6251,12 @@ func (x *GetRangeHashRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
|||
{
|
||||
const prefix string = ",\"type\":"
|
||||
out.RawString(prefix)
|
||||
out.Int32(int32(x.Type))
|
||||
v := int32(x.Type)
|
||||
if vv, ok := grpc.ChecksumType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
out.RawByte('}')
|
||||
}
|
||||
|
@ -6659,7 +6669,12 @@ func (x *GetRangeHashResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
|||
{
|
||||
const prefix string = ",\"type\":"
|
||||
out.RawString(prefix[1:])
|
||||
out.Int32(int32(x.Type))
|
||||
v := int32(x.Type)
|
||||
if vv, ok := grpc.ChecksumType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"hashList\":"
|
||||
|
|
14
object/grpc/types_frostfs.pb.go
generated
14
object/grpc/types_frostfs.pb.go
generated
|
@ -323,7 +323,12 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
|||
{
|
||||
const prefix string = ",\"objectType\":"
|
||||
out.RawString(prefix)
|
||||
out.Int32(int32(x.ObjectType))
|
||||
v := int32(x.ObjectType)
|
||||
if vv, ok := ObjectType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"payloadLength\":"
|
||||
|
@ -1659,7 +1664,12 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
|
|||
{
|
||||
const prefix string = ",\"objectType\":"
|
||||
out.RawString(prefix)
|
||||
out.Int32(int32(x.ObjectType))
|
||||
v := int32(x.ObjectType)
|
||||
if vv, ok := ObjectType_name[v]; ok {
|
||||
out.String(vv)
|
||||
} else {
|
||||
out.Int32(v)
|
||||
}
|
||||
}
|
||||
{
|
||||
const prefix string = ",\"homomorphicHash\":"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue