forked from TrueCloudLab/frostfs-api-go
Compare commits
10 commits
f812b1ae5b
...
5e0457290d
Author | SHA1 | Date | |
---|---|---|---|
5e0457290d | |||
f0fc40e116 | |||
29f2157563 | |||
29c522d5d8 | |||
3e705a3cbe | |||
d9a604fbc1 | |||
b06dad731c | |||
d94b9c6d0d | |||
eeb754c327 | |||
805da79319 |
29 changed files with 6540 additions and 1572 deletions
|
@ -50,7 +50,7 @@ linters:
|
||||||
- bidichk
|
- bidichk
|
||||||
- durationcheck
|
- durationcheck
|
||||||
- exhaustive
|
- exhaustive
|
||||||
- exportloopref
|
- copyloopvar
|
||||||
- gofmt
|
- gofmt
|
||||||
- goimports
|
- goimports
|
||||||
- misspell
|
- misspell
|
||||||
|
|
84
accounting/grpc/service_frostfs.pb.go
generated
84
accounting/grpc/service_frostfs.pb.go
generated
|
@ -98,12 +98,20 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerId\":"
|
if x.OwnerId != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerId\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,22 +303,44 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,12 +482,20 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"balance\":"
|
if x.Balance != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"balance\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Balance.MarshalEasyJSON(out)
|
x.Balance.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,22 +687,44 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
46
accounting/grpc/types_frostfs.pb.go
generated
46
accounting/grpc/types_frostfs.pb.go
generated
|
@ -11,6 +11,7 @@ import (
|
||||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||||
jlexer "github.com/mailru/easyjson/jlexer"
|
jlexer "github.com/mailru/easyjson/jlexer"
|
||||||
jwriter "github.com/mailru/easyjson/jwriter"
|
jwriter "github.com/mailru/easyjson/jwriter"
|
||||||
|
strconv "strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Decimal struct {
|
type Decimal struct {
|
||||||
|
@ -113,17 +114,34 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if x.Value != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int64(x.Value)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.Value, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"precision\":"
|
if x.Precision != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"precision\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Precision)
|
out.Uint32(x.Precision)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,13 +173,29 @@ func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "value":
|
case "value":
|
||||||
{
|
{
|
||||||
var f int64
|
var f int64
|
||||||
f = in.Int64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int64(v)
|
||||||
|
f = pv
|
||||||
x.Value = f
|
x.Value = f
|
||||||
}
|
}
|
||||||
case "precision":
|
case "precision":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Precision = f
|
x.Precision = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
330
acl/grpc/types_frostfs.pb.go
generated
330
acl/grpc/types_frostfs.pb.go
generated
|
@ -352,27 +352,66 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"headerType\":"
|
if x.HeaderType != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.HeaderType))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
}
|
}
|
||||||
{
|
const prefix string = "\"headerType\":"
|
||||||
const prefix string = ",\"matchType\":"
|
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(int32(x.MatchType))
|
v := int32(x.HeaderType)
|
||||||
|
if vv, ok := HeaderType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if x.MatchType != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"matchType\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.MatchType)
|
||||||
|
if vv, ok := MatchType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if len(x.Key) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,14 +605,33 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"role\":"
|
if x.Role != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Role))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"role\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Role)
|
||||||
|
if vv, ok := Role_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"keys\":"
|
if len(x.Keys) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"keys\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Keys {
|
for i := range x.Keys {
|
||||||
|
@ -584,6 +642,7 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -808,19 +867,50 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"operation\":"
|
if x.Operation != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Operation))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
}
|
}
|
||||||
{
|
const prefix string = "\"operation\":"
|
||||||
const prefix string = ",\"action\":"
|
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(int32(x.Action))
|
v := int32(x.Operation)
|
||||||
|
if vv, ok := Operation_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"filters\":"
|
if x.Action != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"action\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Action)
|
||||||
|
if vv, ok := Action_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if len(x.Filters) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"filters\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Filters {
|
for i := range x.Filters {
|
||||||
|
@ -831,8 +921,15 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"targets\":"
|
if len(x.Targets) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"targets\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Targets {
|
for i := range x.Targets {
|
||||||
|
@ -843,6 +940,7 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1084,19 +1182,40 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"containerID\":"
|
if x.ContainerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"containerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ContainerId.MarshalEasyJSON(out)
|
x.ContainerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"records\":"
|
if len(x.Records) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"records\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Records {
|
for i := range x.Records {
|
||||||
|
@ -1107,6 +1226,7 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1292,21 +1412,49 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"exp\":"
|
if x.Exp != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Uint64(x.Exp)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"exp\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"nbf\":"
|
if x.Nbf != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"nbf\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.Nbf)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"iat\":"
|
if x.Iat != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"iat\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.Iat)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -1339,19 +1487,43 @@ func (x *BearerToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "exp":
|
case "exp":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Exp = f
|
x.Exp = f
|
||||||
}
|
}
|
||||||
case "nbf":
|
case "nbf":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Nbf = f
|
x.Nbf = f
|
||||||
}
|
}
|
||||||
case "iat":
|
case "iat":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Iat = f
|
x.Iat = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1472,14 +1644,28 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"target\":"
|
if x.Target != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"target\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Target.MarshalEasyJSON(out)
|
x.Target.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chains\":"
|
if len(x.Chains) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chains\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Chains {
|
for i := range x.Chains {
|
||||||
|
@ -1490,6 +1676,7 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1720,32 +1907,68 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"eaclTable\":"
|
if x.EaclTable != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"eaclTable\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.EaclTable.MarshalEasyJSON(out)
|
x.EaclTable.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerID\":"
|
if x.OwnerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"lifetime\":"
|
if x.Lifetime != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"lifetime\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Lifetime.MarshalEasyJSON(out)
|
x.Lifetime.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"allowImpersonate\":"
|
if x.AllowImpersonate {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"allowImpersonate\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Bool(x.AllowImpersonate)
|
out.Bool(x.AllowImpersonate)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"apeOverride\":"
|
if x.ApeOverride != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"apeOverride\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ApeOverride.MarshalEasyJSON(out)
|
x.ApeOverride.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1923,17 +2146,32 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"signature\":"
|
if x.Signature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"signature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Signature.MarshalEasyJSON(out)
|
x.Signature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
40
ape/grpc/types_frostfs.pb.go
generated
40
ape/grpc/types_frostfs.pb.go
generated
|
@ -155,17 +155,37 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"type\":"
|
if x.Type != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Type))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"type\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Type)
|
||||||
|
if vv, ok := TargetType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"name\":"
|
if len(x.Name) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"name\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Name)
|
out.String(x.Name)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,15 +353,23 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
switch xx := x.Kind.(type) {
|
switch xx := x.Kind.(type) {
|
||||||
case *Chain_Raw:
|
case *Chain_Raw:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"raw\":"
|
if len(xx.Raw) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"raw\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(xx.Raw)
|
out.Base64Bytes(xx.Raw)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
258
apemanager/grpc/service_frostfs.pb.go
generated
258
apemanager/grpc/service_frostfs.pb.go
generated
|
@ -121,17 +121,32 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"target\":"
|
if x.Target != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"target\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Target.MarshalEasyJSON(out)
|
x.Target.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chain\":"
|
if x.Chain != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chain\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Chain.MarshalEasyJSON(out)
|
x.Chain.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,22 +345,44 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,12 +521,20 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chainId\":"
|
if len(x.ChainId) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chainId\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.ChainId)
|
out.Base64Bytes(x.ChainId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,22 +725,44 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -857,17 +924,32 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"target\":"
|
if x.Target != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"target\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Target.MarshalEasyJSON(out)
|
x.Target.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chainId\":"
|
if len(x.ChainId) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chainId\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.ChainId)
|
out.Base64Bytes(x.ChainId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1065,22 +1147,44 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1381,22 +1485,44 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1538,12 +1664,20 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"target\":"
|
if x.Target != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"target\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Target.MarshalEasyJSON(out)
|
x.Target.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1735,22 +1869,44 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1895,10 +2051,17 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chains\":"
|
if len(x.Chains) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chains\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Chains {
|
for i := range x.Chains {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -1908,6 +2071,7 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2106,22 +2270,44 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -762,3 +762,138 @@ func (r *ListResponse) FromGRPCMessage(m grpc.Message) error {
|
||||||
|
|
||||||
return r.ResponseHeaders.FromMessage(v)
|
return r.ResponseHeaders.FromMessage(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) ToGRPCMessage() grpc.Message {
|
||||||
|
var m *container.ListStreamRequest_Body
|
||||||
|
|
||||||
|
if r != nil {
|
||||||
|
m = new(container.ListStreamRequest_Body)
|
||||||
|
|
||||||
|
m.SetOwnerId(r.ownerID.ToGRPCMessage().(*refsGRPC.OwnerID))
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) FromGRPCMessage(m grpc.Message) error {
|
||||||
|
v, ok := m.(*container.ListStreamRequest_Body)
|
||||||
|
if !ok {
|
||||||
|
return message.NewUnexpectedMessageType(m, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
ownerID := v.GetOwnerId()
|
||||||
|
if ownerID == nil {
|
||||||
|
r.ownerID = nil
|
||||||
|
} else {
|
||||||
|
if r.ownerID == nil {
|
||||||
|
r.ownerID = new(refs.OwnerID)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.ownerID.FromGRPCMessage(ownerID)
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequest) ToGRPCMessage() grpc.Message {
|
||||||
|
var m *container.ListStreamRequest
|
||||||
|
|
||||||
|
if r != nil {
|
||||||
|
m = new(container.ListStreamRequest)
|
||||||
|
|
||||||
|
m.SetBody(r.body.ToGRPCMessage().(*container.ListStreamRequest_Body))
|
||||||
|
r.RequestHeaders.ToMessage(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequest) FromGRPCMessage(m grpc.Message) error {
|
||||||
|
v, ok := m.(*container.ListStreamRequest)
|
||||||
|
if !ok {
|
||||||
|
return message.NewUnexpectedMessageType(m, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
body := v.GetBody()
|
||||||
|
if body == nil {
|
||||||
|
r.body = nil
|
||||||
|
} else {
|
||||||
|
if r.body == nil {
|
||||||
|
r.body = new(ListStreamRequestBody)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.body.FromGRPCMessage(body)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return r.RequestHeaders.FromMessage(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) ToGRPCMessage() grpc.Message {
|
||||||
|
var m *container.ListStreamResponse_Body
|
||||||
|
|
||||||
|
if r != nil {
|
||||||
|
m = new(container.ListStreamResponse_Body)
|
||||||
|
|
||||||
|
m.SetContainerIds(refs.ContainerIDsToGRPCMessage(r.cidList))
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) FromGRPCMessage(m grpc.Message) error {
|
||||||
|
v, ok := m.(*container.ListStreamResponse_Body)
|
||||||
|
if !ok {
|
||||||
|
return message.NewUnexpectedMessageType(m, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
r.cidList, err = refs.ContainerIDsFromGRPCMessage(v.GetContainerIds())
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponse) ToGRPCMessage() grpc.Message {
|
||||||
|
var m *container.ListStreamResponse
|
||||||
|
|
||||||
|
if r != nil {
|
||||||
|
m = new(container.ListStreamResponse)
|
||||||
|
|
||||||
|
m.SetBody(r.body.ToGRPCMessage().(*container.ListStreamResponse_Body))
|
||||||
|
r.ResponseHeaders.ToMessage(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponse) FromGRPCMessage(m grpc.Message) error {
|
||||||
|
v, ok := m.(*container.ListStreamResponse)
|
||||||
|
if !ok {
|
||||||
|
return message.NewUnexpectedMessageType(m, v)
|
||||||
|
}
|
||||||
|
|
||||||
|
var err error
|
||||||
|
|
||||||
|
body := v.GetBody()
|
||||||
|
if body == nil {
|
||||||
|
r.body = nil
|
||||||
|
} else {
|
||||||
|
if r.body == nil {
|
||||||
|
r.body = new(ListStreamResponseBody)
|
||||||
|
}
|
||||||
|
|
||||||
|
err = r.body.FromGRPCMessage(body)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return r.ResponseHeaders.FromMessage(v)
|
||||||
|
}
|
||||||
|
|
1145
container/grpc/service_frostfs.pb.go
generated
1145
container/grpc/service_frostfs.pb.go
generated
File diff suppressed because it is too large
Load diff
|
@ -157,3 +157,41 @@ func DoFuzzJSONListResponse(data []byte) int {
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
func DoFuzzProtoListStreamRequest(data []byte) int {
|
||||||
|
msg := new(ListStreamRequest)
|
||||||
|
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
_ = msg.MarshalProtobuf(nil)
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
func DoFuzzJSONListStreamRequest(data []byte) int {
|
||||||
|
msg := new(ListStreamRequest)
|
||||||
|
if err := msg.UnmarshalJSON(data); err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
_, err := msg.MarshalJSON()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
func DoFuzzProtoListStreamResponse(data []byte) int {
|
||||||
|
msg := new(ListStreamResponse)
|
||||||
|
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
_ = msg.MarshalProtobuf(nil)
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
func DoFuzzJSONListStreamResponse(data []byte) int {
|
||||||
|
msg := new(ListStreamResponse)
|
||||||
|
if err := msg.UnmarshalJSON(data); err != nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
_, err := msg.MarshalJSON()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
|
@ -89,3 +89,23 @@ func FuzzJSONListResponse(f *testing.F) {
|
||||||
DoFuzzJSONListResponse(data)
|
DoFuzzJSONListResponse(data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
func FuzzProtoListStreamRequest(f *testing.F) {
|
||||||
|
f.Fuzz(func(t *testing.T, data []byte) {
|
||||||
|
DoFuzzProtoListStreamRequest(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func FuzzJSONListStreamRequest(f *testing.F) {
|
||||||
|
f.Fuzz(func(t *testing.T, data []byte) {
|
||||||
|
DoFuzzJSONListStreamRequest(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func FuzzProtoListStreamResponse(f *testing.F) {
|
||||||
|
f.Fuzz(func(t *testing.T, data []byte) {
|
||||||
|
DoFuzzProtoListStreamResponse(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
func FuzzJSONListStreamResponse(f *testing.F) {
|
||||||
|
f.Fuzz(func(t *testing.T, data []byte) {
|
||||||
|
DoFuzzJSONListStreamResponse(data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
85
container/grpc/service_grpc.pb.go
generated
85
container/grpc/service_grpc.pb.go
generated
|
@ -23,6 +23,7 @@ const (
|
||||||
ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete"
|
ContainerService_Delete_FullMethodName = "/neo.fs.v2.container.ContainerService/Delete"
|
||||||
ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get"
|
ContainerService_Get_FullMethodName = "/neo.fs.v2.container.ContainerService/Get"
|
||||||
ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List"
|
ContainerService_List_FullMethodName = "/neo.fs.v2.container.ContainerService/List"
|
||||||
|
ContainerService_ListStream_FullMethodName = "/neo.fs.v2.container.ContainerService/ListStream"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ContainerServiceClient is the client API for ContainerService service.
|
// ContainerServiceClient is the client API for ContainerService service.
|
||||||
|
@ -73,6 +74,16 @@ type ContainerServiceClient interface {
|
||||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||||
// container list access denied.
|
// container list access denied.
|
||||||
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
||||||
|
// Returns all owner's containers from 'Container` smart contract' storage
|
||||||
|
// via stream.
|
||||||
|
//
|
||||||
|
// Statuses:
|
||||||
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
// container list has been successfully read;
|
||||||
|
// - Common failures (SECTION_FAILURE_COMMON);
|
||||||
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||||
|
// container list access denied.
|
||||||
|
ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type containerServiceClient struct {
|
type containerServiceClient struct {
|
||||||
|
@ -119,6 +130,38 @@ func (c *containerServiceClient) List(ctx context.Context, in *ListRequest, opts
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *containerServiceClient) ListStream(ctx context.Context, in *ListStreamRequest, opts ...grpc.CallOption) (ContainerService_ListStreamClient, error) {
|
||||||
|
stream, err := c.cc.NewStream(ctx, &ContainerService_ServiceDesc.Streams[0], ContainerService_ListStream_FullMethodName, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
x := &containerServiceListStreamClient{stream}
|
||||||
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return x, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContainerService_ListStreamClient interface {
|
||||||
|
Recv() (*ListStreamResponse, error)
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type containerServiceListStreamClient struct {
|
||||||
|
grpc.ClientStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *containerServiceListStreamClient) Recv() (*ListStreamResponse, error) {
|
||||||
|
m := new(ListStreamResponse)
|
||||||
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
// ContainerServiceServer is the server API for ContainerService service.
|
// ContainerServiceServer is the server API for ContainerService service.
|
||||||
// All implementations should embed UnimplementedContainerServiceServer
|
// All implementations should embed UnimplementedContainerServiceServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
|
@ -167,6 +210,16 @@ type ContainerServiceServer interface {
|
||||||
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||||
// container list access denied.
|
// container list access denied.
|
||||||
List(context.Context, *ListRequest) (*ListResponse, error)
|
List(context.Context, *ListRequest) (*ListResponse, error)
|
||||||
|
// Returns all owner's containers from 'Container` smart contract' storage
|
||||||
|
// via stream.
|
||||||
|
//
|
||||||
|
// Statuses:
|
||||||
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
// container list has been successfully read;
|
||||||
|
// - Common failures (SECTION_FAILURE_COMMON);
|
||||||
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
||||||
|
// container list access denied.
|
||||||
|
ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations.
|
// UnimplementedContainerServiceServer should be embedded to have forward compatible implementations.
|
||||||
|
@ -185,6 +238,9 @@ func (UnimplementedContainerServiceServer) Get(context.Context, *GetRequest) (*G
|
||||||
func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
func (UnimplementedContainerServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedContainerServiceServer) ListStream(*ListStreamRequest, ContainerService_ListStreamServer) error {
|
||||||
|
return status.Errorf(codes.Unimplemented, "method ListStream not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeContainerServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
// Use of this interface is not recommended, as added methods to ContainerServiceServer will
|
||||||
|
@ -269,6 +325,27 @@ func _ContainerService_List_Handler(srv interface{}, ctx context.Context, dec fu
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _ContainerService_ListStream_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||||
|
m := new(ListStreamRequest)
|
||||||
|
if err := stream.RecvMsg(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return srv.(ContainerServiceServer).ListStream(m, &containerServiceListStreamServer{stream})
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContainerService_ListStreamServer interface {
|
||||||
|
Send(*ListStreamResponse) error
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
type containerServiceListStreamServer struct {
|
||||||
|
grpc.ServerStream
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *containerServiceListStreamServer) Send(m *ListStreamResponse) error {
|
||||||
|
return x.ServerStream.SendMsg(m)
|
||||||
|
}
|
||||||
|
|
||||||
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
// ContainerService_ServiceDesc is the grpc.ServiceDesc for ContainerService service.
|
||||||
// It's only intended for direct use with grpc.RegisterService,
|
// It's only intended for direct use with grpc.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
@ -293,6 +370,12 @@ var ContainerService_ServiceDesc = grpc.ServiceDesc{
|
||||||
Handler: _ContainerService_List_Handler,
|
Handler: _ContainerService_List_Handler,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{
|
||||||
|
{
|
||||||
|
StreamName: "ListStream",
|
||||||
|
Handler: _ContainerService_ListStream_Handler,
|
||||||
|
ServerStreams: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
Metadata: "container/grpc/service.proto",
|
Metadata: "container/grpc/service.proto",
|
||||||
}
|
}
|
||||||
|
|
89
container/grpc/types_frostfs.pb.go
generated
89
container/grpc/types_frostfs.pb.go
generated
|
@ -13,6 +13,7 @@ import (
|
||||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||||
jlexer "github.com/mailru/easyjson/jlexer"
|
jlexer "github.com/mailru/easyjson/jlexer"
|
||||||
jwriter "github.com/mailru/easyjson/jwriter"
|
jwriter "github.com/mailru/easyjson/jwriter"
|
||||||
|
strconv "strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Container_Attribute struct {
|
type Container_Attribute struct {
|
||||||
|
@ -115,17 +116,32 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,29 +386,64 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerID\":"
|
if x.OwnerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"nonce\":"
|
if len(x.Nonce) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"nonce\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Nonce)
|
out.Base64Bytes(x.Nonce)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"basicACL\":"
|
if x.BasicAcl != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"basicACL\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.BasicAcl)
|
out.Uint32(x.BasicAcl)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"attributes\":"
|
if len(x.Attributes) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"attributes\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Attributes {
|
for i := range x.Attributes {
|
||||||
|
@ -403,11 +454,19 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"placementPolicy\":"
|
if x.PlacementPolicy != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"placementPolicy\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.PlacementPolicy.MarshalEasyJSON(out)
|
x.PlacementPolicy.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -459,7 +518,15 @@ func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "basicACL":
|
case "basicACL":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.BasicAcl = f
|
x.BasicAcl = f
|
||||||
}
|
}
|
||||||
case "attributes":
|
case "attributes":
|
||||||
|
|
|
@ -343,3 +343,65 @@ func (r *ListResponseBody) StableSize() (size int) {
|
||||||
func (r *ListResponseBody) Unmarshal(data []byte) error {
|
func (r *ListResponseBody) Unmarshal(data []byte) error {
|
||||||
return message.Unmarshal(r, data, new(container.ListResponse_Body))
|
return message.Unmarshal(r, data, new(container.ListResponse_Body))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) StableMarshal(buf []byte) []byte {
|
||||||
|
if r == nil {
|
||||||
|
return []byte{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if buf == nil {
|
||||||
|
buf = make([]byte, r.StableSize())
|
||||||
|
}
|
||||||
|
|
||||||
|
protoutil.NestedStructureMarshal(listReqBodyOwnerField, buf, r.ownerID)
|
||||||
|
|
||||||
|
return buf
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) StableSize() (size int) {
|
||||||
|
if r == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
size += protoutil.NestedStructureSize(listReqBodyOwnerField, r.ownerID)
|
||||||
|
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) Unmarshal(data []byte) error {
|
||||||
|
return message.Unmarshal(r, data, new(container.ListStreamRequest_Body))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) StableMarshal(buf []byte) []byte {
|
||||||
|
if r == nil {
|
||||||
|
return []byte{}
|
||||||
|
}
|
||||||
|
|
||||||
|
if buf == nil {
|
||||||
|
buf = make([]byte, r.StableSize())
|
||||||
|
}
|
||||||
|
|
||||||
|
var offset int
|
||||||
|
|
||||||
|
for i := range r.cidList {
|
||||||
|
offset += protoutil.NestedStructureMarshal(listRespBodyIDsField, buf[offset:], &r.cidList[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) StableSize() (size int) {
|
||||||
|
if r == nil {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range r.cidList {
|
||||||
|
size += protoutil.NestedStructureSize(listRespBodyIDsField, &r.cidList[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) Unmarshal(data []byte) error {
|
||||||
|
return message.Unmarshal(r, data, new(container.ListStreamResponse_Body))
|
||||||
|
}
|
||||||
|
|
|
@ -109,6 +109,26 @@ type ListResponse struct {
|
||||||
session.ResponseHeaders
|
session.ResponseHeaders
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListStreamRequestBody struct {
|
||||||
|
ownerID *refs.OwnerID
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListStreamRequest struct {
|
||||||
|
body *ListStreamRequestBody
|
||||||
|
|
||||||
|
session.RequestHeaders
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListStreamResponseBody struct {
|
||||||
|
cidList []refs.ContainerID
|
||||||
|
}
|
||||||
|
|
||||||
|
type ListStreamResponse struct {
|
||||||
|
body *ListStreamResponseBody
|
||||||
|
|
||||||
|
session.ResponseHeaders
|
||||||
|
}
|
||||||
|
|
||||||
func (a *Attribute) GetKey() string {
|
func (a *Attribute) GetKey() string {
|
||||||
if a != nil {
|
if a != nil {
|
||||||
return a.key
|
return a.key
|
||||||
|
@ -444,3 +464,51 @@ func (r *ListResponse) GetBody() *ListResponseBody {
|
||||||
func (r *ListResponse) SetBody(v *ListResponseBody) {
|
func (r *ListResponse) SetBody(v *ListResponseBody) {
|
||||||
r.body = v
|
r.body = v
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) GetOwnerID() *refs.OwnerID {
|
||||||
|
if r != nil {
|
||||||
|
return r.ownerID
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequestBody) SetOwnerID(v *refs.OwnerID) {
|
||||||
|
r.ownerID = v
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequest) GetBody() *ListStreamRequestBody {
|
||||||
|
if r != nil {
|
||||||
|
return r.body
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamRequest) SetBody(v *ListStreamRequestBody) {
|
||||||
|
r.body = v
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) GetContainerIDs() []refs.ContainerID {
|
||||||
|
if r != nil {
|
||||||
|
return r.cidList
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseBody) SetContainerIDs(v []refs.ContainerID) {
|
||||||
|
r.cidList = v
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponse) GetBody() *ListStreamResponseBody {
|
||||||
|
if r != nil {
|
||||||
|
return r.body
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponse) SetBody(v *ListStreamResponseBody) {
|
||||||
|
r.body = v
|
||||||
|
}
|
||||||
|
|
12
lock/grpc/types_frostfs.pb.go
generated
12
lock/grpc/types_frostfs.pb.go
generated
|
@ -100,10 +100,17 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"members\":"
|
if len(x.Members) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"members\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Members {
|
for i := range x.Members {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -113,6 +120,7 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
225
netmap/grpc/service_frostfs.pb.go
generated
225
netmap/grpc/service_frostfs.pb.go
generated
|
@ -257,22 +257,44 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,17 +459,32 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"nodeInfo\":"
|
if x.NodeInfo != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"nodeInfo\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.NodeInfo.MarshalEasyJSON(out)
|
x.NodeInfo.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -646,22 +683,44 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -962,22 +1021,44 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1119,12 +1200,20 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"networkInfo\":"
|
if x.NetworkInfo != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"networkInfo\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.NetworkInfo.MarshalEasyJSON(out)
|
x.NetworkInfo.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1316,22 +1405,44 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1632,22 +1743,44 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1789,12 +1922,20 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"netmap\":"
|
if x.Netmap != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"netmap\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Netmap.MarshalEasyJSON(out)
|
x.Netmap.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1986,22 +2127,44 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
482
netmap/grpc/types_frostfs.pb.go
generated
482
netmap/grpc/types_frostfs.pb.go
generated
|
@ -274,29 +274,69 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"name\":"
|
if len(x.Name) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"name\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Name)
|
out.String(x.Name)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"op\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Int32(int32(x.Op))
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if x.Op != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"op\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Op)
|
||||||
|
if vv, ok := Operation_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"filters\":"
|
if len(x.Filters) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"filters\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Filters {
|
for i := range x.Filters {
|
||||||
|
@ -307,6 +347,7 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,32 +599,73 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"name\":"
|
if len(x.Name) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"name\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Name)
|
out.String(x.Name)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"count\":"
|
if x.Count != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"count\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Count)
|
out.Uint32(x.Count)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"clause\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Int32(int32(x.Clause))
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"attribute\":"
|
if x.Clause != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"clause\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Clause)
|
||||||
|
if vv, ok := Clause_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if len(x.Attribute) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"attribute\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Attribute)
|
out.String(x.Attribute)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"filter\":"
|
if len(x.Filter) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"filter\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Filter)
|
out.String(x.Filter)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -621,7 +703,15 @@ func (x *Selector) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "count":
|
case "count":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Count = f
|
x.Count = f
|
||||||
}
|
}
|
||||||
case "clause":
|
case "clause":
|
||||||
|
@ -807,27 +897,56 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"count\":"
|
if x.Count != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"count\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Count)
|
out.Uint32(x.Count)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"selector\":"
|
if len(x.Selector) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"selector\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Selector)
|
out.String(x.Selector)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ecDataCount\":"
|
if x.EcDataCount != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ecDataCount\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.EcDataCount)
|
out.Uint32(x.EcDataCount)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ecParityCount\":"
|
if x.EcParityCount != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ecParityCount\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.EcParityCount)
|
out.Uint32(x.EcParityCount)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -859,7 +978,15 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "count":
|
case "count":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Count = f
|
x.Count = f
|
||||||
}
|
}
|
||||||
case "selector":
|
case "selector":
|
||||||
|
@ -871,13 +998,29 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "ecDataCount":
|
case "ecDataCount":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.EcDataCount = f
|
x.EcDataCount = f
|
||||||
}
|
}
|
||||||
case "ecParityCount":
|
case "ecParityCount":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.EcParityCount = f
|
x.EcParityCount = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1067,10 +1210,17 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"replicas\":"
|
if len(x.Replicas) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"replicas\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Replicas {
|
for i := range x.Replicas {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -1080,13 +1230,27 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"containerBackupFactor\":"
|
if x.ContainerBackupFactor != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"containerBackupFactor\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.ContainerBackupFactor)
|
out.Uint32(x.ContainerBackupFactor)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"selectors\":"
|
if len(x.Selectors) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"selectors\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Selectors {
|
for i := range x.Selectors {
|
||||||
|
@ -1097,8 +1261,15 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"filters\":"
|
if len(x.Filters) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"filters\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Filters {
|
for i := range x.Filters {
|
||||||
|
@ -1109,11 +1280,19 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"unique\":"
|
if x.Unique {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"unique\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Bool(x.Unique)
|
out.Bool(x.Unique)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1159,7 +1338,15 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "containerBackupFactor":
|
case "containerBackupFactor":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.ContainerBackupFactor = f
|
x.ContainerBackupFactor = f
|
||||||
}
|
}
|
||||||
case "selectors":
|
case "selectors":
|
||||||
|
@ -1363,19 +1550,40 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parents\":"
|
if len(x.Parents) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parents\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Parents {
|
for i := range x.Parents {
|
||||||
|
@ -1386,6 +1594,7 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1594,14 +1803,28 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"publicKey\":"
|
if len(x.PublicKey) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"publicKey\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.PublicKey)
|
out.Base64Bytes(x.PublicKey)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"addresses\":"
|
if len(x.Addresses) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"addresses\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Addresses {
|
for i := range x.Addresses {
|
||||||
|
@ -1612,8 +1835,15 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"attributes\":"
|
if len(x.Attributes) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"attributes\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Attributes {
|
for i := range x.Attributes {
|
||||||
|
@ -1624,10 +1854,23 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"state\":"
|
if x.State != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"state\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(int32(x.State))
|
v := int32(x.State)
|
||||||
|
if vv, ok := NodeInfo_State_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -1827,14 +2070,30 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"epoch\":"
|
if x.Epoch != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Uint64(x.Epoch)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"epoch\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"nodes\":"
|
if len(x.Nodes) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"nodes\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Nodes {
|
for i := range x.Nodes {
|
||||||
|
@ -1845,6 +2104,7 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1876,7 +2136,15 @@ func (x *Netmap) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "epoch":
|
case "epoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Epoch = f
|
x.Epoch = f
|
||||||
}
|
}
|
||||||
case "nodes":
|
case "nodes":
|
||||||
|
@ -2002,17 +2270,32 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Key)
|
out.Base64Bytes(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Value)
|
out.Base64Bytes(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2148,10 +2431,17 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parameters\":"
|
if len(x.Parameters) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parameters\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Parameters {
|
for i := range x.Parameters {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -2161,6 +2451,7 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2355,27 +2646,62 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"currentEpoch\":"
|
if x.CurrentEpoch != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Uint64(x.CurrentEpoch)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
}
|
}
|
||||||
{
|
const prefix string = "\"currentEpoch\":"
|
||||||
const prefix string = ",\"magicNumber\":"
|
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.MagicNumber)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"msPerBlock\":"
|
if x.MagicNumber != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"magicNumber\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int64(x.MsPerBlock)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"networkConfig\":"
|
if x.MsPerBlock != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"msPerBlock\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.NetworkConfig != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"networkConfig\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.NetworkConfig.MarshalEasyJSON(out)
|
x.NetworkConfig.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2407,19 +2733,43 @@ func (x *NetworkInfo) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "currentEpoch":
|
case "currentEpoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.CurrentEpoch = f
|
x.CurrentEpoch = f
|
||||||
}
|
}
|
||||||
case "magicNumber":
|
case "magicNumber":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.MagicNumber = f
|
x.MagicNumber = f
|
||||||
}
|
}
|
||||||
case "msPerBlock":
|
case "msPerBlock":
|
||||||
{
|
{
|
||||||
var f int64
|
var f int64
|
||||||
f = in.Int64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int64(v)
|
||||||
|
f = pv
|
||||||
x.MsPerBlock = f
|
x.MsPerBlock = f
|
||||||
}
|
}
|
||||||
case "networkConfig":
|
case "networkConfig":
|
||||||
|
|
1219
object/grpc/service_frostfs.pb.go
generated
1219
object/grpc/service_frostfs.pb.go
generated
File diff suppressed because it is too large
Load diff
577
object/grpc/types_frostfs.pb.go
generated
577
object/grpc/types_frostfs.pb.go
generated
|
@ -304,42 +304,101 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"creationEpoch\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Uint64(x.CreationEpoch)
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerID\":"
|
if x.CreationEpoch != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"creationEpoch\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.OwnerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"objectType\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Int32(int32(x.ObjectType))
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"payloadLength\":"
|
if x.ObjectType != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"objectType\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.PayloadLength)
|
v := int32(x.ObjectType)
|
||||||
|
if vv, ok := ObjectType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"payloadHash\":"
|
if x.PayloadLength != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"payloadLength\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.PayloadHash != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"payloadHash\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.PayloadHash.MarshalEasyJSON(out)
|
x.PayloadHash.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"homomorphicHash\":"
|
if x.HomomorphicHash != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"homomorphicHash\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.HomomorphicHash.MarshalEasyJSON(out)
|
x.HomomorphicHash.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,7 +437,15 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "creationEpoch":
|
case "creationEpoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.CreationEpoch = f
|
x.CreationEpoch = f
|
||||||
}
|
}
|
||||||
case "ownerID":
|
case "ownerID":
|
||||||
|
@ -413,7 +480,15 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "payloadLength":
|
case "payloadLength":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.PayloadLength = f
|
x.PayloadLength = f
|
||||||
}
|
}
|
||||||
case "payloadHash":
|
case "payloadHash":
|
||||||
|
@ -539,17 +614,32 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,29 +887,64 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parent\":"
|
if x.Parent != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parent\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Parent.MarshalEasyJSON(out)
|
x.Parent.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"previous\":"
|
if x.Previous != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"previous\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Previous.MarshalEasyJSON(out)
|
x.Previous.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parentSignature\":"
|
if x.ParentSignature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parentSignature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ParentSignature.MarshalEasyJSON(out)
|
x.ParentSignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parentHeader\":"
|
if x.ParentHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parentHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ParentHeader.MarshalEasyJSON(out)
|
x.ParentHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"children\":"
|
if len(x.Children) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"children\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Children {
|
for i := range x.Children {
|
||||||
|
@ -830,11 +955,19 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"splitID\":"
|
if len(x.SplitId) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"splitID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.SplitId)
|
out.Base64Bytes(x.SplitId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1152,44 +1285,100 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parent\":"
|
if x.Parent != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parent\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Parent.MarshalEasyJSON(out)
|
x.Parent.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"index\":"
|
if x.Index != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"index\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Index)
|
out.Uint32(x.Index)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"total\":"
|
if x.Total != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"total\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Total)
|
out.Uint32(x.Total)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"headerLength\":"
|
if x.HeaderLength != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"headerLength\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.HeaderLength)
|
out.Uint32(x.HeaderLength)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"header\":"
|
if len(x.Header) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"header\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Header)
|
out.Base64Bytes(x.Header)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parentSplitID\":"
|
if len(x.ParentSplitId) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parentSplitID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.ParentSplitId)
|
out.Base64Bytes(x.ParentSplitId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parentSplitParentID\":"
|
if x.ParentSplitParentId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parentSplitParentID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ParentSplitParentId.MarshalEasyJSON(out)
|
x.ParentSplitParentId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"parentAttributes\":"
|
if len(x.ParentAttributes) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"parentAttributes\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.ParentAttributes {
|
for i := range x.ParentAttributes {
|
||||||
|
@ -1200,6 +1389,7 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1238,19 +1428,43 @@ func (x *Header_EC) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "index":
|
case "index":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Index = f
|
x.Index = f
|
||||||
}
|
}
|
||||||
case "total":
|
case "total":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Total = f
|
x.Total = f
|
||||||
}
|
}
|
||||||
case "headerLength":
|
case "headerLength":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.HeaderLength = f
|
x.HeaderLength = f
|
||||||
}
|
}
|
||||||
case "header":
|
case "header":
|
||||||
|
@ -1625,54 +1839,133 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"containerID\":"
|
if x.ContainerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"containerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ContainerId.MarshalEasyJSON(out)
|
x.ContainerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerID\":"
|
if x.OwnerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"creationEpoch\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Uint64(x.CreationEpoch)
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"payloadLength\":"
|
if x.CreationEpoch != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"creationEpoch\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.PayloadLength)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"payloadHash\":"
|
if x.PayloadLength != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"payloadLength\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.PayloadHash != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"payloadHash\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.PayloadHash.MarshalEasyJSON(out)
|
x.PayloadHash.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"objectType\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Int32(int32(x.ObjectType))
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"homomorphicHash\":"
|
if x.ObjectType != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"objectType\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.ObjectType)
|
||||||
|
if vv, ok := ObjectType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.HomomorphicHash != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"homomorphicHash\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.HomomorphicHash.MarshalEasyJSON(out)
|
x.HomomorphicHash.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"sessionToken\":"
|
if x.SessionToken != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"sessionToken\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.SessionToken.MarshalEasyJSON(out)
|
x.SessionToken.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"attributes\":"
|
if len(x.Attributes) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"attributes\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Attributes {
|
for i := range x.Attributes {
|
||||||
|
@ -1683,16 +1976,31 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"split\":"
|
if x.Split != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"split\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Split.MarshalEasyJSON(out)
|
x.Split.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ec\":"
|
if x.Ec != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ec\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Ec.MarshalEasyJSON(out)
|
x.Ec.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1745,13 +2053,29 @@ func (x *Header) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "creationEpoch":
|
case "creationEpoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.CreationEpoch = f
|
x.CreationEpoch = f
|
||||||
}
|
}
|
||||||
case "payloadLength":
|
case "payloadLength":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.PayloadLength = f
|
x.PayloadLength = f
|
||||||
}
|
}
|
||||||
case "payloadHash":
|
case "payloadHash":
|
||||||
|
@ -1983,27 +2307,56 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"objectID\":"
|
if x.ObjectId != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"objectID\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.ObjectId.MarshalEasyJSON(out)
|
x.ObjectId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"signature\":"
|
if x.Signature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"signature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Signature.MarshalEasyJSON(out)
|
x.Signature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"header\":"
|
if x.Header != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"header\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Header.MarshalEasyJSON(out)
|
x.Header.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"payload\":"
|
if len(x.Payload) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"payload\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Payload)
|
out.Base64Bytes(x.Payload)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2194,22 +2547,44 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"splitId\":"
|
if len(x.SplitId) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"splitId\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.SplitId)
|
out.Base64Bytes(x.SplitId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"lastPart\":"
|
if x.LastPart != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"lastPart\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.LastPart.MarshalEasyJSON(out)
|
x.LastPart.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"link\":"
|
if x.Link != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"link\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Link.MarshalEasyJSON(out)
|
x.Link.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2390,22 +2765,44 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"id\":"
|
if x.Id != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"id\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Id.MarshalEasyJSON(out)
|
x.Id.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"index\":"
|
if x.Index != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"index\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Index)
|
out.Uint32(x.Index)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"total\":"
|
if x.Total != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"total\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Total)
|
out.Uint32(x.Total)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2444,13 +2841,29 @@ func (x *ECInfo_Chunk) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "index":
|
case "index":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Index = f
|
x.Index = f
|
||||||
}
|
}
|
||||||
case "total":
|
case "total":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Total = f
|
x.Total = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2548,10 +2961,17 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"chunks\":"
|
if len(x.Chunks) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"chunks\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Chunks {
|
for i := range x.Chunks {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
|
@ -2561,6 +2981,7 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
184
refs/grpc/types_frostfs.pb.go
generated
184
refs/grpc/types_frostfs.pb.go
generated
|
@ -190,17 +190,32 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"containerID\":"
|
if x.ContainerId != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"containerID\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.ContainerId.MarshalEasyJSON(out)
|
x.ContainerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"objectID\":"
|
if x.ObjectId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"objectID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ObjectId.MarshalEasyJSON(out)
|
x.ObjectId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,12 +347,20 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Value)
|
out.Base64Bytes(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,12 +484,20 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Value)
|
out.Base64Bytes(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,12 +621,20 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Value)
|
out.Base64Bytes(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,17 +778,32 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"major\":"
|
if x.Major != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"major\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Major)
|
out.Uint32(x.Major)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"minor\":"
|
if x.Minor != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"minor\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Minor)
|
out.Uint32(x.Minor)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -781,13 +835,29 @@ func (x *Version) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "major":
|
case "major":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Major = f
|
x.Major = f
|
||||||
}
|
}
|
||||||
case "minor":
|
case "minor":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Minor = f
|
x.Minor = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -919,21 +989,48 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Key)
|
out.Base64Bytes(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"signature\":"
|
if len(x.Sign) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"signature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Sign)
|
out.Base64Bytes(x.Sign)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"scheme\":"
|
if x.Scheme != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"scheme\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(int32(x.Scheme))
|
v := int32(x.Scheme)
|
||||||
|
if vv, ok := SignatureScheme_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -1106,17 +1203,32 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Key)
|
out.Base64Bytes(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"signature\":"
|
if len(x.Sign) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"signature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Sign)
|
out.Base64Bytes(x.Sign)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1266,17 +1378,37 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"type\":"
|
if x.Type != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Type))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"type\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Type)
|
||||||
|
if vv, ok := ChecksumType_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"sum\":"
|
if len(x.Sum) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"sum\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Sum)
|
out.Base64Bytes(x.Sum)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ const (
|
||||||
rpcContainerGet = "Get"
|
rpcContainerGet = "Get"
|
||||||
rpcContainerDel = "Delete"
|
rpcContainerDel = "Delete"
|
||||||
rpcContainerList = "List"
|
rpcContainerList = "List"
|
||||||
|
rpcContainerStream = "ListStream"
|
||||||
rpcContainerGetEACL = "GetExtendedACL"
|
rpcContainerGetEACL = "GetExtendedACL"
|
||||||
rpcContainerUsedSpace = "AnnounceUsedSpace"
|
rpcContainerUsedSpace = "AnnounceUsedSpace"
|
||||||
)
|
)
|
||||||
|
@ -80,3 +81,27 @@ func ListContainers(
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ListStreamResponseReader struct {
|
||||||
|
r client.MessageReader
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *ListStreamResponseReader) Read(resp *container.ListStreamResponse) error {
|
||||||
|
return r.r.ReadMessage(resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ListContainersStream executes ContainerService.ListStream RPC.
|
||||||
|
func ListContainersStream(
|
||||||
|
cli *client.Client,
|
||||||
|
req *container.ListStreamRequest,
|
||||||
|
opts ...client.CallOption,
|
||||||
|
) (*ListStreamResponseReader, error) {
|
||||||
|
wc, err := client.OpenServerStream(cli, common.CallMethodInfoServerStream(serviceContainer, rpcContainerList), req, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &ListStreamResponseReader{
|
||||||
|
r: wc,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
|
117
session/grpc/service_frostfs.pb.go
generated
117
session/grpc/service_frostfs.pb.go
generated
|
@ -12,6 +12,7 @@ import (
|
||||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||||
jlexer "github.com/mailru/easyjson/jlexer"
|
jlexer "github.com/mailru/easyjson/jlexer"
|
||||||
jwriter "github.com/mailru/easyjson/jwriter"
|
jwriter "github.com/mailru/easyjson/jwriter"
|
||||||
|
strconv "strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CreateRequest_Body struct {
|
type CreateRequest_Body struct {
|
||||||
|
@ -117,16 +118,33 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerId\":"
|
if x.OwnerId != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerId\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"expiration\":"
|
if x.Expiration != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"expiration\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.Expiration)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -166,7 +184,15 @@ func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "expiration":
|
case "expiration":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Expiration = f
|
x.Expiration = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,22 +351,44 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,17 +547,32 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"id\":"
|
if len(x.Id) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"id\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Id)
|
out.Base64Bytes(x.Id)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"sessionKey\":"
|
if len(x.SessionKey) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"sessionKey\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.SessionKey)
|
out.Base64Bytes(x.SessionKey)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,22 +769,44 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaHeader\":"
|
if x.MetaHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaHeader.MarshalEasyJSON(out)
|
x.MetaHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verifyHeader\":"
|
if x.VerifyHeader != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verifyHeader\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.VerifyHeader.MarshalEasyJSON(out)
|
x.VerifyHeader.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
537
session/grpc/types_frostfs.pb.go
generated
537
session/grpc/types_frostfs.pb.go
generated
|
@ -179,14 +179,28 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"container\":"
|
if x.Container != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"container\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Container.MarshalEasyJSON(out)
|
x.Container.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"objects\":"
|
if len(x.Objects) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"objects\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Objects {
|
for i := range x.Objects {
|
||||||
|
@ -197,6 +211,7 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,17 +373,37 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verb\":"
|
if x.Verb != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Verb))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verb\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Verb)
|
||||||
|
if vv, ok := ObjectSessionContext_Verb_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"target\":"
|
if x.Target != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"target\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Target.MarshalEasyJSON(out)
|
x.Target.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -596,22 +631,49 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"verb\":"
|
if x.Verb != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Int32(int32(x.Verb))
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"verb\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
v := int32(x.Verb)
|
||||||
|
if vv, ok := ContainerSessionContext_Verb_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"wildcard\":"
|
if x.Wildcard {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"wildcard\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Bool(x.Wildcard)
|
out.Bool(x.Wildcard)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"containerID\":"
|
if x.ContainerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"containerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.ContainerId.MarshalEasyJSON(out)
|
x.ContainerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -804,21 +866,49 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"exp\":"
|
if x.Exp != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Uint64(x.Exp)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"exp\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Exp, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"nbf\":"
|
if x.Nbf != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"nbf\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.Nbf)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"iat\":"
|
if x.Iat != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"iat\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.Iat)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -851,19 +941,43 @@ func (x *SessionToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "exp":
|
case "exp":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Exp = f
|
x.Exp = f
|
||||||
}
|
}
|
||||||
case "nbf":
|
case "nbf":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Nbf = f
|
x.Nbf = f
|
||||||
}
|
}
|
||||||
case "iat":
|
case "iat":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Iat = f
|
x.Iat = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1085,41 +1199,84 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"id\":"
|
if len(x.Id) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"id\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Id)
|
out.Base64Bytes(x.Id)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ownerID\":"
|
if x.OwnerId != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ownerID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OwnerId.MarshalEasyJSON(out)
|
x.OwnerId.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"lifetime\":"
|
if x.Lifetime != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"lifetime\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Lifetime.MarshalEasyJSON(out)
|
x.Lifetime.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"sessionKey\":"
|
if len(x.SessionKey) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"sessionKey\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.SessionKey)
|
out.Base64Bytes(x.SessionKey)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
switch xx := x.Context.(type) {
|
switch xx := x.Context.(type) {
|
||||||
case *SessionToken_Body_Object:
|
case *SessionToken_Body_Object:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"object\":"
|
if xx.Object != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"object\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
xx.Object.MarshalEasyJSON(out)
|
xx.Object.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
case *SessionToken_Body_Container:
|
case *SessionToken_Body_Container:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"container\":"
|
if xx.Container != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"container\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
xx.Container.MarshalEasyJSON(out)
|
xx.Container.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1323,17 +1480,32 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"body\":"
|
if x.Body != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"body\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Body.MarshalEasyJSON(out)
|
x.Body.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"signature\":"
|
if x.Signature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"signature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Signature.MarshalEasyJSON(out)
|
x.Signature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1485,17 +1657,32 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"key\":"
|
if len(x.Key) != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"key\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.String(x.Key)
|
out.String(x.Key)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Value)
|
out.String(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1783,24 +1970,54 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"epoch\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Uint64(x.Epoch)
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ttl\":"
|
if x.Epoch != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"epoch\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.Ttl != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ttl\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Ttl)
|
out.Uint32(x.Ttl)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"xHeaders\":"
|
if len(x.XHeaders) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"xHeaders\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.XHeaders {
|
for i := range x.XHeaders {
|
||||||
|
@ -1811,25 +2028,56 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"sessionToken\":"
|
if x.SessionToken != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"sessionToken\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.SessionToken.MarshalEasyJSON(out)
|
x.SessionToken.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"bearerToken\":"
|
if x.BearerToken != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"bearerToken\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.BearerToken.MarshalEasyJSON(out)
|
x.BearerToken.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"origin\":"
|
if x.Origin != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"origin\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Origin.MarshalEasyJSON(out)
|
x.Origin.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"magicNumber\":"
|
if x.MagicNumber != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"magicNumber\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.MagicNumber)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
@ -1869,13 +2117,29 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "epoch":
|
case "epoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Epoch = f
|
x.Epoch = f
|
||||||
}
|
}
|
||||||
case "ttl":
|
case "ttl":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Ttl = f
|
x.Ttl = f
|
||||||
}
|
}
|
||||||
case "xHeaders":
|
case "xHeaders":
|
||||||
|
@ -1916,7 +2180,15 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "magicNumber":
|
case "magicNumber":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.MagicNumber = f
|
x.MagicNumber = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2123,24 +2395,54 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"version\":"
|
if x.Version != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"version\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.Version.MarshalEasyJSON(out)
|
x.Version.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
const prefix string = ",\"epoch\":"
|
|
||||||
out.RawString(prefix)
|
|
||||||
out.Uint64(x.Epoch)
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"ttl\":"
|
if x.Epoch != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"epoch\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
if x.Ttl != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"ttl\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Ttl)
|
out.Uint32(x.Ttl)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"xHeaders\":"
|
if len(x.XHeaders) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"xHeaders\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.XHeaders {
|
for i := range x.XHeaders {
|
||||||
|
@ -2151,16 +2453,31 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"origin\":"
|
if x.Origin != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"origin\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Origin.MarshalEasyJSON(out)
|
x.Origin.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"status\":"
|
if x.Status != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"status\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Status.MarshalEasyJSON(out)
|
x.Status.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2199,13 +2516,29 @@ func (x *ResponseMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "epoch":
|
case "epoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.Epoch = f
|
x.Epoch = f
|
||||||
}
|
}
|
||||||
case "ttl":
|
case "ttl":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Ttl = f
|
x.Ttl = f
|
||||||
}
|
}
|
||||||
case "xHeaders":
|
case "xHeaders":
|
||||||
|
@ -2397,27 +2730,56 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"bodySignature\":"
|
if x.BodySignature != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"bodySignature\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.BodySignature.MarshalEasyJSON(out)
|
x.BodySignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaSignature\":"
|
if x.MetaSignature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaSignature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaSignature.MarshalEasyJSON(out)
|
x.MetaSignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"originSignature\":"
|
if x.OriginSignature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"originSignature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OriginSignature.MarshalEasyJSON(out)
|
x.OriginSignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"origin\":"
|
if x.Origin != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"origin\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Origin.MarshalEasyJSON(out)
|
x.Origin.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2635,27 +2997,56 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"bodySignature\":"
|
if x.BodySignature != nil {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"bodySignature\":"
|
||||||
|
out.RawString(prefix)
|
||||||
x.BodySignature.MarshalEasyJSON(out)
|
x.BodySignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"metaSignature\":"
|
if x.MetaSignature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"metaSignature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.MetaSignature.MarshalEasyJSON(out)
|
x.MetaSignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"originSignature\":"
|
if x.OriginSignature != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"originSignature\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.OriginSignature.MarshalEasyJSON(out)
|
x.OriginSignature.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"origin\":"
|
if x.Origin != nil {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"origin\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
x.Origin.MarshalEasyJSON(out)
|
x.Origin.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ func serviceMessageBody(req any) stableMarshaler {
|
||||||
return v.GetBody()
|
return v.GetBody()
|
||||||
case *container.ListResponse:
|
case *container.ListResponse:
|
||||||
return v.GetBody()
|
return v.GetBody()
|
||||||
|
case *container.ListStreamRequest:
|
||||||
|
return v.GetBody()
|
||||||
|
case *container.ListStreamResponse:
|
||||||
|
return v.GetBody()
|
||||||
|
|
||||||
/* Object */
|
/* Object */
|
||||||
case *object.PutRequest:
|
case *object.PutRequest:
|
||||||
|
|
71
status/grpc/types_frostfs.pb.go
generated
71
status/grpc/types_frostfs.pb.go
generated
|
@ -368,17 +368,32 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"id\":"
|
if x.Id != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"id\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Id)
|
out.Uint32(x.Id)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"value\":"
|
if len(x.Value) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"value\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.Value)
|
out.Base64Bytes(x.Value)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +425,15 @@ func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "id":
|
case "id":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Id = f
|
x.Id = f
|
||||||
}
|
}
|
||||||
case "value":
|
case "value":
|
||||||
|
@ -554,19 +577,40 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"code\":"
|
if x.Code != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"code\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.Code)
|
out.Uint32(x.Code)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"message\":"
|
if len(x.Message) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"message\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.Message)
|
out.String(x.Message)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"details\":"
|
if len(x.Details) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"details\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Details {
|
for i := range x.Details {
|
||||||
|
@ -577,6 +621,7 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +653,15 @@ func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "code":
|
case "code":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.Code = f
|
x.Code = f
|
||||||
}
|
}
|
||||||
case "message":
|
case "message":
|
||||||
|
|
45
tombstone/grpc/types_frostfs.pb.go
generated
45
tombstone/grpc/types_frostfs.pb.go
generated
|
@ -12,6 +12,7 @@ import (
|
||||||
easyproto "github.com/VictoriaMetrics/easyproto"
|
easyproto "github.com/VictoriaMetrics/easyproto"
|
||||||
jlexer "github.com/mailru/easyjson/jlexer"
|
jlexer "github.com/mailru/easyjson/jlexer"
|
||||||
jwriter "github.com/mailru/easyjson/jwriter"
|
jwriter "github.com/mailru/easyjson/jwriter"
|
||||||
|
strconv "strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tombstone struct {
|
type Tombstone struct {
|
||||||
|
@ -140,19 +141,42 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"expirationEpoch\":"
|
if x.ExpirationEpoch != 0 {
|
||||||
out.RawString(prefix[1:])
|
if !first {
|
||||||
out.Uint64(x.ExpirationEpoch)
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"expirationEpoch\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.ExpirationEpoch, 10)
|
||||||
|
out.RawByte('"')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"splitID\":"
|
if len(x.SplitId) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"splitID\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Base64Bytes(x.SplitId)
|
out.Base64Bytes(x.SplitId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"members\":"
|
if len(x.Members) != 0 {
|
||||||
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"members\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.Members {
|
for i := range x.Members {
|
||||||
|
@ -163,6 +187,7 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,7 +219,15 @@ func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "expirationEpoch":
|
case "expirationEpoch":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.ExpirationEpoch = f
|
x.ExpirationEpoch = f
|
||||||
}
|
}
|
||||||
case "splitID":
|
case "splitID":
|
||||||
|
|
|
@ -26,12 +26,35 @@ func nonZero[T protoInt]() T {
|
||||||
|
|
||||||
func TestStableMarshalSingle(t *testing.T) {
|
func TestStableMarshalSingle(t *testing.T) {
|
||||||
t.Run("empty", func(t *testing.T) {
|
t.Run("empty", func(t *testing.T) {
|
||||||
|
t.Run("proto", func(t *testing.T) {
|
||||||
input := &generated.Primitives{}
|
input := &generated.Primitives{}
|
||||||
require.Zero(t, input.StableSize())
|
require.Zero(t, input.StableSize())
|
||||||
|
|
||||||
r := input.MarshalProtobuf(nil)
|
r := input.MarshalProtobuf(nil)
|
||||||
require.Empty(t, r)
|
require.Empty(t, r)
|
||||||
})
|
})
|
||||||
|
t.Run("json", func(t *testing.T) {
|
||||||
|
input := &generated.Primitives{}
|
||||||
|
r, err := input.MarshalJSON()
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.NotEmpty(t, r)
|
||||||
|
|
||||||
|
var actual test.Primitives
|
||||||
|
require.NoError(t, protojson.Unmarshal(r, &actual))
|
||||||
|
|
||||||
|
t.Run("protojson compatibility", func(t *testing.T) {
|
||||||
|
data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.JSONEq(t, string(data), string(r))
|
||||||
|
})
|
||||||
|
|
||||||
|
var actualFrostfs generated.Primitives
|
||||||
|
require.NoError(t, actualFrostfs.UnmarshalJSON(r))
|
||||||
|
require.Equal(t, input, &actualFrostfs)
|
||||||
|
|
||||||
|
primitivesEqual(t, input, &actual)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
marshalCases := []struct {
|
marshalCases := []struct {
|
||||||
name string
|
name string
|
||||||
|
@ -77,8 +100,7 @@ func TestStableMarshalSingle(t *testing.T) {
|
||||||
require.NoError(t, protojson.Unmarshal(r, &actual))
|
require.NoError(t, protojson.Unmarshal(r, &actual))
|
||||||
|
|
||||||
t.Run("protojson compatibility", func(t *testing.T) {
|
t.Run("protojson compatibility", func(t *testing.T) {
|
||||||
t.Skip()
|
data, err := protojson.MarshalOptions{EmitUnpopulated: true}.Marshal(&actual)
|
||||||
data, err := protojson.Marshal(&actual)
|
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.JSONEq(t, string(data), string(r))
|
require.JSONEq(t, string(data), string(r))
|
||||||
})
|
})
|
||||||
|
@ -95,6 +117,7 @@ func TestStableMarshalSingle(t *testing.T) {
|
||||||
|
|
||||||
func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) {
|
func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) {
|
||||||
// Compare each field directly, because proto-generated code has private fields.
|
// Compare each field directly, because proto-generated code has private fields.
|
||||||
|
require.Equal(t, len(a.FieldA), len(b.FieldA))
|
||||||
require.Equal(t, a.FieldA, b.FieldA)
|
require.Equal(t, a.FieldA, b.FieldA)
|
||||||
require.Equal(t, a.FieldB, b.FieldB)
|
require.Equal(t, a.FieldB, b.FieldB)
|
||||||
require.Equal(t, a.FieldC, b.FieldC)
|
require.Equal(t, a.FieldC, b.FieldC)
|
||||||
|
|
387
util/proto/test/custom/test_frostfs.pb.go
generated
387
util/proto/test/custom/test_frostfs.pb.go
generated
|
@ -130,10 +130,16 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"innerField\":"
|
if !first {
|
||||||
out.RawString(prefix[1:])
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"innerField\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.InnerField)
|
out.Uint32(x.InnerField)
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
|
@ -167,7 +173,15 @@ func (x *Primitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "innerField":
|
case "innerField":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.InnerField = f
|
x.InnerField = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,78 +574,168 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldA\":"
|
if !first {
|
||||||
out.RawString(prefix[1:])
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldA\":"
|
||||||
|
out.RawString(prefix)
|
||||||
|
if x.FieldA != nil {
|
||||||
out.Base64Bytes(x.FieldA)
|
out.Base64Bytes(x.FieldA)
|
||||||
|
} else {
|
||||||
|
out.String("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldB\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldB\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.String(x.FieldB)
|
out.String(x.FieldB)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldC\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldC\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Bool(x.FieldC)
|
out.Bool(x.FieldC)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldD\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldD\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(x.FieldD)
|
out.Int32(x.FieldD)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldE\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldE\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.FieldE)
|
out.Uint32(x.FieldE)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldF\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldF\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int64(x.FieldF)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldG\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldG\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.FieldG)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldI\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldI\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint64(x.FieldI)
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldJ\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldJ\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Float64(x.FieldJ)
|
out.Float64(x.FieldJ)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldK\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldK\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(x.FieldK)
|
out.Uint32(x.FieldK)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldH\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldH\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Int32(int32(x.FieldH))
|
v := int32(x.FieldH)
|
||||||
|
if vv, ok := Primitives_SomeEnum_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch xx := x.FieldM.(type) {
|
switch xx := x.FieldM.(type) {
|
||||||
case *Primitives_FieldMa:
|
case *Primitives_FieldMa:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldMa\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldMa\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
|
if xx.FieldMa != nil {
|
||||||
out.Base64Bytes(xx.FieldMa)
|
out.Base64Bytes(xx.FieldMa)
|
||||||
|
} else {
|
||||||
|
out.String("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case *Primitives_FieldMe:
|
case *Primitives_FieldMe:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldMe\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldMe\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.Uint32(xx.FieldMe)
|
out.Uint32(xx.FieldMe)
|
||||||
}
|
}
|
||||||
case *Primitives_FieldAux:
|
case *Primitives_FieldAux:
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldAux\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldAux\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
xx.FieldAux.MarshalEasyJSON(out)
|
xx.FieldAux.MarshalEasyJSON(out)
|
||||||
}
|
}
|
||||||
|
@ -667,7 +771,13 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "fieldA":
|
case "fieldA":
|
||||||
{
|
{
|
||||||
var f []byte
|
var f []byte
|
||||||
f = in.Bytes()
|
{
|
||||||
|
tmp := in.Bytes()
|
||||||
|
if len(tmp) == 0 {
|
||||||
|
tmp = nil
|
||||||
|
}
|
||||||
|
f = tmp
|
||||||
|
}
|
||||||
x.FieldA = f
|
x.FieldA = f
|
||||||
}
|
}
|
||||||
case "fieldB":
|
case "fieldB":
|
||||||
|
@ -685,31 +795,71 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "fieldD":
|
case "fieldD":
|
||||||
{
|
{
|
||||||
var f int32
|
var f int32
|
||||||
f = in.Int32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int32(v)
|
||||||
|
f = pv
|
||||||
x.FieldD = f
|
x.FieldD = f
|
||||||
}
|
}
|
||||||
case "fieldE":
|
case "fieldE":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.FieldE = f
|
x.FieldE = f
|
||||||
}
|
}
|
||||||
case "fieldF":
|
case "fieldF":
|
||||||
{
|
{
|
||||||
var f int64
|
var f int64
|
||||||
f = in.Int64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int64(v)
|
||||||
|
f = pv
|
||||||
x.FieldF = f
|
x.FieldF = f
|
||||||
}
|
}
|
||||||
case "fieldG":
|
case "fieldG":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.FieldG = f
|
x.FieldG = f
|
||||||
}
|
}
|
||||||
case "fieldI":
|
case "fieldI":
|
||||||
{
|
{
|
||||||
var f uint64
|
var f uint64
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
x.FieldI = f
|
x.FieldI = f
|
||||||
}
|
}
|
||||||
case "fieldJ":
|
case "fieldJ":
|
||||||
|
@ -721,7 +871,15 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "fieldK":
|
case "fieldK":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.FieldK = f
|
x.FieldK = f
|
||||||
}
|
}
|
||||||
case "fieldH":
|
case "fieldH":
|
||||||
|
@ -751,7 +909,13 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
x.FieldM = xx
|
x.FieldM = xx
|
||||||
{
|
{
|
||||||
var f []byte
|
var f []byte
|
||||||
f = in.Bytes()
|
{
|
||||||
|
tmp := in.Bytes()
|
||||||
|
if len(tmp) == 0 {
|
||||||
|
tmp = nil
|
||||||
|
}
|
||||||
|
f = tmp
|
||||||
|
}
|
||||||
xx.FieldMa = f
|
xx.FieldMa = f
|
||||||
}
|
}
|
||||||
case "fieldMe":
|
case "fieldMe":
|
||||||
|
@ -759,7 +923,15 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
x.FieldM = xx
|
x.FieldM = xx
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
xx.FieldMe = f
|
xx.FieldMe = f
|
||||||
}
|
}
|
||||||
case "fieldAux":
|
case "fieldAux":
|
||||||
|
@ -882,10 +1054,16 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"innerField\":"
|
if !first {
|
||||||
out.RawString(prefix[1:])
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"innerField\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.Uint32(x.InnerField)
|
out.Uint32(x.InnerField)
|
||||||
}
|
}
|
||||||
out.RawByte('}')
|
out.RawByte('}')
|
||||||
|
@ -919,7 +1097,15 @@ func (x *RepPrimitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
case "innerField":
|
case "innerField":
|
||||||
{
|
{
|
||||||
var f uint32
|
var f uint32
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
x.InnerField = f
|
x.InnerField = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1164,21 +1350,36 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawString("null")
|
out.RawString("null")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
first := true
|
||||||
out.RawByte('{')
|
out.RawByte('{')
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldA\":"
|
if !first {
|
||||||
out.RawString(prefix[1:])
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldA\":"
|
||||||
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldA {
|
for i := range x.FieldA {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
out.RawByte(',')
|
out.RawByte(',')
|
||||||
}
|
}
|
||||||
|
if x.FieldA[i] != nil {
|
||||||
out.Base64Bytes(x.FieldA[i])
|
out.Base64Bytes(x.FieldA[i])
|
||||||
|
} else {
|
||||||
|
out.String("")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldB\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldB\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldB {
|
for i := range x.FieldB {
|
||||||
|
@ -1190,7 +1391,12 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldC\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldC\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldC {
|
for i := range x.FieldC {
|
||||||
|
@ -1202,7 +1408,12 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldD\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldD\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldD {
|
for i := range x.FieldD {
|
||||||
|
@ -1214,43 +1425,69 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldE\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldE\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldE {
|
for i := range x.FieldE {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
out.RawByte(',')
|
out.RawByte(',')
|
||||||
}
|
}
|
||||||
out.Int64(x.FieldE[i])
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldE[i], 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldF\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldF\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldF {
|
for i := range x.FieldF {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
out.RawByte(',')
|
out.RawByte(',')
|
||||||
}
|
}
|
||||||
out.Uint64(x.FieldF[i])
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldF[i], 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldFu\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldFu\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldFu {
|
for i := range x.FieldFu {
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
out.RawByte(',')
|
out.RawByte(',')
|
||||||
}
|
}
|
||||||
out.Uint64(x.FieldFu[i])
|
out.RawByte('"')
|
||||||
|
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldFu[i], 10)
|
||||||
|
out.RawByte('"')
|
||||||
}
|
}
|
||||||
out.RawByte(']')
|
out.RawByte(']')
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const prefix string = ",\"fieldAux\":"
|
if !first {
|
||||||
|
out.RawByte(',')
|
||||||
|
} else {
|
||||||
|
first = false
|
||||||
|
}
|
||||||
|
const prefix string = "\"fieldAux\":"
|
||||||
out.RawString(prefix)
|
out.RawString(prefix)
|
||||||
out.RawByte('[')
|
out.RawByte('[')
|
||||||
for i := range x.FieldAux {
|
for i := range x.FieldAux {
|
||||||
|
@ -1295,7 +1532,13 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list [][]byte
|
var list [][]byte
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Bytes()
|
{
|
||||||
|
tmp := in.Bytes()
|
||||||
|
if len(tmp) == 0 {
|
||||||
|
tmp = nil
|
||||||
|
}
|
||||||
|
f = tmp
|
||||||
|
}
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
@ -1321,7 +1564,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list []int32
|
var list []int32
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Int32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int32(v)
|
||||||
|
f = pv
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
@ -1334,7 +1585,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list []uint32
|
var list []uint32
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Uint32()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint32(v)
|
||||||
|
f = pv
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
@ -1347,7 +1606,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list []int64
|
var list []int64
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Int64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseInt(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := int64(v)
|
||||||
|
f = pv
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
@ -1360,7 +1627,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list []uint64
|
var list []uint64
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
@ -1373,7 +1648,15 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
|
||||||
var list []uint64
|
var list []uint64
|
||||||
in.Delim('[')
|
in.Delim('[')
|
||||||
for !in.IsDelim(']') {
|
for !in.IsDelim(']') {
|
||||||
f = in.Uint64()
|
r := in.JsonNumber()
|
||||||
|
n := r.String()
|
||||||
|
v, err := strconv.ParseUint(n, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
pv := uint64(v)
|
||||||
|
f = pv
|
||||||
list = append(list, f)
|
list = append(list, f)
|
||||||
in.WantComma()
|
in.WantComma()
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,35 @@ func emitJSONUnmarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
|
||||||
g.P("}")
|
g.P("}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func emitJSONParseInteger(g *protogen.GeneratedFile, ident string, method string, bitSize int, typ string) {
|
||||||
|
g.P("r := in.JsonNumber()")
|
||||||
|
g.P("n := r.String()")
|
||||||
|
g.P("v, err := ", strconvPackage.Ident(method), "(n, 10, ", bitSize, ")")
|
||||||
|
g.P("if err != nil {")
|
||||||
|
g.P(" in.AddError(err)")
|
||||||
|
g.P(" return")
|
||||||
|
g.P("}")
|
||||||
|
g.P(ident, " := ", typ, "(v)")
|
||||||
|
}
|
||||||
|
|
||||||
|
func emitJSONReadEnum(g *protogen.GeneratedFile, name string, enumType string) {
|
||||||
|
g.P(`switch v := in.Interface().(type) {
|
||||||
|
case string:
|
||||||
|
if vv, ok := `+enumType+`_value[v]; ok {
|
||||||
|
`+name+` = `+enumType+`(vv)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
vv, err := `, strconvPackage.Ident("ParseInt"), `(v, 10, 32)
|
||||||
|
if err != nil {
|
||||||
|
in.AddError(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
`+name+` = `+enumType+`(vv)
|
||||||
|
case float64:
|
||||||
|
`+name+` = `+enumType+`(v)
|
||||||
|
}`)
|
||||||
|
}
|
||||||
|
|
||||||
func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string) {
|
func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string) {
|
||||||
g.P("{")
|
g.P("{")
|
||||||
defer g.P("}")
|
defer g.P("}")
|
||||||
|
@ -83,30 +112,20 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string
|
||||||
|
|
||||||
enumType := fieldType(g, f).String()
|
enumType := fieldType(g, f).String()
|
||||||
g.P("var parsedValue " + enumType)
|
g.P("var parsedValue " + enumType)
|
||||||
g.P(`switch v := in.Interface().(type) {
|
emitJSONReadEnum(g, "parsedValue", enumType)
|
||||||
case string:
|
|
||||||
if vv, ok := `+enumType+`_value[v]; ok {
|
|
||||||
parsedValue = `+enumType+`(vv)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
vv, err := `, strconvPackage.Ident("ParseInt"), `(v, 10, 32)
|
|
||||||
if err != nil {
|
|
||||||
in.AddError(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
parsedValue = `+enumType+`(vv)
|
|
||||||
case float64:
|
|
||||||
parsedValue = `+enumType+`(v)
|
|
||||||
}`)
|
|
||||||
template = "%s = parsedValue"
|
template = "%s = parsedValue"
|
||||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||||
template = "%s = in.Int32()"
|
emitJSONParseInteger(g, "pv", "ParseInt", 32, "int32")
|
||||||
|
template = "%s = pv"
|
||||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||||
template = "%s = in.Uint32()"
|
emitJSONParseInteger(g, "pv", "ParseUint", 32, "uint32")
|
||||||
|
template = "%s = pv"
|
||||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||||
template = "%s = in.Int64()"
|
emitJSONParseInteger(g, "pv", "ParseInt", 64, "int64")
|
||||||
|
template = "%s = pv"
|
||||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||||
template = "%s = in.Uint64()"
|
emitJSONParseInteger(g, "pv", "ParseUint", 64, "uint64")
|
||||||
|
template = "%s = pv"
|
||||||
case protoreflect.FloatKind:
|
case protoreflect.FloatKind:
|
||||||
template = "%s = in.Float32()"
|
template = "%s = in.Float32()"
|
||||||
case protoreflect.DoubleKind:
|
case protoreflect.DoubleKind:
|
||||||
|
@ -114,7 +133,17 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string
|
||||||
case protoreflect.StringKind:
|
case protoreflect.StringKind:
|
||||||
template = "%s = in.String()"
|
template = "%s = in.String()"
|
||||||
case protoreflect.BytesKind:
|
case protoreflect.BytesKind:
|
||||||
template = "%s = in.Bytes()"
|
// Since some time ago proto3 support optional keyword, thus the presence is not tracked by default:
|
||||||
|
// https://github.com/protocolbuffers/protobuf-go/blob/fb995f184a1719ec42b247a3771d1036d92adf67/internal/impl/message_reflect_field.go#L327
|
||||||
|
// We do not explicitly support `optional` keyword, protoc will fail on such fileds.
|
||||||
|
// Thus, treat empty string as `[]byte(nil)`.
|
||||||
|
template = `{
|
||||||
|
tmp := in.Bytes()
|
||||||
|
if len(tmp) == 0 {
|
||||||
|
tmp = nil
|
||||||
|
}
|
||||||
|
%s = tmp
|
||||||
|
}`
|
||||||
case protoreflect.MessageKind:
|
case protoreflect.MessageKind:
|
||||||
if f.Desc.IsList() {
|
if f.Desc.IsList() {
|
||||||
g.P("f = ", fieldType(g, f)[2:], "{}")
|
g.P("f = ", fieldType(g, f)[2:], "{}")
|
||||||
|
@ -147,8 +176,11 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
|
||||||
g.P("func (x *", msg.GoIdent.GoName, ") MarshalEasyJSON(out *", jwriterPackage.Ident("Writer"), ") {")
|
g.P("func (x *", msg.GoIdent.GoName, ") MarshalEasyJSON(out *", jwriterPackage.Ident("Writer"), ") {")
|
||||||
g.P(`if x == nil { out.RawString("null"); return }`)
|
g.P(`if x == nil { out.RawString("null"); return }`)
|
||||||
|
|
||||||
|
if len(msg.Fields) != 0 {
|
||||||
|
g.P("first := true")
|
||||||
|
}
|
||||||
g.P("out.RawByte('{')")
|
g.P("out.RawByte('{')")
|
||||||
for i, f := range msg.Fields {
|
for _, f := range msg.Fields {
|
||||||
if f.Oneof != nil {
|
if f.Oneof != nil {
|
||||||
if f.Oneof.Fields[0] != f {
|
if f.Oneof.Fields[0] != f {
|
||||||
continue
|
continue
|
||||||
|
@ -157,29 +189,38 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
|
||||||
g.P("switch xx := x.", f.Oneof.GoName, ".(type) {")
|
g.P("switch xx := x.", f.Oneof.GoName, ".(type) {")
|
||||||
for _, ff := range f.Oneof.Fields {
|
for _, ff := range f.Oneof.Fields {
|
||||||
g.P("case *", ff.GoIdent, ":")
|
g.P("case *", ff.GoIdent, ":")
|
||||||
emitJSONFieldWrite(g, ff, "xx", i == 0)
|
emitJSONFieldWrite(g, ff, "xx")
|
||||||
}
|
}
|
||||||
g.P("}")
|
g.P("}")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
emitJSONFieldWrite(g, f, "x", i == 0)
|
emitJSONFieldWrite(g, f, "x")
|
||||||
}
|
}
|
||||||
g.P("out.RawByte('}')")
|
g.P("out.RawByte('}')")
|
||||||
g.P("}")
|
g.P("}")
|
||||||
}
|
}
|
||||||
|
|
||||||
func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string, first bool) {
|
func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string) {
|
||||||
g.P("{")
|
g.P("{")
|
||||||
defer g.P("}")
|
defer g.P("}")
|
||||||
|
|
||||||
g.P("const prefix string = ", `",\"`, fieldJSONName(f), `\":"`)
|
|
||||||
if first {
|
|
||||||
g.P("out.RawString(prefix[1:])")
|
|
||||||
} else {
|
|
||||||
g.P("out.RawString(prefix)")
|
|
||||||
}
|
|
||||||
|
|
||||||
selector := name + "." + f.GoName
|
selector := name + "." + f.GoName
|
||||||
|
|
||||||
|
// This code is responsible for ignoring default values.
|
||||||
|
// We will restore it after having parametrized JSON marshaling.
|
||||||
|
//
|
||||||
|
// isNotDefault := notNil
|
||||||
|
// if f.Desc.IsList() {
|
||||||
|
// isNotDefault = notEmpty
|
||||||
|
// } else if f.Desc.Kind() != protoreflect.MessageKind {
|
||||||
|
// _, isNotDefault = easyprotoKindInfo(f.Desc.Kind())
|
||||||
|
// }
|
||||||
|
// g.P("if ", isNotDefault(selector), "{")
|
||||||
|
// defer g.P("}")
|
||||||
|
|
||||||
|
g.P("if !first { out.RawByte(','); } else { first = false; }")
|
||||||
|
g.P("const prefix string = ", `"\"`, fieldJSONName(f), `\":"`)
|
||||||
|
g.P("out.RawString(prefix)")
|
||||||
if f.Desc.IsList() {
|
if f.Desc.IsList() {
|
||||||
selector += "[i]"
|
selector += "[i]"
|
||||||
g.P("out.RawByte('[')")
|
g.P("out.RawByte('[')")
|
||||||
|
@ -195,15 +236,27 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
|
||||||
case protoreflect.BoolKind:
|
case protoreflect.BoolKind:
|
||||||
template = "out.Bool(%s)"
|
template = "out.Bool(%s)"
|
||||||
case protoreflect.EnumKind:
|
case protoreflect.EnumKind:
|
||||||
template = "out.Int32(int32(%s))"
|
enumType := fieldType(g, f).String()
|
||||||
|
template = `v := int32(%s)
|
||||||
|
if vv, ok := ` + enumType + `_name[v]; ok {
|
||||||
|
out.String(vv)
|
||||||
|
} else {
|
||||||
|
out.Int32(v)
|
||||||
|
}`
|
||||||
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
|
||||||
template = "out.Int32(%s)"
|
template = "out.Int32(%s)"
|
||||||
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
|
||||||
template = "out.Uint32(%s)"
|
template = "out.Uint32(%s)"
|
||||||
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
|
||||||
template = "out.Int64(%s)"
|
g.P("out.RawByte('\"')")
|
||||||
|
g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendInt"), "(out.Buffer.Buf, ", selector, ", 10)")
|
||||||
|
g.P("out.RawByte('\"')")
|
||||||
|
return
|
||||||
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
|
||||||
template = "out.Uint64(%s)"
|
g.P("out.RawByte('\"')")
|
||||||
|
g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendUint"), "(out.Buffer.Buf, ", selector, ", 10)")
|
||||||
|
g.P("out.RawByte('\"')")
|
||||||
|
return
|
||||||
case protoreflect.FloatKind:
|
case protoreflect.FloatKind:
|
||||||
template = "out.Float32(%s)"
|
template = "out.Float32(%s)"
|
||||||
case protoreflect.DoubleKind:
|
case protoreflect.DoubleKind:
|
||||||
|
@ -211,7 +264,10 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
|
||||||
case protoreflect.StringKind:
|
case protoreflect.StringKind:
|
||||||
template = "out.String(%s)"
|
template = "out.String(%s)"
|
||||||
case protoreflect.BytesKind:
|
case protoreflect.BytesKind:
|
||||||
template = "out.Base64Bytes(%s)"
|
g.P("if ", selector, "!= nil {")
|
||||||
|
g.P("out.Base64Bytes(", selector, ")")
|
||||||
|
g.P("} else { out.String(\"\") }")
|
||||||
|
return
|
||||||
case protoreflect.MessageKind:
|
case protoreflect.MessageKind:
|
||||||
template = "%s.MarshalEasyJSON(out)"
|
template = "%s.MarshalEasyJSON(out)"
|
||||||
case protoreflect.GroupKind:
|
case protoreflect.GroupKind:
|
||||||
|
|
Loading…
Add table
Reference in a new issue