Compare commits

..

No commits in common. "master" and "fix/obsolete-urls" have entirely different histories.

40 changed files with 850 additions and 4243 deletions

View file

@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 184.2 51.8" style="enable-background:new 0 0 184.2 51.8;" xml:space="preserve">
<style type="text/css">
.st0{display:none;}
.st1{display:inline;}
.st2{fill:#01E397;}
.st3{display:inline;fill:#010032;}
.st4{display:inline;fill:#00E599;}
.st5{display:inline;fill:#00AF92;}
.st6{fill:#00C3E5;}
</style>
<g id="Layer_2">
<g id="Layer_1-2" class="st0">
<g class="st1">
<path class="st2" d="M146.6,18.3v7.2h10.9V29h-10.9v10.7h-4V14.8h18v3.5H146.6z"/>
<path class="st2" d="M180,15.7c1.7,0.9,3,2.2,4,3.8l-3,2.7c-0.6-1.3-1.5-2.4-2.6-3.3c-1.3-0.7-2.8-1-4.3-1
c-1.4-0.1-2.8,0.3-4,1.1c-0.9,0.5-1.5,1.5-1.4,2.6c0,1,0.5,1.9,1.4,2.4c1.5,0.8,3.2,1.3,4.9,1.5c1.9,0.3,3.7,0.8,5.4,1.6
c1.2,0.5,2.2,1.3,2.9,2.3c0.6,1,1,2.2,0.9,3.4c0,1.4-0.5,2.7-1.3,3.8c-0.9,1.2-2.1,2.1-3.5,2.6c-1.7,0.6-3.4,0.9-5.2,0.8
c-5,0-8.6-1.6-10.7-5l2.9-2.8c0.7,1.4,1.8,2.5,3.1,3.3c1.5,0.7,3.1,1.1,4.7,1c1.5,0.1,2.9-0.2,4.2-0.9c0.9-0.5,1.5-1.5,1.5-2.6
c0-0.9-0.5-1.8-1.3-2.2c-1.5-0.7-3.1-1.2-4.8-1.5c-1.9-0.3-3.7-0.8-5.5-1.5c-1.2-0.5-2.2-1.4-3-2.4c-0.6-1-1-2.2-0.9-3.4
c0-1.4,0.4-2.7,1.2-3.8c0.8-1.2,2-2.2,3.3-2.8c1.6-0.7,3.4-1.1,5.2-1C176.1,14.3,178.2,14.8,180,15.7z"/>
</g>
<path class="st3" d="M73.3,16.3c1.9,1.9,2.9,4.5,2.7,7.1v15.9h-4V24.8c0-2.6-0.5-4.5-1.6-5.7c-1.2-1.2-2.8-1.8-4.5-1.7
c-1.3,0-2.5,0.3-3.7,0.8c-1.2,0.7-2.2,1.7-2.9,2.9c-0.8,1.5-1.1,3.2-1.1,4.9v13.3h-4V15.1l3.6,1.5v1.7c0.8-1.5,2.1-2.6,3.6-3.3
c1.5-0.8,3.2-1.2,4.9-1.1C68.9,13.8,71.3,14.7,73.3,16.3z"/>
<path class="st3" d="M104.4,28.3H85.6c0.1,2.2,1,4.3,2.5,5.9c1.5,1.4,3.5,2.2,5.6,2.1c1.6,0.1,3.2-0.2,4.6-0.9
c1.1-0.6,2-1.6,2.5-2.8l3.3,1.8c-0.9,1.7-2.3,3.1-4,4c-2,1-4.2,1.5-6.4,1.4c-3.7,0-6.7-1.1-8.8-3.4s-3.2-5.5-3.2-9.6s1-7.2,3-9.5
s5-3.4,8.7-3.4c2.1-0.1,4.2,0.5,6.1,1.5c1.6,1,3,2.5,3.8,4.2c0.9,1.8,1.3,3.9,1.3,5.9C104.6,26.4,104.6,27.4,104.4,28.3z
M88.1,19.3c-1.4,1.5-2.2,3.4-2.4,5.5h15.1c-0.2-2-1-3.9-2.3-5.5c-1.4-1.3-3.2-2-5.1-1.9C91.5,17.3,89.6,18,88.1,19.3z"/>
<path class="st3" d="M131,17.3c2.2,2.3,3.2,5.5,3.2,9.5s-1,7.3-3.2,9.6s-5.1,3.4-8.8,3.4s-6.7-1.1-8.9-3.4s-3.2-5.5-3.2-9.6
s1.1-7.2,3.2-9.5s5.1-3.4,8.9-3.4S128.9,15,131,17.3z M116.2,19.9c-1.5,2-2.2,4.4-2.1,6.9c-0.2,2.5,0.6,5,2.1,7
c1.5,1.7,3.7,2.7,6,2.6c2.3,0.1,4.4-0.9,5.9-2.6c1.5-2,2.3-4.5,2.1-7c0.1-2.5-0.6-4.9-2.1-6.9c-1.5-1.7-3.6-2.7-5.9-2.6
C119.9,17.2,117.7,18.2,116.2,19.9z"/>
<polygon class="st4" points="0,9.1 0,43.7 22.5,51.8 22.5,16.9 46.8,7.9 24.8,0 "/>
<polygon class="st5" points="24.3,17.9 24.3,36.8 46.8,44.9 46.8,9.6 "/>
</g>
<g>
<g>
<path class="st6" d="M41.6,17.5H28.2v6.9h10.4v3.3H28.2v10.2h-3.9V14.2h17.2V17.5z"/>
<path class="st6" d="M45.8,37.9v-18h3.3l0.4,3.2c0.5-1.2,1.2-2.1,2.1-2.7c0.9-0.6,2.1-0.9,3.5-0.9c0.4,0,0.7,0,1.1,0.1
c0.4,0.1,0.7,0.2,0.9,0.3l-0.5,3.4c-0.3-0.1-0.6-0.2-0.9-0.2C55.4,23,54.9,23,54.4,23c-0.7,0-1.5,0.2-2.2,0.6
c-0.7,0.4-1.3,1-1.8,1.8s-0.7,1.8-0.7,3v9.5H45.8z"/>
<path class="st6" d="M68.6,19.6c1.8,0,3.3,0.4,4.6,1.1c1.3,0.7,2.4,1.8,3.1,3.2s1.1,3.1,1.1,5c0,1.9-0.4,3.6-1.1,5
c-0.8,1.4-1.8,2.5-3.1,3.2c-1.3,0.7-2.9,1.1-4.6,1.1s-3.3-0.4-4.6-1.1c-1.3-0.7-2.4-1.8-3.2-3.2c-0.8-1.4-1.2-3.1-1.2-5
c0-1.9,0.4-3.6,1.2-5s1.8-2.5,3.2-3.2C65.3,19.9,66.8,19.6,68.6,19.6z M68.6,22.6c-1.1,0-2,0.2-2.8,0.7c-0.8,0.5-1.3,1.2-1.7,2.1
s-0.6,2.1-0.6,3.5c0,1.3,0.2,2.5,0.6,3.4s1,1.7,1.7,2.2s1.7,0.7,2.8,0.7c1.1,0,2-0.2,2.7-0.7c0.7-0.5,1.3-1.2,1.7-2.2
s0.6-2.1,0.6-3.4c0-1.4-0.2-2.5-0.6-3.5s-1-1.6-1.7-2.1C70.6,22.8,69.6,22.6,68.6,22.6z"/>
<path class="st6" d="M89.2,38.3c-1.8,0-3.4-0.3-4.9-1c-1.5-0.7-2.7-1.7-3.5-3l2.7-2.3c0.5,1,1.3,1.8,2.3,2.4
c1,0.6,2.2,0.9,3.6,0.9c1.1,0,2-0.2,2.6-0.6c0.6-0.4,1-0.9,1-1.6c0-0.5-0.2-0.9-0.5-1.2s-0.9-0.6-1.7-0.8l-3.8-0.8
c-1.9-0.4-3.3-1-4.1-1.9c-0.8-0.9-1.2-1.9-1.2-3.3c0-1,0.3-1.9,0.9-2.7c0.6-0.8,1.4-1.5,2.5-2s2.5-0.8,4-0.8c1.8,0,3.3,0.3,4.6,1
c1.3,0.6,2.2,1.5,2.9,2.7l-2.7,2.2c-0.5-1-1.1-1.7-2-2.1c-0.9-0.5-1.8-0.7-2.8-0.7c-0.8,0-1.4,0.1-2,0.3c-0.6,0.2-1,0.5-1.3,0.8
c-0.3,0.3-0.4,0.7-0.4,1.2c0,0.5,0.2,0.9,0.5,1.3s1,0.6,1.9,0.8l4.1,0.9c1.7,0.3,2.9,0.9,3.7,1.7c0.7,0.8,1.1,1.8,1.1,2.9
c0,1.2-0.3,2.2-0.9,3c-0.6,0.9-1.5,1.6-2.6,2C92.1,38.1,90.7,38.3,89.2,38.3z"/>
<path class="st6" d="M112.8,19.9v3H99.3v-3H112.8z M106.6,14.6v17.9c0,0.9,0.2,1.5,0.7,1.9c0.5,0.4,1.1,0.6,1.9,0.6
c0.6,0,1.2-0.1,1.7-0.3c0.5-0.2,0.9-0.5,1.3-0.8l0.9,2.8c-0.6,0.5-1.2,0.9-2,1.1c-0.8,0.3-1.7,0.4-2.7,0.4c-1,0-2-0.2-2.8-0.5
s-1.5-0.9-2-1.6c-0.5-0.8-0.7-1.7-0.8-3V15.7L106.6,14.6z"/>
<path d="M137.9,17.5h-13.3v6.9h10.4v3.3h-10.4v10.2h-3.9V14.2h17.2V17.5z"/>
<path d="M150.9,13.8c2.1,0,4,0.4,5.5,1.2c1.6,0.8,2.9,2,4,3.5l-2.6,2.5c-0.9-1.4-1.9-2.4-3.1-3c-1.1-0.6-2.5-0.9-4-0.9
c-1.2,0-2.1,0.2-2.8,0.5c-0.7,0.3-1.3,0.7-1.6,1.2c-0.3,0.5-0.5,1.1-0.5,1.7c0,0.7,0.3,1.4,0.8,1.9c0.5,0.6,1.5,1,2.9,1.3
l4.8,1.1c2.3,0.5,3.9,1.3,4.9,2.3c1,1,1.4,2.3,1.4,3.9c0,1.5-0.4,2.7-1.2,3.8c-0.8,1.1-1.9,1.9-3.3,2.5s-3.1,0.9-5,0.9
c-1.7,0-3.2-0.2-4.5-0.6c-1.3-0.4-2.5-1-3.5-1.8c-1-0.7-1.8-1.6-2.5-2.6l2.7-2.7c0.5,0.8,1.1,1.6,1.9,2.2
c0.8,0.7,1.7,1.2,2.7,1.5c1,0.4,2.2,0.5,3.4,0.5c1.1,0,2.1-0.1,2.9-0.4c0.8-0.3,1.4-0.7,1.8-1.2c0.4-0.5,0.6-1.1,0.6-1.9
c0-0.7-0.2-1.3-0.7-1.8c-0.5-0.5-1.3-0.9-2.6-1.2l-5.2-1.2c-1.4-0.3-2.6-0.8-3.6-1.3c-0.9-0.6-1.6-1.3-2.1-2.1s-0.7-1.8-0.7-2.8
c0-1.3,0.4-2.6,1.1-3.7c0.7-1.1,1.8-2,3.2-2.6C147.3,14.1,148.9,13.8,150.9,13.8z"/>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.5 KiB

1
.github/CODEOWNERS vendored Normal file
View file

@ -0,0 +1 @@
* @TrueCloudLab/storage-core @TrueCloudLab/storage-services @TrueCloudLab/committers

View file

@ -50,7 +50,7 @@ linters:
- bidichk
- durationcheck
- exhaustive
- copyloopvar
- exportloopref
- gofmt
- goimports
- misspell

View file

@ -1,2 +0,0 @@
.* @TrueCloudLab/storage-core-committers @TrueCloudLab/storage-core-developers @TrueCloudLab/storage-services-committers @TrueCloudLab/storage-services-developers
.forgejo/.* @potyarkin

View file

@ -25,8 +25,7 @@ Start by forking the `frostfs-api-go` repository, make changes in a branch and t
send a pull request. We encourage pull requests to discuss code changes. Here
are the steps in details:
### Set up your repository
### Set up your GitHub Repository
Fork [FrostFS node upstream](https://git.frostfs.info/TrueCloudLab/frostfs-api-go/fork) source
repository to your own personal repository. Copy the URL of your fork (you will
need it for the `git clone` command below).
@ -87,7 +86,7 @@ $ git push origin feature/123-something_awesome
```
### Create a Pull Request
Pull requests can be created via git.frostfs.info. Refer to [this
Pull requests can be created via GitHub. Refer to [this
document](https://help.github.com/articles/creating-a-pull-request/) for
detailed steps on how to create a pull request. After a Pull Request gets peer
reviewed and approved, it will be merged.

View file

@ -1,5 +1,5 @@
<p align="center">
<img src="./.forgejo/logo.svg" width="500px" alt="FrostFS">
<img src="./.github/logo.svg" width="500px" alt="FrostFS">
</p>
<p align="center">
Low-level Golang API for <a href="https://frostfs.info">FrostFS</a>

View file

@ -98,16 +98,10 @@ func (x *BalanceRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerId\":"
out.RawString(prefix)
const prefix string = ",\"ownerId\":"
out.RawString(prefix[1:])
x.OwnerId.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -301,35 +295,19 @@ func (x *BalanceRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -474,16 +452,10 @@ func (x *BalanceResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"balance\":"
out.RawString(prefix)
const prefix string = ",\"balance\":"
out.RawString(prefix[1:])
x.Balance.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -677,35 +649,19 @@ func (x *BalanceResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}

View file

@ -26,7 +26,7 @@ const (
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AccountingServiceClient interface {
// Returns the amount of funds in GAS token for the requested FrostFS account.
// Returns the amount of funds in GAS token for the requested NeoFS account.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
@ -56,7 +56,7 @@ func (c *accountingServiceClient) Balance(ctx context.Context, in *BalanceReques
// All implementations should embed UnimplementedAccountingServiceServer
// for forward compatibility
type AccountingServiceServer interface {
// Returns the amount of funds in GAS token for the requested FrostFS account.
// Returns the amount of funds in GAS token for the requested NeoFS account.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):

View file

@ -11,7 +11,6 @@ import (
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
type Decimal struct {
@ -114,27 +113,14 @@ func (x *Decimal) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"value\":"
out.RawString(prefix[1:])
out.Int64(x.Value)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"precision\":"
const prefix string = ",\"precision\":"
out.RawString(prefix)
out.Uint32(x.Precision)
}
@ -169,29 +155,13 @@ func (x *Decimal) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "value":
{
var f 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
f = in.Int64()
x.Value = f
}
case "precision":
{
var f 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
f = in.Uint32()
x.Precision = f
}
}

View file

@ -352,55 +352,24 @@ func (x *EACLRecord_Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"headerType\":"
out.RawString(prefix)
v := int32(x.HeaderType)
if vv, ok := HeaderType_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
const prefix string = ",\"headerType\":"
out.RawString(prefix[1:])
out.Int32(int32(x.HeaderType))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"matchType\":"
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)
}
out.Int32(int32(x.MatchType))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
const prefix string = ",\"key\":"
out.RawString(prefix)
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
@ -597,41 +566,21 @@ func (x *EACLRecord_Target) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"role\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Role))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"keys\":"
const prefix string = ",\"keys\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Keys {
if i != 0 {
out.RawByte(',')
}
if x.Keys[i] != nil {
out.Base64Bytes(x.Keys[i])
} else {
out.String("")
}
out.Base64Bytes(x.Keys[i])
}
out.RawByte(']')
}
@ -691,13 +640,7 @@ func (x *EACLRecord_Target) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list [][]byte
in.Delim('[')
for !in.IsDelim(']') {
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
list = append(list, f)
in.WantComma()
}
@ -865,45 +808,19 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"operation\":"
out.RawString(prefix)
v := int32(x.Operation)
if vv, ok := Operation_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
const prefix string = ",\"operation\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Operation))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"action\":"
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)
}
out.Int32(int32(x.Action))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"filters\":"
const prefix string = ",\"filters\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Filters {
@ -915,12 +832,7 @@ func (x *EACLRecord) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"targets\":"
const prefix string = ",\"targets\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Targets {
@ -1172,35 +1084,19 @@ func (x *EACLTable) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerID\":"
const prefix string = ",\"containerID\":"
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"records\":"
const prefix string = ",\"records\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Records {
@ -1396,43 +1292,21 @@ func (x *BearerToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"exp\":"
out.RawString(prefix[1:])
out.Uint64(x.Exp)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nbf\":"
const prefix string = ",\"nbf\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
out.RawByte('"')
out.Uint64(x.Nbf)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"iat\":"
const prefix string = ",\"iat\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
out.RawByte('"')
out.Uint64(x.Iat)
}
out.RawByte('}')
}
@ -1465,43 +1339,19 @@ func (x *BearerToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "exp":
{
var f 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
f = in.Uint64()
x.Exp = f
}
case "nbf":
{
var f 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
f = in.Uint64()
x.Nbf = f
}
case "iat":
{
var f 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
f = in.Uint64()
x.Iat = f
}
}
@ -1622,25 +1472,14 @@ func (x *BearerToken_Body_APEOverride) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"target\":"
out.RawString(prefix)
const prefix string = ",\"target\":"
out.RawString(prefix[1:])
x.Target.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chains\":"
const prefix string = ",\"chains\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Chains {
@ -1881,55 +1720,29 @@ func (x *BearerToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"eaclTable\":"
out.RawString(prefix)
const prefix string = ",\"eaclTable\":"
out.RawString(prefix[1:])
x.EaclTable.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
const prefix string = ",\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"lifetime\":"
const prefix string = ",\"lifetime\":"
out.RawString(prefix)
x.Lifetime.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"allowImpersonate\":"
const prefix string = ",\"allowImpersonate\":"
out.RawString(prefix)
out.Bool(x.AllowImpersonate)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"apeOverride\":"
const prefix string = ",\"apeOverride\":"
out.RawString(prefix)
x.ApeOverride.MarshalEasyJSON(out)
}
@ -2110,25 +1923,14 @@ func (x *BearerToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}

View file

@ -155,30 +155,14 @@ func (x *ChainTarget) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"type\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Type))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"name\":"
const prefix string = ",\"name\":"
out.RawString(prefix)
out.String(x.Name)
}
@ -349,23 +333,13 @@ func (x *Chain) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
switch xx := x.Kind.(type) {
case *Chain_Raw:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"raw\":"
out.RawString(prefix)
if xx.Raw != nil {
out.Base64Bytes(xx.Raw)
} else {
out.String("")
}
const prefix string = ",\"raw\":"
out.RawString(prefix[1:])
out.Base64Bytes(xx.Raw)
}
}
out.RawByte('}')
@ -401,13 +375,7 @@ func (x *Chain) UnmarshalEasyJSON(in *jlexer.Lexer) {
x.Kind = xx
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
xx.Raw = f
}
}

View file

@ -121,25 +121,14 @@ func (x *AddChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"target\":"
out.RawString(prefix)
const prefix string = ",\"target\":"
out.RawString(prefix[1:])
x.Target.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chain\":"
const prefix string = ",\"chain\":"
out.RawString(prefix)
x.Chain.MarshalEasyJSON(out)
}
@ -341,35 +330,19 @@ func (x *AddChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -511,21 +484,11 @@ func (x *AddChainResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chainId\":"
out.RawString(prefix)
if x.ChainId != nil {
out.Base64Bytes(x.ChainId)
} else {
out.String("")
}
const prefix string = ",\"chainId\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.ChainId)
}
out.RawByte('}')
}
@ -558,13 +521,7 @@ func (x *AddChainResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "chainId":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.ChainId = f
}
}
@ -723,35 +680,19 @@ func (x *AddChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -916,31 +857,16 @@ func (x *RemoveChainRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"target\":"
out.RawString(prefix)
const prefix string = ",\"target\":"
out.RawString(prefix[1:])
x.Target.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chainId\":"
const prefix string = ",\"chainId\":"
out.RawString(prefix)
if x.ChainId != nil {
out.Base64Bytes(x.ChainId)
} else {
out.String("")
}
out.Base64Bytes(x.ChainId)
}
out.RawByte('}')
}
@ -980,13 +906,7 @@ func (x *RemoveChainRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "chainId":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.ChainId = f
}
}
@ -1145,35 +1065,19 @@ func (x *RemoveChainRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1477,35 +1381,19 @@ func (x *RemoveChainResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1650,16 +1538,10 @@ func (x *ListChainsRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"target\":"
out.RawString(prefix)
const prefix string = ",\"target\":"
out.RawString(prefix[1:])
x.Target.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -1853,35 +1735,19 @@ func (x *ListChainsRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -2029,16 +1895,10 @@ func (x *ListChainsResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chains\":"
out.RawString(prefix)
const prefix string = ",\"chains\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.Chains {
if i != 0 {
@ -2246,35 +2106,19 @@ func (x *ListChainsResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}

View file

@ -121,25 +121,14 @@ func (x *PutRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"container\":"
out.RawString(prefix)
const prefix string = ",\"container\":"
out.RawString(prefix[1:])
x.Container.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
@ -341,35 +330,19 @@ func (x *PutRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -514,16 +487,10 @@ func (x *PutResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerId\":"
out.RawString(prefix)
const prefix string = ",\"containerId\":"
out.RawString(prefix[1:])
x.ContainerId.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -717,35 +684,19 @@ func (x *PutResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -913,25 +864,14 @@ func (x *DeleteRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerId\":"
out.RawString(prefix)
const prefix string = ",\"containerId\":"
out.RawString(prefix[1:])
x.ContainerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
@ -1133,35 +1073,19 @@ func (x *DeleteRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1465,35 +1389,19 @@ func (x *DeleteResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1638,16 +1546,10 @@ func (x *GetRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerId\":"
out.RawString(prefix)
const prefix string = ",\"containerId\":"
out.RawString(prefix[1:])
x.ContainerId.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -1841,35 +1743,19 @@ func (x *GetRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -2060,35 +1946,19 @@ func (x *GetResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"container\":"
out.RawString(prefix)
const prefix string = ",\"container\":"
out.RawString(prefix[1:])
x.Container.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionToken\":"
const prefix string = ",\"sessionToken\":"
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
@ -2297,35 +2167,19 @@ func (x *GetResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -2470,16 +2324,10 @@ func (x *ListRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerId\":"
out.RawString(prefix)
const prefix string = ",\"ownerId\":"
out.RawString(prefix[1:])
x.OwnerId.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -2673,35 +2521,19 @@ func (x *ListRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -2849,16 +2681,10 @@ func (x *ListResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerIds\":"
out.RawString(prefix)
const prefix string = ",\"containerIds\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.ContainerIds {
if i != 0 {
@ -3066,35 +2892,19 @@ func (x *ListResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}

View file

@ -13,7 +13,6 @@ import (
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
type Container_Attribute struct {
@ -116,25 +115,14 @@ func (x *Container_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
@ -382,59 +370,29 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
const prefix string = ",\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nonce\":"
const prefix string = ",\"nonce\":"
out.RawString(prefix)
if x.Nonce != nil {
out.Base64Bytes(x.Nonce)
} else {
out.String("")
}
out.Base64Bytes(x.Nonce)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"basicACL\":"
const prefix string = ",\"basicACL\":"
out.RawString(prefix)
out.Uint32(x.BasicAcl)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"attributes\":"
const prefix string = ",\"attributes\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Attributes {
@ -446,12 +404,7 @@ func (x *Container) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"placementPolicy\":"
const prefix string = ",\"placementPolicy\":"
out.RawString(prefix)
x.PlacementPolicy.MarshalEasyJSON(out)
}
@ -500,27 +453,13 @@ func (x *Container) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "nonce":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Nonce = f
}
case "basicACL":
{
var f 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
f = in.Uint32()
x.BasicAcl = f
}
case "attributes":

View file

@ -35,11 +35,11 @@ Tag a release (must be signed) and push it:
$ git tag -s vX.Y.Z[-rc.N] && git push origin vX.Y.Z[-rc.N]
```
## Make a proper release
## Make a Github release
Using git.frostfs.info web interface create a new release based on just created tag
Using Github's web interface create a new release based on just created tag
with the same changes from changelog and publish it.
## Close milestone
## Close github milestone
Close corresponding vX.Y.Z milestone.
Close corresponding vX.Y.Z github milestone.

14
go.mod
View file

@ -7,9 +7,9 @@ require (
github.com/VictoriaMetrics/easyproto v0.1.4
github.com/mailru/easyjson v0.7.7
github.com/stretchr/testify v1.8.3
golang.org/x/sync v0.7.0
google.golang.org/grpc v1.66.2
google.golang.org/protobuf v1.34.1
golang.org/x/sync v0.6.0
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
)
require (
@ -19,10 +19,10 @@ require (
github.com/kr/pretty v0.1.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

28
go.sum
View file

@ -26,20 +26,20 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View file

@ -100,16 +100,10 @@ func (x *Lock) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"members\":"
out.RawString(prefix)
const prefix string = ",\"members\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.Members {
if i != 0 {

View file

@ -257,35 +257,19 @@ func (x *LocalNodeInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -453,25 +437,14 @@ func (x *LocalNodeInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nodeInfo\":"
const prefix string = ",\"nodeInfo\":"
out.RawString(prefix)
x.NodeInfo.MarshalEasyJSON(out)
}
@ -673,35 +646,19 @@ func (x *LocalNodeInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1005,35 +962,19 @@ func (x *NetworkInfoRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1178,16 +1119,10 @@ func (x *NetworkInfoResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"networkInfo\":"
out.RawString(prefix)
const prefix string = ",\"networkInfo\":"
out.RawString(prefix[1:])
x.NetworkInfo.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -1381,35 +1316,19 @@ func (x *NetworkInfoResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1713,35 +1632,19 @@ func (x *NetmapSnapshotRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -1886,16 +1789,10 @@ func (x *NetmapSnapshotResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"netmap\":"
out.RawString(prefix)
const prefix string = ",\"netmap\":"
out.RawString(prefix[1:])
x.Netmap.MarshalEasyJSON(out)
}
out.RawByte('}')
@ -2089,35 +1986,19 @@ func (x *NetmapSnapshotResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}

View file

@ -40,14 +40,14 @@ type NetmapServiceClient interface {
// information about the server has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error)
// Read recent information about the FrostFS network.
// Read recent information about the NeoFS network.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network state has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error)
// Returns network map snapshot of the current FrostFS epoch.
// Returns network map snapshot of the current NeoFS epoch.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
@ -107,14 +107,14 @@ type NetmapServiceServer interface {
// information about the server has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error)
// Read recent information about the FrostFS network.
// Read recent information about the NeoFS network.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):
// information about the current network state has been successfully read;
// - Common failures (SECTION_FAILURE_COMMON).
NetworkInfo(context.Context, *NetworkInfoRequest) (*NetworkInfoResponse, error)
// Returns network map snapshot of the current FrostFS epoch.
// Returns network map snapshot of the current NeoFS epoch.
//
// Statuses:
// - **OK** (0, SECTION_SUCCESS):

View file

@ -274,60 +274,29 @@ func (x *Filter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"name\":"
out.RawString(prefix)
const prefix string = ",\"name\":"
out.RawString(prefix[1:])
out.String(x.Name)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
const prefix string = ",\"key\":"
out.RawString(prefix)
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"op\":"
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)
}
out.Int32(int32(x.Op))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"filters\":"
const prefix string = ",\"filters\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Filters {
@ -589,60 +558,29 @@ func (x *Selector) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"name\":"
out.RawString(prefix)
const prefix string = ",\"name\":"
out.RawString(prefix[1:])
out.String(x.Name)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"count\":"
const prefix string = ",\"count\":"
out.RawString(prefix)
out.Uint32(x.Count)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"clause\":"
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)
}
out.Int32(int32(x.Clause))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"attribute\":"
const prefix string = ",\"attribute\":"
out.RawString(prefix)
out.String(x.Attribute)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"filter\":"
const prefix string = ",\"filter\":"
out.RawString(prefix)
out.String(x.Filter)
}
@ -683,15 +621,7 @@ func (x *Selector) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "count":
{
var f 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
f = in.Uint32()
x.Count = f
}
case "clause":
@ -877,45 +807,24 @@ func (x *Replica) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"count\":"
out.RawString(prefix)
const prefix string = ",\"count\":"
out.RawString(prefix[1:])
out.Uint32(x.Count)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"selector\":"
const prefix string = ",\"selector\":"
out.RawString(prefix)
out.String(x.Selector)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ecDataCount\":"
const prefix string = ",\"ecDataCount\":"
out.RawString(prefix)
out.Uint32(x.EcDataCount)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ecParityCount\":"
const prefix string = ",\"ecParityCount\":"
out.RawString(prefix)
out.Uint32(x.EcParityCount)
}
@ -950,15 +859,7 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "count":
{
var f 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
f = in.Uint32()
x.Count = f
}
case "selector":
@ -970,29 +871,13 @@ func (x *Replica) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "ecDataCount":
{
var f 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
f = in.Uint32()
x.EcDataCount = f
}
case "ecParityCount":
{
var f 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
f = in.Uint32()
x.EcParityCount = f
}
}
@ -1182,16 +1067,10 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"replicas\":"
out.RawString(prefix)
const prefix string = ",\"replicas\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.Replicas {
if i != 0 {
@ -1202,22 +1081,12 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerBackupFactor\":"
const prefix string = ",\"containerBackupFactor\":"
out.RawString(prefix)
out.Uint32(x.ContainerBackupFactor)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"selectors\":"
const prefix string = ",\"selectors\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Selectors {
@ -1229,12 +1098,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"filters\":"
const prefix string = ",\"filters\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Filters {
@ -1246,12 +1110,7 @@ func (x *PlacementPolicy) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"unique\":"
const prefix string = ",\"unique\":"
out.RawString(prefix)
out.Bool(x.Unique)
}
@ -1300,15 +1159,7 @@ func (x *PlacementPolicy) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "containerBackupFactor":
{
var f 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
f = in.Uint32()
x.ContainerBackupFactor = f
}
case "selectors":
@ -1512,35 +1363,19 @@ func (x *NodeInfo_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parents\":"
const prefix string = ",\"parents\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Parents {
@ -1759,29 +1594,14 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"publicKey\":"
out.RawString(prefix)
if x.PublicKey != nil {
out.Base64Bytes(x.PublicKey)
} else {
out.String("")
}
const prefix string = ",\"publicKey\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.PublicKey)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"addresses\":"
const prefix string = ",\"addresses\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Addresses {
@ -1793,12 +1613,7 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"attributes\":"
const prefix string = ",\"attributes\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Attributes {
@ -1810,19 +1625,9 @@ func (x *NodeInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"state\":"
const prefix string = ",\"state\":"
out.RawString(prefix)
v := int32(x.State)
if vv, ok := NodeInfo_State_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
out.Int32(int32(x.State))
}
out.RawByte('}')
}
@ -1855,13 +1660,7 @@ func (x *NodeInfo) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "publicKey":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.PublicKey = f
}
case "addresses":
@ -2028,27 +1827,14 @@ func (x *Netmap) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
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('"')
const prefix string = ",\"epoch\":"
out.RawString(prefix[1:])
out.Uint64(x.Epoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nodes\":"
const prefix string = ",\"nodes\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Nodes {
@ -2090,15 +1876,7 @@ func (x *Netmap) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "epoch":
{
var f 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
f = in.Uint64()
x.Epoch = f
}
case "nodes":
@ -2224,35 +2002,16 @@ func (x *NetworkConfig_Parameter) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
out.Base64Bytes(x.Value)
}
out.RawByte('}')
}
@ -2285,25 +2044,13 @@ func (x *NetworkConfig_Parameter) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "key":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Key = f
}
case "value":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Value = f
}
}
@ -2401,16 +2148,10 @@ func (x *NetworkConfig) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parameters\":"
out.RawString(prefix)
const prefix string = ",\"parameters\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.Parameters {
if i != 0 {
@ -2614,51 +2355,24 @@ func (x *NetworkInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"currentEpoch\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CurrentEpoch, 10)
out.RawByte('"')
const prefix string = ",\"currentEpoch\":"
out.RawString(prefix[1:])
out.Uint64(x.CurrentEpoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"magicNumber\":"
const prefix string = ",\"magicNumber\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
out.RawByte('"')
out.Uint64(x.MagicNumber)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"msPerBlock\":"
const prefix string = ",\"msPerBlock\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.MsPerBlock, 10)
out.RawByte('"')
out.Int64(x.MsPerBlock)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"networkConfig\":"
const prefix string = ",\"networkConfig\":"
out.RawString(prefix)
x.NetworkConfig.MarshalEasyJSON(out)
}
@ -2693,43 +2407,19 @@ func (x *NetworkInfo) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "currentEpoch":
{
var f 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
f = in.Uint64()
x.CurrentEpoch = f
}
case "magicNumber":
{
var f 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
f = in.Uint64()
x.MagicNumber = f
}
case "msPerBlock":
{
var f 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
f = in.Int64()
x.MsPerBlock = f
}
case "networkConfig":

File diff suppressed because it is too large Load diff

View file

@ -170,7 +170,7 @@ type ObjectServiceClient interface {
// provided session token has expired.
Head(ctx context.Context, in *HeadRequest, opts ...grpc.CallOption) (*HeadResponse, error)
// Search objects in container. Search query allows to match by Object
// Header's filed values. Please see the corresponding FrostFS Technical
// Header's filed values. Please see the corresponding NeoFS Technical
// Specification section for more details.
//
// Extended headers can change `Search` behaviour:
@ -301,20 +301,16 @@ type ObjectServiceClient interface {
// provided session token has expired.
PutSingle(ctx context.Context, in *PutSingleRequest, opts ...grpc.CallOption) (*PutSingleResponse, error)
// Patch the object. Request uses gRPC stream. First message must set
// the address of the object that is going to get patched. If the object's
// attributes are patched, then these attrubutes must be set only within the
// first stream message.
// the address of the object that is going to get patched. If the object's attributes
// are patched, then these attrubutes must be set only within the first stream message.
//
// If the patch request is performed by NOT the object's owner but if the
// actor has the permission to perform the patch, then `OwnerID` of the object
// is changed. In this case the object's owner loses the object's ownership
// after the patch request is successfully done.
// If the patch request is performed by NOT the object's owner but if the actor has the permission
// to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner
// loses the object's ownership after the patch request is successfully done.
//
// As objects are content-addressable the patching causes new object ID
// generation for the patched object. This object id is set witihn
// `PatchResponse`. But the object id may remain unchanged in such cases:
// 1. The chunk of the applying patch contains the same value as the object's
// payload within the same range;
// As objects are content-addressable the patching causes new object ID generation for the patched object.
// This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases:
// 1. The chunk of the applying patch contains the same value as the object's payload within the same range;
// 2. The patch that reverts the changes applied by preceding patch;
// 3. The application of the same patches for the object a few times.
//
@ -698,7 +694,7 @@ type ObjectServiceServer interface {
// provided session token has expired.
Head(context.Context, *HeadRequest) (*HeadResponse, error)
// Search objects in container. Search query allows to match by Object
// Header's filed values. Please see the corresponding FrostFS Technical
// Header's filed values. Please see the corresponding NeoFS Technical
// Specification section for more details.
//
// Extended headers can change `Search` behaviour:
@ -829,20 +825,16 @@ type ObjectServiceServer interface {
// provided session token has expired.
PutSingle(context.Context, *PutSingleRequest) (*PutSingleResponse, error)
// Patch the object. Request uses gRPC stream. First message must set
// the address of the object that is going to get patched. If the object's
// attributes are patched, then these attrubutes must be set only within the
// first stream message.
// the address of the object that is going to get patched. If the object's attributes
// are patched, then these attrubutes must be set only within the first stream message.
//
// If the patch request is performed by NOT the object's owner but if the
// actor has the permission to perform the patch, then `OwnerID` of the object
// is changed. In this case the object's owner loses the object's ownership
// after the patch request is successfully done.
// If the patch request is performed by NOT the object's owner but if the actor has the permission
// to perform the patch, then `OwnerID` of the object is changed. In this case the object's owner
// loses the object's ownership after the patch request is successfully done.
//
// As objects are content-addressable the patching causes new object ID
// generation for the patched object. This object id is set witihn
// `PatchResponse`. But the object id may remain unchanged in such cases:
// 1. The chunk of the applying patch contains the same value as the object's
// payload within the same range;
// As objects are content-addressable the patching causes new object ID generation for the patched object.
// This object id is set witihn `PatchResponse`. But the object id may remain unchanged in such cases:
// 1. The chunk of the applying patch contains the same value as the object's payload within the same range;
// 2. The patch that reverts the changes applied by preceding patch;
// 3. The application of the same patches for the object a few times.
//

View file

@ -304,84 +304,39 @@ func (x *ShortHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"creationEpoch\":"
const prefix string = ",\"creationEpoch\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
out.RawByte('"')
out.Uint64(x.CreationEpoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
const prefix string = ",\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"objectType\":"
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)
}
out.Int32(int32(x.ObjectType))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"payloadLength\":"
const prefix string = ",\"payloadLength\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
out.RawByte('"')
out.Uint64(x.PayloadLength)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"payloadHash\":"
const prefix string = ",\"payloadHash\":"
out.RawString(prefix)
x.PayloadHash.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"homomorphicHash\":"
const prefix string = ",\"homomorphicHash\":"
out.RawString(prefix)
x.HomomorphicHash.MarshalEasyJSON(out)
}
@ -423,15 +378,7 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "creationEpoch":
{
var f 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
f = in.Uint64()
x.CreationEpoch = f
}
case "ownerID":
@ -466,15 +413,7 @@ func (x *ShortHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "payloadLength":
{
var f 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
f = in.Uint64()
x.PayloadLength = f
}
case "payloadHash":
@ -600,25 +539,14 @@ func (x *Header_Attribute) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
@ -869,55 +797,29 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parent\":"
out.RawString(prefix)
const prefix string = ",\"parent\":"
out.RawString(prefix[1:])
x.Parent.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"previous\":"
const prefix string = ",\"previous\":"
out.RawString(prefix)
x.Previous.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parentSignature\":"
const prefix string = ",\"parentSignature\":"
out.RawString(prefix)
x.ParentSignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parentHeader\":"
const prefix string = ",\"parentHeader\":"
out.RawString(prefix)
x.ParentHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"children\":"
const prefix string = ",\"children\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Children {
@ -929,18 +831,9 @@ func (x *Header_Split) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"splitID\":"
const prefix string = ",\"splitID\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
out.Base64Bytes(x.SplitId)
}
out.RawByte('}')
}
@ -1015,13 +908,7 @@ func (x *Header_Split) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "splitID":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.SplitId = f
}
}
@ -1265,93 +1152,44 @@ func (x *Header_EC) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parent\":"
out.RawString(prefix)
const prefix string = ",\"parent\":"
out.RawString(prefix[1:])
x.Parent.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"index\":"
const prefix string = ",\"index\":"
out.RawString(prefix)
out.Uint32(x.Index)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"total\":"
const prefix string = ",\"total\":"
out.RawString(prefix)
out.Uint32(x.Total)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"headerLength\":"
const prefix string = ",\"headerLength\":"
out.RawString(prefix)
out.Uint32(x.HeaderLength)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"header\":"
const prefix string = ",\"header\":"
out.RawString(prefix)
if x.Header != nil {
out.Base64Bytes(x.Header)
} else {
out.String("")
}
out.Base64Bytes(x.Header)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parentSplitID\":"
const prefix string = ",\"parentSplitID\":"
out.RawString(prefix)
if x.ParentSplitId != nil {
out.Base64Bytes(x.ParentSplitId)
} else {
out.String("")
}
out.Base64Bytes(x.ParentSplitId)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parentSplitParentID\":"
const prefix string = ",\"parentSplitParentID\":"
out.RawString(prefix)
x.ParentSplitParentId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"parentAttributes\":"
const prefix string = ",\"parentAttributes\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.ParentAttributes {
@ -1400,67 +1238,31 @@ func (x *Header_EC) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "index":
{
var f 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
f = in.Uint32()
x.Index = f
}
case "total":
{
var f 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
f = in.Uint32()
x.Total = f
}
case "headerLength":
{
var f 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
f = in.Uint32()
x.HeaderLength = f
}
case "header":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Header = f
}
case "parentSplitID":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.ParentSplitId = f
}
case "parentSplitParentID":
@ -1823,114 +1625,54 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerID\":"
const prefix string = ",\"containerID\":"
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
const prefix string = ",\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"creationEpoch\":"
const prefix string = ",\"creationEpoch\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.CreationEpoch, 10)
out.RawByte('"')
out.Uint64(x.CreationEpoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"payloadLength\":"
const prefix string = ",\"payloadLength\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.PayloadLength, 10)
out.RawByte('"')
out.Uint64(x.PayloadLength)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"payloadHash\":"
const prefix string = ",\"payloadHash\":"
out.RawString(prefix)
x.PayloadHash.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"objectType\":"
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)
}
out.Int32(int32(x.ObjectType))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"homomorphicHash\":"
const prefix string = ",\"homomorphicHash\":"
out.RawString(prefix)
x.HomomorphicHash.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionToken\":"
const prefix string = ",\"sessionToken\":"
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"attributes\":"
const prefix string = ",\"attributes\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Attributes {
@ -1942,22 +1684,12 @@ func (x *Header) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"split\":"
const prefix string = ",\"split\":"
out.RawString(prefix)
x.Split.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ec\":"
const prefix string = ",\"ec\":"
out.RawString(prefix)
x.Ec.MarshalEasyJSON(out)
}
@ -2013,29 +1745,13 @@ func (x *Header) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "creationEpoch":
{
var f 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
f = in.Uint64()
x.CreationEpoch = f
}
case "payloadLength":
{
var f 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
f = in.Uint64()
x.PayloadLength = f
}
case "payloadHash":
@ -2267,51 +1983,26 @@ func (x *Object) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"objectID\":"
out.RawString(prefix)
const prefix string = ",\"objectID\":"
out.RawString(prefix[1:])
x.ObjectId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"header\":"
const prefix string = ",\"header\":"
out.RawString(prefix)
x.Header.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"payload\":"
const prefix string = ",\"payload\":"
out.RawString(prefix)
if x.Payload != nil {
out.Base64Bytes(x.Payload)
} else {
out.String("")
}
out.Base64Bytes(x.Payload)
}
out.RawByte('}')
}
@ -2365,13 +2056,7 @@ func (x *Object) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "payload":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Payload = f
}
}
@ -2509,39 +2194,19 @@ func (x *SplitInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"splitId\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
const prefix string = ",\"splitId\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.SplitId)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"lastPart\":"
const prefix string = ",\"lastPart\":"
out.RawString(prefix)
x.LastPart.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"link\":"
const prefix string = ",\"link\":"
out.RawString(prefix)
x.Link.MarshalEasyJSON(out)
}
@ -2576,13 +2241,7 @@ func (x *SplitInfo) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "splitId":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.SplitId = f
}
case "lastPart":
@ -2731,35 +2390,19 @@ func (x *ECInfo_Chunk) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"id\":"
out.RawString(prefix)
const prefix string = ",\"id\":"
out.RawString(prefix[1:])
x.Id.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"index\":"
const prefix string = ",\"index\":"
out.RawString(prefix)
out.Uint32(x.Index)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"total\":"
const prefix string = ",\"total\":"
out.RawString(prefix)
out.Uint32(x.Total)
}
@ -2801,29 +2444,13 @@ func (x *ECInfo_Chunk) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "index":
{
var f 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
f = in.Uint32()
x.Index = f
}
case "total":
{
var f 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
f = in.Uint32()
x.Total = f
}
}
@ -2921,16 +2548,10 @@ func (x *ECInfo) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"chunks\":"
out.RawString(prefix)
const prefix string = ",\"chunks\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.Chunks {
if i != 0 {

View file

@ -190,25 +190,14 @@ func (x *Address) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerID\":"
out.RawString(prefix)
const prefix string = ",\"containerID\":"
out.RawString(prefix[1:])
x.ContainerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"objectID\":"
const prefix string = ",\"objectID\":"
out.RawString(prefix)
x.ObjectId.MarshalEasyJSON(out)
}
@ -343,21 +332,11 @@ func (x *ObjectID) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
const prefix string = ",\"value\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Value)
}
out.RawByte('}')
}
@ -390,13 +369,7 @@ func (x *ObjectID) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "value":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Value = f
}
}
@ -488,21 +461,11 @@ func (x *ContainerID) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
const prefix string = ",\"value\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Value)
}
out.RawByte('}')
}
@ -535,13 +498,7 @@ func (x *ContainerID) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "value":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Value = f
}
}
@ -633,21 +590,11 @@ func (x *OwnerID) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
const prefix string = ",\"value\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Value)
}
out.RawByte('}')
}
@ -680,13 +627,7 @@ func (x *OwnerID) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "value":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Value = f
}
}
@ -798,25 +739,14 @@ func (x *Version) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"major\":"
out.RawString(prefix)
const prefix string = ",\"major\":"
out.RawString(prefix[1:])
out.Uint32(x.Major)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"minor\":"
const prefix string = ",\"minor\":"
out.RawString(prefix)
out.Uint32(x.Minor)
}
@ -851,29 +781,13 @@ func (x *Version) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "major":
{
var f 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
f = in.Uint32()
x.Major = f
}
case "minor":
{
var f 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
f = in.Uint32()
x.Minor = f
}
}
@ -1005,50 +919,21 @@ func (x *Signature) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
if x.Sign != nil {
out.Base64Bytes(x.Sign)
} else {
out.String("")
}
out.Base64Bytes(x.Sign)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"scheme\":"
const prefix string = ",\"scheme\":"
out.RawString(prefix)
v := int32(x.Scheme)
if vv, ok := SignatureScheme_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
out.Int32(int32(x.Scheme))
}
out.RawByte('}')
}
@ -1081,25 +966,13 @@ func (x *Signature) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "key":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Key = f
}
case "signature":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Sign = f
}
case "scheme":
@ -1233,35 +1106,16 @@ func (x *SignatureRFC6979) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
if x.Key != nil {
out.Base64Bytes(x.Key)
} else {
out.String("")
}
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
if x.Sign != nil {
out.Base64Bytes(x.Sign)
} else {
out.String("")
}
out.Base64Bytes(x.Sign)
}
out.RawByte('}')
}
@ -1294,25 +1148,13 @@ func (x *SignatureRFC6979) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "key":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Key = f
}
case "signature":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Sign = f
}
}
@ -1424,36 +1266,16 @@ func (x *Checksum) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"type\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Type))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sum\":"
const prefix string = ",\"sum\":"
out.RawString(prefix)
if x.Sum != nil {
out.Base64Bytes(x.Sum)
} else {
out.String("")
}
out.Base64Bytes(x.Sum)
}
out.RawByte('}')
}
@ -1508,13 +1330,7 @@ func (x *Checksum) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "sum":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Sum = f
}
}

View file

@ -2,16 +2,13 @@ package client
import (
"context"
"google.golang.org/grpc"
)
// CallOption is a messaging session option within Protobuf RPC.
type CallOption func(*callParameters)
type callParameters struct {
ctx context.Context // nolint:containedctx
dialer func(context.Context, grpc.ClientConnInterface) error
ctx context.Context // nolint:containedctx
}
func defaultCallParameters() *callParameters {
@ -30,11 +27,3 @@ func WithContext(ctx context.Context) CallOption {
prm.ctx = ctx
}
}
// WithDialer returns option to specify grpc dialer. If passed, it will be
// called after the connection is successfully created.
func WithDialer(dialer func(context.Context, grpc.ClientConnInterface) error) CallOption {
return func(prm *callParameters) {
prm.dialer = dialer
}
}

View file

@ -12,7 +12,7 @@ import (
var errInvalidEndpoint = errors.New("invalid endpoint options")
func (c *Client) openGRPCConn(ctx context.Context, dialer func(ctx context.Context, cc grpcstd.ClientConnInterface) error) error {
func (c *Client) openGRPCConn(ctx context.Context) error {
if c.conn != nil {
return nil
}
@ -21,21 +21,15 @@ func (c *Client) openGRPCConn(ctx context.Context, dialer func(ctx context.Conte
return errInvalidEndpoint
}
dialCtx, cancel := context.WithTimeout(ctx, c.dialTimeout)
var err error
c.conn, err = grpcstd.NewClient(c.addr, c.grpcDialOpts...)
c.conn, err = grpcstd.DialContext(dialCtx, c.addr, c.grpcDialOpts...)
cancel()
if err != nil {
return fmt.Errorf("gRPC new client: %w", err)
}
if dialer != nil {
ctx, cancel := context.WithTimeout(ctx, c.dialTimeout)
defer cancel()
if err := dialer(ctx, c.conn); err != nil {
_ = c.conn.Close()
return fmt.Errorf("gRPC dial: %w", err)
}
return fmt.Errorf("gRPC dial: %w", err)
}
return nil

View file

@ -46,7 +46,7 @@ func (c *Client) Init(info common.CallMethodInfo, opts ...CallOption) (MessageRe
opt(prm)
}
if err := c.openGRPCConn(prm.ctx, prm.dialer); err != nil {
if err := c.openGRPCConn(prm.ctx); err != nil {
return nil, err
}

View file

@ -37,6 +37,7 @@ func (c *cfg) initDefault() {
c.dialTimeout = defaultDialTimeout
c.rwTimeout = defaultRWTimeout
c.grpcDialOpts = []grpc.DialOption{
grpc.WithBlock(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
}
}

View file

@ -12,7 +12,6 @@ import (
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
type CreateRequest_Body struct {
@ -118,29 +117,16 @@ func (x *CreateRequest_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerId\":"
out.RawString(prefix)
const prefix string = ",\"ownerId\":"
out.RawString(prefix[1:])
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"expiration\":"
const prefix string = ",\"expiration\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Expiration, 10)
out.RawByte('"')
out.Uint64(x.Expiration)
}
out.RawByte('}')
}
@ -180,15 +166,7 @@ func (x *CreateRequest_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "expiration":
{
var f 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
f = in.Uint64()
x.Expiration = f
}
}
@ -347,35 +325,19 @@ func (x *CreateRequest) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}
@ -537,35 +499,16 @@ func (x *CreateResponse_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"id\":"
out.RawString(prefix)
if x.Id != nil {
out.Base64Bytes(x.Id)
} else {
out.String("")
}
const prefix string = ",\"id\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Id)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionKey\":"
const prefix string = ",\"sessionKey\":"
out.RawString(prefix)
if x.SessionKey != nil {
out.Base64Bytes(x.SessionKey)
} else {
out.String("")
}
out.Base64Bytes(x.SessionKey)
}
out.RawByte('}')
}
@ -598,25 +541,13 @@ func (x *CreateResponse_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "id":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Id = f
}
case "sessionKey":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.SessionKey = f
}
}
@ -775,35 +706,19 @@ func (x *CreateResponse) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaHeader\":"
const prefix string = ",\"metaHeader\":"
out.RawString(prefix)
x.MetaHeader.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"verifyHeader\":"
const prefix string = ",\"verifyHeader\":"
out.RawString(prefix)
x.VerifyHeader.MarshalEasyJSON(out)
}

View file

@ -179,25 +179,14 @@ func (x *ObjectSessionContext_Target) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"container\":"
out.RawString(prefix)
const prefix string = ",\"container\":"
out.RawString(prefix[1:])
x.Container.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"objects\":"
const prefix string = ",\"objects\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Objects {
@ -369,30 +358,14 @@ func (x *ObjectSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"verb\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Verb))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"target\":"
const prefix string = ",\"target\":"
out.RawString(prefix)
x.Target.MarshalEasyJSON(out)
}
@ -623,40 +596,19 @@ func (x *ContainerSessionContext) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"verb\":"
out.RawString(prefix[1:])
out.Int32(int32(x.Verb))
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"wildcard\":"
const prefix string = ",\"wildcard\":"
out.RawString(prefix)
out.Bool(x.Wildcard)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"containerID\":"
const prefix string = ",\"containerID\":"
out.RawString(prefix)
x.ContainerId.MarshalEasyJSON(out)
}
@ -852,43 +804,21 @@ func (x *SessionToken_Body_TokenLifetime) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"exp\":"
out.RawString(prefix[1:])
out.Uint64(x.Exp)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"nbf\":"
const prefix string = ",\"nbf\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Nbf, 10)
out.RawByte('"')
out.Uint64(x.Nbf)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"iat\":"
const prefix string = ",\"iat\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Iat, 10)
out.RawByte('"')
out.Uint64(x.Iat)
}
out.RawByte('}')
}
@ -921,43 +851,19 @@ func (x *SessionToken_Body_TokenLifetime) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "exp":
{
var f 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
f = in.Uint64()
x.Exp = f
}
case "nbf":
{
var f 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
f = in.Uint64()
x.Nbf = f
}
case "iat":
{
var f 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
f = in.Uint64()
x.Iat = f
}
}
@ -1179,76 +1085,37 @@ func (x *SessionToken_Body) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"id\":"
out.RawString(prefix)
if x.Id != nil {
out.Base64Bytes(x.Id)
} else {
out.String("")
}
const prefix string = ",\"id\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.Id)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ownerID\":"
const prefix string = ",\"ownerID\":"
out.RawString(prefix)
x.OwnerId.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"lifetime\":"
const prefix string = ",\"lifetime\":"
out.RawString(prefix)
x.Lifetime.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionKey\":"
const prefix string = ",\"sessionKey\":"
out.RawString(prefix)
if x.SessionKey != nil {
out.Base64Bytes(x.SessionKey)
} else {
out.String("")
}
out.Base64Bytes(x.SessionKey)
}
switch xx := x.Context.(type) {
case *SessionToken_Body_Object:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"object\":"
const prefix string = ",\"object\":"
out.RawString(prefix)
xx.Object.MarshalEasyJSON(out)
}
case *SessionToken_Body_Container:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"container\":"
const prefix string = ",\"container\":"
out.RawString(prefix)
xx.Container.MarshalEasyJSON(out)
}
@ -1284,13 +1151,7 @@ func (x *SessionToken_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "id":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Id = f
}
case "ownerID":
@ -1310,13 +1171,7 @@ func (x *SessionToken_Body) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "sessionKey":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.SessionKey = f
}
case "object":
@ -1468,25 +1323,14 @@ func (x *SessionToken) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"body\":"
out.RawString(prefix)
const prefix string = ",\"body\":"
out.RawString(prefix[1:])
x.Body.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"signature\":"
const prefix string = ",\"signature\":"
out.RawString(prefix)
x.Signature.MarshalEasyJSON(out)
}
@ -1641,25 +1485,14 @@ func (x *XHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"key\":"
out.RawString(prefix)
const prefix string = ",\"key\":"
out.RawString(prefix[1:])
out.String(x.Key)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
out.String(x.Value)
}
@ -1950,47 +1783,24 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"epoch\":"
const prefix string = ",\"epoch\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
out.RawByte('"')
out.Uint64(x.Epoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ttl\":"
const prefix string = ",\"ttl\":"
out.RawString(prefix)
out.Uint32(x.Ttl)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"xHeaders\":"
const prefix string = ",\"xHeaders\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.XHeaders {
@ -2002,46 +1812,24 @@ func (x *RequestMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"sessionToken\":"
const prefix string = ",\"sessionToken\":"
out.RawString(prefix)
x.SessionToken.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"bearerToken\":"
const prefix string = ",\"bearerToken\":"
out.RawString(prefix)
x.BearerToken.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"origin\":"
const prefix string = ",\"origin\":"
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"magicNumber\":"
const prefix string = ",\"magicNumber\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.MagicNumber, 10)
out.RawByte('"')
out.Uint64(x.MagicNumber)
}
out.RawByte('}')
}
@ -2081,29 +1869,13 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "epoch":
{
var f 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
f = in.Uint64()
x.Epoch = f
}
case "ttl":
{
var f 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
f = in.Uint32()
x.Ttl = f
}
case "xHeaders":
@ -2144,15 +1916,7 @@ func (x *RequestMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "magicNumber":
{
var f 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
f = in.Uint64()
x.MagicNumber = f
}
}
@ -2359,47 +2123,24 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"version\":"
out.RawString(prefix)
const prefix string = ",\"version\":"
out.RawString(prefix[1:])
x.Version.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"epoch\":"
const prefix string = ",\"epoch\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.Epoch, 10)
out.RawByte('"')
out.Uint64(x.Epoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"ttl\":"
const prefix string = ",\"ttl\":"
out.RawString(prefix)
out.Uint32(x.Ttl)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"xHeaders\":"
const prefix string = ",\"xHeaders\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.XHeaders {
@ -2411,22 +2152,12 @@ func (x *ResponseMetaHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"origin\":"
const prefix string = ",\"origin\":"
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"status\":"
const prefix string = ",\"status\":"
out.RawString(prefix)
x.Status.MarshalEasyJSON(out)
}
@ -2468,29 +2199,13 @@ func (x *ResponseMetaHeader) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "epoch":
{
var f 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
f = in.Uint64()
x.Epoch = f
}
case "ttl":
{
var f 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
f = in.Uint32()
x.Ttl = f
}
case "xHeaders":
@ -2682,45 +2397,24 @@ func (x *RequestVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"bodySignature\":"
out.RawString(prefix)
const prefix string = ",\"bodySignature\":"
out.RawString(prefix[1:])
x.BodySignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaSignature\":"
const prefix string = ",\"metaSignature\":"
out.RawString(prefix)
x.MetaSignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"originSignature\":"
const prefix string = ",\"originSignature\":"
out.RawString(prefix)
x.OriginSignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"origin\":"
const prefix string = ",\"origin\":"
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}
@ -2941,45 +2635,24 @@ func (x *ResponseVerificationHeader) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"bodySignature\":"
out.RawString(prefix)
const prefix string = ",\"bodySignature\":"
out.RawString(prefix[1:])
x.BodySignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"metaSignature\":"
const prefix string = ",\"metaSignature\":"
out.RawString(prefix)
x.MetaSignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"originSignature\":"
const prefix string = ",\"originSignature\":"
out.RawString(prefix)
x.OriginSignature.MarshalEasyJSON(out)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"origin\":"
const prefix string = ",\"origin\":"
out.RawString(prefix)
x.Origin.MarshalEasyJSON(out)
}

View file

@ -368,31 +368,16 @@ func (x *Status_Detail) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"id\":"
out.RawString(prefix)
const prefix string = ",\"id\":"
out.RawString(prefix[1:])
out.Uint32(x.Id)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"value\":"
const prefix string = ",\"value\":"
out.RawString(prefix)
if x.Value != nil {
out.Base64Bytes(x.Value)
} else {
out.String("")
}
out.Base64Bytes(x.Value)
}
out.RawByte('}')
}
@ -425,27 +410,13 @@ func (x *Status_Detail) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "id":
{
var f 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
f = in.Uint32()
x.Id = f
}
case "value":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.Value = f
}
}
@ -583,35 +554,19 @@ func (x *Status) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"code\":"
out.RawString(prefix)
const prefix string = ",\"code\":"
out.RawString(prefix[1:])
out.Uint32(x.Code)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"message\":"
const prefix string = ",\"message\":"
out.RawString(prefix)
out.String(x.Message)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"details\":"
const prefix string = ",\"details\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Details {
@ -653,15 +608,7 @@ func (x *Status) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "code":
{
var f 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
f = in.Uint32()
x.Code = f
}
case "message":

View file

@ -63,8 +63,6 @@ const (
SignatureVerificationFail
// NodeUnderMaintenance is a local Code value for NODE_UNDER_MAINTENANCE status.
NodeUnderMaintenance
// InvalidArgument is a local Code value for INVALID_ARGUMENT status.
InvalidArgument
)
const (

View file

@ -12,7 +12,6 @@ import (
easyproto "github.com/VictoriaMetrics/easyproto"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
strconv "strconv"
)
type Tombstone struct {
@ -141,41 +140,19 @@ func (x *Tombstone) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
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 = ",\"expirationEpoch\":"
out.RawString(prefix[1:])
out.Uint64(x.ExpirationEpoch)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"splitID\":"
const prefix string = ",\"splitID\":"
out.RawString(prefix)
if x.SplitId != nil {
out.Base64Bytes(x.SplitId)
} else {
out.String("")
}
out.Base64Bytes(x.SplitId)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"members\":"
const prefix string = ",\"members\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.Members {
@ -217,27 +194,13 @@ func (x *Tombstone) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "expirationEpoch":
{
var f 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
f = in.Uint64()
x.ExpirationEpoch = f
}
case "splitID":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.SplitId = f
}
case "members":

View file

@ -26,34 +26,11 @@ func nonZero[T protoInt]() T {
func TestStableMarshalSingle(t *testing.T) {
t.Run("empty", func(t *testing.T) {
t.Run("proto", func(t *testing.T) {
input := &generated.Primitives{}
require.Zero(t, input.StableSize())
input := &generated.Primitives{}
require.Zero(t, input.StableSize())
r := input.MarshalProtobuf(nil)
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)
})
r := input.MarshalProtobuf(nil)
require.Empty(t, r)
})
marshalCases := []struct {
@ -99,12 +76,6 @@ func TestStableMarshalSingle(t *testing.T) {
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, tc.input, &actualFrostfs)
@ -117,7 +88,6 @@ func TestStableMarshalSingle(t *testing.T) {
func primitivesEqual(t *testing.T, a *generated.Primitives, b *test.Primitives) {
// 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.FieldB, b.FieldB)
require.Equal(t, a.FieldC, b.FieldC)

View file

@ -130,16 +130,10 @@ func (x *Primitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"innerField\":"
out.RawString(prefix)
const prefix string = ",\"innerField\":"
out.RawString(prefix[1:])
out.Uint32(x.InnerField)
}
out.RawByte('}')
@ -173,15 +167,7 @@ func (x *Primitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "innerField":
{
var f 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
f = in.Uint32()
x.InnerField = f
}
}
@ -574,168 +560,78 @@ func (x *Primitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldA\":"
out.RawString(prefix)
if x.FieldA != nil {
out.Base64Bytes(x.FieldA)
} else {
out.String("")
}
const prefix string = ",\"fieldA\":"
out.RawString(prefix[1:])
out.Base64Bytes(x.FieldA)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldB\":"
const prefix string = ",\"fieldB\":"
out.RawString(prefix)
out.String(x.FieldB)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldC\":"
const prefix string = ",\"fieldC\":"
out.RawString(prefix)
out.Bool(x.FieldC)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldD\":"
const prefix string = ",\"fieldD\":"
out.RawString(prefix)
out.Int32(x.FieldD)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldE\":"
const prefix string = ",\"fieldE\":"
out.RawString(prefix)
out.Uint32(x.FieldE)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldF\":"
const prefix string = ",\"fieldF\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldF, 10)
out.RawByte('"')
out.Int64(x.FieldF)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldG\":"
const prefix string = ",\"fieldG\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldG, 10)
out.RawByte('"')
out.Uint64(x.FieldG)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldI\":"
const prefix string = ",\"fieldI\":"
out.RawString(prefix)
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldI, 10)
out.RawByte('"')
out.Uint64(x.FieldI)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldJ\":"
const prefix string = ",\"fieldJ\":"
out.RawString(prefix)
out.Float64(x.FieldJ)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldK\":"
const prefix string = ",\"fieldK\":"
out.RawString(prefix)
out.Uint32(x.FieldK)
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldH\":"
const prefix string = ",\"fieldH\":"
out.RawString(prefix)
v := int32(x.FieldH)
if vv, ok := Primitives_SomeEnum_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}
out.Int32(int32(x.FieldH))
}
switch xx := x.FieldM.(type) {
case *Primitives_FieldMa:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldMa\":"
const prefix string = ",\"fieldMa\":"
out.RawString(prefix)
if xx.FieldMa != nil {
out.Base64Bytes(xx.FieldMa)
} else {
out.String("")
}
out.Base64Bytes(xx.FieldMa)
}
case *Primitives_FieldMe:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldMe\":"
const prefix string = ",\"fieldMe\":"
out.RawString(prefix)
out.Uint32(xx.FieldMe)
}
case *Primitives_FieldAux:
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldAux\":"
const prefix string = ",\"fieldAux\":"
out.RawString(prefix)
xx.FieldAux.MarshalEasyJSON(out)
}
@ -771,13 +667,7 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "fieldA":
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
x.FieldA = f
}
case "fieldB":
@ -795,71 +685,31 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "fieldD":
{
var f 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
f = in.Int32()
x.FieldD = f
}
case "fieldE":
{
var f 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
f = in.Uint32()
x.FieldE = f
}
case "fieldF":
{
var f 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
f = in.Int64()
x.FieldF = f
}
case "fieldG":
{
var f 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
f = in.Uint64()
x.FieldG = f
}
case "fieldI":
{
var f 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
f = in.Uint64()
x.FieldI = f
}
case "fieldJ":
@ -871,15 +721,7 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "fieldK":
{
var f 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
f = in.Uint32()
x.FieldK = f
}
case "fieldH":
@ -909,13 +751,7 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
x.FieldM = xx
{
var f []byte
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
xx.FieldMa = f
}
case "fieldMe":
@ -923,15 +759,7 @@ func (x *Primitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
x.FieldM = xx
{
var f 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
f = in.Uint32()
xx.FieldMe = f
}
case "fieldAux":
@ -1054,16 +882,10 @@ func (x *RepPrimitives_Aux) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"innerField\":"
out.RawString(prefix)
const prefix string = ",\"innerField\":"
out.RawString(prefix[1:])
out.Uint32(x.InnerField)
}
out.RawByte('}')
@ -1097,15 +919,7 @@ func (x *RepPrimitives_Aux) UnmarshalEasyJSON(in *jlexer.Lexer) {
case "innerField":
{
var f 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
f = in.Uint32()
x.InnerField = f
}
}
@ -1350,36 +1164,21 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawString("null")
return
}
first := true
out.RawByte('{')
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldA\":"
out.RawString(prefix)
const prefix string = ",\"fieldA\":"
out.RawString(prefix[1:])
out.RawByte('[')
for i := range x.FieldA {
if i != 0 {
out.RawByte(',')
}
if x.FieldA[i] != nil {
out.Base64Bytes(x.FieldA[i])
} else {
out.String("")
}
out.Base64Bytes(x.FieldA[i])
}
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldB\":"
const prefix string = ",\"fieldB\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldB {
@ -1391,12 +1190,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldC\":"
const prefix string = ",\"fieldC\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldC {
@ -1408,12 +1202,7 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldD\":"
const prefix string = ",\"fieldD\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldD {
@ -1425,69 +1214,43 @@ func (x *RepPrimitives) MarshalEasyJSON(out *jwriter.Writer) {
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldE\":"
const prefix string = ",\"fieldE\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldE {
if i != 0 {
out.RawByte(',')
}
out.RawByte('"')
out.Buffer.Buf = strconv.AppendInt(out.Buffer.Buf, x.FieldE[i], 10)
out.RawByte('"')
out.Int64(x.FieldE[i])
}
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldF\":"
const prefix string = ",\"fieldF\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldF {
if i != 0 {
out.RawByte(',')
}
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldF[i], 10)
out.RawByte('"')
out.Uint64(x.FieldF[i])
}
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldFu\":"
const prefix string = ",\"fieldFu\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldFu {
if i != 0 {
out.RawByte(',')
}
out.RawByte('"')
out.Buffer.Buf = strconv.AppendUint(out.Buffer.Buf, x.FieldFu[i], 10)
out.RawByte('"')
out.Uint64(x.FieldFu[i])
}
out.RawByte(']')
}
{
if !first {
out.RawByte(',')
} else {
first = false
}
const prefix string = "\"fieldAux\":"
const prefix string = ",\"fieldAux\":"
out.RawString(prefix)
out.RawByte('[')
for i := range x.FieldAux {
@ -1532,13 +1295,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list [][]byte
in.Delim('[')
for !in.IsDelim(']') {
{
tmp := in.Bytes()
if len(tmp) == 0 {
tmp = nil
}
f = tmp
}
f = in.Bytes()
list = append(list, f)
in.WantComma()
}
@ -1564,15 +1321,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list []int32
in.Delim('[')
for !in.IsDelim(']') {
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
f = in.Int32()
list = append(list, f)
in.WantComma()
}
@ -1585,15 +1334,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list []uint32
in.Delim('[')
for !in.IsDelim(']') {
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
f = in.Uint32()
list = append(list, f)
in.WantComma()
}
@ -1606,15 +1347,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list []int64
in.Delim('[')
for !in.IsDelim(']') {
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
f = in.Int64()
list = append(list, f)
in.WantComma()
}
@ -1627,15 +1360,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list []uint64
in.Delim('[')
for !in.IsDelim(']') {
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
f = in.Uint64()
list = append(list, f)
in.WantComma()
}
@ -1648,15 +1373,7 @@ func (x *RepPrimitives) UnmarshalEasyJSON(in *jlexer.Lexer) {
var list []uint64
in.Delim('[')
for !in.IsDelim(']') {
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
f = in.Uint64()
list = append(list, f)
in.WantComma()
}

View file

@ -59,35 +59,6 @@ func emitJSONUnmarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
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) {
g.P("{")
defer g.P("}")
@ -112,20 +83,30 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string
enumType := fieldType(g, f).String()
g.P("var parsedValue " + enumType)
emitJSONReadEnum(g, "parsedValue", enumType)
g.P(`switch v := in.Interface().(type) {
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"
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
emitJSONParseInteger(g, "pv", "ParseInt", 32, "int32")
template = "%s = pv"
template = "%s = in.Int32()"
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
emitJSONParseInteger(g, "pv", "ParseUint", 32, "uint32")
template = "%s = pv"
template = "%s = in.Uint32()"
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
emitJSONParseInteger(g, "pv", "ParseInt", 64, "int64")
template = "%s = pv"
template = "%s = in.Int64()"
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
emitJSONParseInteger(g, "pv", "ParseUint", 64, "uint64")
template = "%s = pv"
template = "%s = in.Uint64()"
case protoreflect.FloatKind:
template = "%s = in.Float32()"
case protoreflect.DoubleKind:
@ -133,17 +114,7 @@ func emitJSONFieldRead(g *protogen.GeneratedFile, f *protogen.Field, name string
case protoreflect.StringKind:
template = "%s = in.String()"
case protoreflect.BytesKind:
// 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
}`
template = "%s = in.Bytes()"
case protoreflect.MessageKind:
if f.Desc.IsList() {
g.P("f = ", fieldType(g, f)[2:], "{}")
@ -176,11 +147,8 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
g.P("func (x *", msg.GoIdent.GoName, ") MarshalEasyJSON(out *", jwriterPackage.Ident("Writer"), ") {")
g.P(`if x == nil { out.RawString("null"); return }`)
if len(msg.Fields) != 0 {
g.P("first := true")
}
g.P("out.RawByte('{')")
for _, f := range msg.Fields {
for i, f := range msg.Fields {
if f.Oneof != nil {
if f.Oneof.Fields[0] != f {
continue
@ -189,38 +157,29 @@ func emitJSONMarshal(g *protogen.GeneratedFile, msg *protogen.Message) {
g.P("switch xx := x.", f.Oneof.GoName, ".(type) {")
for _, ff := range f.Oneof.Fields {
g.P("case *", ff.GoIdent, ":")
emitJSONFieldWrite(g, ff, "xx")
emitJSONFieldWrite(g, ff, "xx", i == 0)
}
g.P("}")
continue
}
emitJSONFieldWrite(g, f, "x")
emitJSONFieldWrite(g, f, "x", i == 0)
}
g.P("out.RawByte('}')")
g.P("}")
}
func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string) {
func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name string, first bool) {
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
// 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() {
selector += "[i]"
g.P("out.RawByte('[')")
@ -236,27 +195,15 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
case protoreflect.BoolKind:
template = "out.Bool(%s)"
case protoreflect.EnumKind:
enumType := fieldType(g, f).String()
template = `v := int32(%s)
if vv, ok := ` + enumType + `_name[v]; ok {
out.String(vv)
} else {
out.Int32(v)
}`
template = "out.Int32(int32(%s))"
case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:
template = "out.Int32(%s)"
case protoreflect.Uint32Kind, protoreflect.Fixed32Kind:
template = "out.Uint32(%s)"
case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:
g.P("out.RawByte('\"')")
g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendInt"), "(out.Buffer.Buf, ", selector, ", 10)")
g.P("out.RawByte('\"')")
return
template = "out.Int64(%s)"
case protoreflect.Uint64Kind, protoreflect.Fixed64Kind:
g.P("out.RawByte('\"')")
g.P("out.Buffer.Buf = ", strconvPackage.Ident("AppendUint"), "(out.Buffer.Buf, ", selector, ", 10)")
g.P("out.RawByte('\"')")
return
template = "out.Uint64(%s)"
case protoreflect.FloatKind:
template = "out.Float32(%s)"
case protoreflect.DoubleKind:
@ -264,10 +211,7 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin
case protoreflect.StringKind:
template = "out.String(%s)"
case protoreflect.BytesKind:
g.P("if ", selector, "!= nil {")
g.P("out.Base64Bytes(", selector, ")")
g.P("} else { out.String(\"\") }")
return
template = "out.Base64Bytes(%s)"
case protoreflect.MessageKind:
template = "%s.MarshalEasyJSON(out)"
case protoreflect.GroupKind: