From d157c561b790e37bd9722e0139470b8b11725dc8 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Wed, 7 Sep 2022 19:43:01 +0300 Subject: [PATCH] change proto generator to std gogo --- go.mod | 70 +- go.sum | 250 +- pkg/acl/aclchanges/aclpb/aclchanges.pb.go | 2416 ++++------------- pkg/acl/acltree/aclstatebuilder.go | 186 ++ pkg/acl/acltree/change.go | 97 + pkg/acl/example/plaintextdocument/document.go | 169 ++ .../plaintextdocument/plaintextdocstate.go | 59 + pkg/acl/list/aclstate.go | 304 ++- pkg/acl/list/changebuilder.go | 96 +- .../testutils/testchanges/proto/test.pb.go | 374 +-- .../treestoragebuilder/treestoragebuilder.go | 539 ++++ .../treestoragebuildergraph_nix.go | 162 ++ pkg/acl/tree/treegraph_nix.go | 47 +- service/document/service.go | 151 +- service/net/pool/message.go | 8 +- service/space/remotediff/remotediff.go | 22 +- service/space/service.go | 7 +- service/space/space.go | 2 +- service/space/spacesync/spacesync.pb.go | 327 +-- service/sync/message/service.go | 2 +- service/sync/requesthandler/requesthandler.go | 279 +- syncproto/helpers.go | 50 +- syncproto/sync.pb.go | 1998 +++++--------- 23 files changed, 3267 insertions(+), 4348 deletions(-) create mode 100644 pkg/acl/acltree/aclstatebuilder.go create mode 100644 pkg/acl/acltree/change.go create mode 100644 pkg/acl/example/plaintextdocument/document.go create mode 100644 pkg/acl/example/plaintextdocument/plaintextdocstate.go create mode 100644 pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go create mode 100644 pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go diff --git a/go.mod b/go.mod index 4f505ee8..e27f9d45 100644 --- a/go.mod +++ b/go.mod @@ -3,32 +3,20 @@ module github.com/anytypeio/go-anytype-infrastructure-experiments go 1.18 require ( - github.com/akrylysov/pogreb v0.10.1 - github.com/anytypeio/go-chash v0.0.0-20220629194632-4ad1154fe232 github.com/awalterschulze/gographviz v0.0.0-20190522210029-fa59802746ab github.com/cespare/xxhash v1.1.0 github.com/goccy/go-graphviz v0.0.9 github.com/gogo/protobuf v1.3.2 github.com/huandu/skiplist v1.2.0 - github.com/ipfs/go-block-format v0.0.3 - github.com/ipfs/go-blockservice v0.4.0 - github.com/ipfs/go-cid v0.3.0 - github.com/ipfs/go-datastore v0.6.0 - github.com/ipfs/go-ipfs-blockstore v1.2.0 - github.com/ipfs/go-ipfs-chunker v0.0.5 - github.com/ipfs/go-ipfs-exchange-interface v0.2.0 - github.com/ipfs/go-ipld-cbor v0.0.6 - github.com/ipfs/go-ipld-format v0.4.0 - github.com/ipfs/go-merkledag v0.7.0 - github.com/ipfs/go-unixfs v0.4.0 + github.com/ipfs/go-cid v0.1.0 github.com/libp2p/go-libp2p v0.20.3 github.com/libp2p/go-libp2p-core v0.16.1 github.com/mr-tron/base58 v1.2.0 - github.com/multiformats/go-multibase v0.1.1 - github.com/multiformats/go-multihash v0.2.1 + github.com/multiformats/go-multibase v0.0.3 + github.com/multiformats/go-multihash v0.1.0 github.com/stretchr/testify v1.8.0 github.com/zeebo/blake3 v0.2.3 - go.uber.org/zap v1.23.0 + go.uber.org/zap v1.21.0 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 gopkg.in/yaml.v3 v3.0.1 storj.io/drpc v0.0.32 @@ -36,61 +24,37 @@ require ( require ( github.com/OneOfOne/xxhash v1.2.8 // indirect - github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect + github.com/anytypeio/go-chash v0.0.0-20220629194632-4ad1154fe232 // indirect github.com/btcsuite/btcd v0.22.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/fogleman/gg v1.3.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/ipfs/bbloom v0.0.4 // indirect - github.com/ipfs/go-bitfield v1.0.0 // indirect - github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect - github.com/ipfs/go-ipfs-files v0.0.3 // indirect - github.com/ipfs/go-ipfs-posinfo v0.0.1 // indirect - github.com/ipfs/go-ipfs-util v0.0.2 // indirect - github.com/ipfs/go-ipld-legacy v0.1.1 // indirect - github.com/ipfs/go-log v1.0.5 // indirect - github.com/ipfs/go-log/v2 v2.5.1 // indirect - github.com/ipfs/go-metrics-interface v0.0.1 // indirect - github.com/ipfs/go-verifcid v0.0.2 // indirect - github.com/ipld/go-codec-dagpb v1.5.0 // indirect - github.com/ipld/go-ipld-prime v0.18.0 // indirect - github.com/jbenet/goprocess v0.1.4 // indirect - github.com/klauspost/cpuid/v2 v2.1.1 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/klauspost/cpuid/v2 v2.0.12 // indirect + github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/libp2p/go-openssl v0.0.7 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/minio/sha256-simd v1.0.0 // indirect - github.com/multiformats/go-base32 v0.1.0 // indirect + github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-base36 v0.1.0 // indirect github.com/multiformats/go-multiaddr v0.5.0 // indirect - github.com/multiformats/go-multicodec v0.5.0 // indirect + github.com/multiformats/go-multicodec v0.4.1 // indirect github.com/multiformats/go-varint v0.0.6 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect - github.com/whyrusleeping/cbor-gen v0.0.0-20220514204315-f29c37e9c44c // indirect - github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect github.com/zeebo/errs v1.2.2 // indirect - go.opentelemetry.io/otel v1.9.0 // indirect - go.opentelemetry.io/otel/trace v1.9.0 // indirect - go.uber.org/atomic v1.10.0 // indirect + go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect - golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect + golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect google.golang.org/protobuf v1.28.1 // indirect - lukechampine.com/blake3 v1.1.7 // indirect + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + lukechampine.com/blake3 v1.1.6 // indirect ) diff --git a/go.sum b/go.sum index 2ce17444..84667305 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,6 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= -github.com/akrylysov/pogreb v0.10.1 h1:FqlR8VR7uCbJdfUob916tPM+idpKgeESDXOA1K0DK4w= -github.com/akrylysov/pogreb v0.10.1/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI= -github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a h1:E/8AP5dFtMhl5KPJz66Kt9G0n+7Sn41Fy1wv9/jHOrc= -github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/anytypeio/go-chash v0.0.0-20220629194632-4ad1154fe232 h1:kMPPZYmJgbs4AJfodbg2OCXg5cp+9LPAJcLZJqmcghk= github.com/anytypeio/go-chash v0.0.0-20220629194632-4ad1154fe232/go.mod h1:+PeHBAWp7gUh/yw6uAauKc5ku0w4cFNg6DUddGxoGq0= github.com/awalterschulze/gographviz v0.0.0-20190522210029-fa59802746ab h1:+cdNqtOJWjvepyhxy23G7z7vmpYCoC65AP0nqi1f53s= @@ -22,7 +17,6 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/corona10/goimagehash v1.0.2 h1:pUfB0LnsJASMPGEZLj7tGY251vF+qLGqOgEP4rUs6kA= github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= -github.com/cskr/pubsub v1.0.2 h1:vlOzMhl6PFn60gRlTQQsIfVwaPB/B/8MziK8FhEPt/0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -32,222 +26,77 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/fogleman/gg v1.3.0 h1:/7zJX8F6AaYQc57WQCyN9cAIz+4bCJGO9B+dyW29am8= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/goccy/go-graphviz v0.0.9 h1:s/FMMJ1Joj6La3S5ApO3Jk2cwM4LpXECC2muFx3IPQQ= github.com/goccy/go-graphviz v0.0.9/go.mod h1:wXVsXxmyMQU6TN3zGRttjNn3h+iCAS7xQFC6TlNvLhk= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= -github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= -github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= -github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= -github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/go-bitfield v1.0.0 h1:y/XHm2GEmD9wKngheWNNCNL0pzrWXZwCdQGv1ikXknQ= -github.com/ipfs/go-bitfield v1.0.0/go.mod h1:N/UiujQy+K+ceU1EF5EkVd1TNqevLrCQMIcAEPrdtus= -github.com/ipfs/go-bitswap v0.8.0 h1:UEV7kogQu2iGggkE9GhLykDrRCUpsNnpu2NODww/srw= -github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= -github.com/ipfs/go-block-format v0.0.3 h1:r8t66QstRp/pd/or4dpnbVfXT5Gt7lOqRvC+/dDTpMc= -github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk= -github.com/ipfs/go-blockservice v0.4.0 h1:7MUijAW5SqdsqEW/EhnNFRJXVF8mGU5aGhZ3CQaCWbY= -github.com/ipfs/go-blockservice v0.4.0/go.mod h1:kRjO3wlGW9mS1aKuiCeGhx9K1DagQ10ACpVO59qgAx4= -github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= -github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= -github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.3.0 h1:gT6Cbs6YePaBNc7l6v5EXt0xTMup1jGV5EU1N+QLVpY= -github.com/ipfs/go-cid v0.3.0/go.mod h1:P+HXFDF4CVhaVayiEb4wkAy7zBHxBwsJyt0Y5U6MLro= -github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= -github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= -github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= -github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= -github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-ipfs-blockstore v1.2.0 h1:n3WTeJ4LdICWs/0VSfjHrlqpPpl6MZ+ySd3j8qz0ykw= -github.com/ipfs/go-ipfs-blockstore v1.2.0/go.mod h1:eh8eTFLiINYNSNawfZOC7HOxNTxpB1PFuA5E1m/7exE= -github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= -github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= -github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= -github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-delay v0.0.1 h1:r/UXYyRcddO6thwOnhiznIAiSvxMECGgtv35Xs1IeRQ= -github.com/ipfs/go-ipfs-ds-help v1.1.0 h1:yLE2w9RAsl31LtfMt91tRZcrx+e61O5mDxFRR994w4Q= -github.com/ipfs/go-ipfs-ds-help v1.1.0/go.mod h1:YR5+6EaebOhfcqVCyqemItCLthrpVNot+rsOU/5IatU= -github.com/ipfs/go-ipfs-exchange-interface v0.2.0 h1:8lMSJmKogZYNo2jjhUs0izT+dck05pqUw4mWNW9Pw6Y= -github.com/ipfs/go-ipfs-exchange-interface v0.2.0/go.mod h1:z6+RhJuDQbqKguVyslSOuVDhqF9JtTrO3eptSAiW2/Y= -github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uYokgWRFidfvEkuA= -github.com/ipfs/go-ipfs-files v0.0.3 h1:ME+QnC3uOyla1ciRPezDW0ynQYK2ikOh9OCKAEg4uUA= -github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4= -github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs= -github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A= -github.com/ipfs/go-ipfs-pq v0.0.2 h1:e1vOOW6MuOwG2lqxcLA+wEn93i/9laCY8sXAw76jFOY= -github.com/ipfs/go-ipfs-routing v0.2.1 h1:E+whHWhJkdN9YeoHZNj5itzc+OR292AJ2uE9FFiW0BY= -github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= -github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= -github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eBQ0= -github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= -github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= -github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= -github.com/ipfs/go-ipld-format v0.3.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= -github.com/ipfs/go-ipld-format v0.4.0 h1:yqJSaJftjmjc9jEOFYlpkwOLVKv68OD27jFLlSghBlQ= -github.com/ipfs/go-ipld-format v0.4.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= -github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2cdcc= -github.com/ipfs/go-ipld-legacy v0.1.1/go.mod h1:8AyKFCjgRPsQFf15ZQgDB8Din4DML/fOmKZkkFkrIEg= -github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= -github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= -github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= -github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= -github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= -github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= -github.com/ipfs/go-merkledag v0.7.0 h1:PHdWOGwx+J2uRAuP9Mu+bz89ulmf3W2QmbSS/N6O29U= -github.com/ipfs/go-merkledag v0.7.0/go.mod h1:/1cuN4VbcDn/xbVMAqjPUwejJYr8W9SvizmyYLU/B7k= -github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= -github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY= -github.com/ipfs/go-peertaskqueue v0.7.0 h1:VyO6G4sbzX80K58N60cCaHsSsypbUNs1GjO5seGNsQ0= -github.com/ipfs/go-unixfs v0.4.0 h1:qSyyxfB/OiDdWHYiSbyaqKC7zfSE/TFL0QdwkRjBm20= -github.com/ipfs/go-unixfs v0.4.0/go.mod h1:I7Nqtm06HgOOd+setAoCU6rf/HgVFHE+peeNuOv/5+g= -github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs= -github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU= -github.com/ipld/go-codec-dagpb v1.5.0 h1:RspDRdsJpLfgCI0ONhTAnbHdySGD4t+LHSPK4X1+R0k= -github.com/ipld/go-codec-dagpb v1.5.0/go.mod h1:0yRIutEFD8o1DGVqw4RSHh+BUTlJA9XWldxaaWR/o4g= -github.com/ipld/go-ipld-prime v0.9.1-0.20210324083106-dc342a9917db/go.mod h1:KvBLMr4PX1gWptgkzRjVZCrLmSGcZCb/jioOQwCqZN8= -github.com/ipld/go-ipld-prime v0.18.0 h1:xUk7NUBSWHEXdjiOu2sLXouFJOMs0yoYzeI5RAqhYQo= -github.com/ipld/go-ipld-prime v0.18.0/go.mod h1:735yXW548CKrLwVCYXzqx90p5deRJMVVxM9eJ4Qe+qE= -github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= -github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/ipfs/go-cid v0.1.0 h1:YN33LQulcRHjfom/i25yoOZR4Telp1Hr/2RU3d0PnC0= +github.com/ipfs/go-cid v0.1.0/go.mod h1:rH5/Xv83Rfy8Rw6xG+id3DYAMUVmem1MowoKwdXmN2o= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.12 h1:p9dKCg8i4gmOxtv35DvrYoWqYzQrvEVdjQ762Y0OqZE= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.1.1 h1:t0wUqjowdm8ezddV5k0tLWVklVuvLJpoHeb4WBdydm0= -github.com/klauspost/cpuid/v2 v2.1.1/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= -github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= -github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= github.com/libp2p/go-libp2p v0.20.3 h1:tjjDNfp7FqdI/7v1rXtB/BtELaPlAThL2uzlj18kcrw= github.com/libp2p/go-libp2p v0.20.3/go.mod h1:I+vndVanE/p/SjFbnA+BEmmfAUEpWxrdXZeyQ1Dus5c= -github.com/libp2p/go-libp2p-asn-util v0.2.0 h1:rg3+Os8jbnO5DxkC7K/Utdi+DkY3q/d1/1q+8WeNAsw= github.com/libp2p/go-libp2p-core v0.16.1 h1:bWoiEBqVkpJ13hbv/f69tHODp86t6mvc4fBN4DkK73M= github.com/libp2p/go-libp2p-core v0.16.1/go.mod h1:O3i/7y+LqUb0N+qhzXjBjjpchgptWAVMG1Voegk7b4c= -github.com/libp2p/go-libp2p-loggables v0.1.0 h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8= -github.com/libp2p/go-libp2p-netutil v0.1.0 h1:zscYDNVEcGxyUpMd0JReUZTrpMfia8PmLKcKF72EAMQ= -github.com/libp2p/go-libp2p-peerstore v0.6.0 h1:HJminhQSGISBIRb93N6WK3t6Fa8OOTnHd/VBjL4mY5A= -github.com/libp2p/go-libp2p-record v0.1.0 h1:wHwBGbFzymoIl69BpgwIu0O6ta3TXGcMPvHUAcodzRc= -github.com/libp2p/go-libp2p-testing v0.9.2 h1:dCpODRtRaDZKF8HXT9qqqgON+OMEB423Knrgeod8j84= -github.com/libp2p/go-msgio v0.2.0 h1:W6shmB+FeynDrUVl2dgFQvzfBZcXiyqY4VmpQLu9FqU= -github.com/libp2p/go-nat v0.1.0 h1:MfVsH6DLcpa04Xr+p8hmVRG4juse0s3J8HyNWYHffXg= -github.com/libp2p/go-netroute v0.2.0 h1:0FpsbsvuSnAhXFnCY0VLFbJOzaK0VnP0r1QT/o4nWRE= github.com/libp2p/go-openssl v0.0.7 h1:eCAzdLejcNVBzP/iZM9vqHnQm+XyCEbSSIheIPRGNsw= github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE= -github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= github.com/multiformats/go-multiaddr v0.5.0 h1:i/JuOoVg4szYQ4YEzDGtb2h0o8M7CG/Yq6cGlcjWZpM= github.com/multiformats/go-multiaddr v0.5.0/go.mod h1:3KAxNkUqLTJ20AAwN4XVX4kZar+bR+gh4zgbfr3SNug= -github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= -github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= -github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= +github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI= -github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= -github.com/multiformats/go-multicodec v0.5.0 h1:EgU6cBe/D7WRwQb1KmnBvU7lrcFGMggZVTPtOW9dDHs= -github.com/multiformats/go-multicodec v0.5.0/go.mod h1:DiY2HFaEp5EhEXb/iYzVAunmyX/aSFMxq2KMKfWEues= -github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= -github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= +github.com/multiformats/go-multicodec v0.4.1 h1:BSJbf+zpghcZMZrwTYBGwy0CPcVZGWiC72Cp8bBd4R4= +github.com/multiformats/go-multicodec v0.4.1/go.mod h1:1Hj/eHRaVWSXiSNNfcEPcwZleTmdNP81xlxDLnWU9GQ= github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= github.com/multiformats/go-multihash v0.0.15/go.mod h1:D6aZrWNLFTV/ynMpKsNtB40mJzmCl4jb1alC0OvHiHg= -github.com/multiformats/go-multihash v0.2.1 h1:aem8ZT0VA2nCHHk7bPJ1BjUbHNciqZC/d16Vve9l108= -github.com/multiformats/go-multihash v0.2.1/go.mod h1:WxoMcYG85AZVQUyRyo9s4wULvW5qrI9vb2Lt6evduFc= -github.com/multiformats/go-multistream v0.3.3 h1:d5PZpjwRgVlbwfdTDjife7XszfZd8KYWfROYFlGcR8o= +github.com/multiformats/go-multihash v0.1.0 h1:CgAgwqk3//SVEw3T+6DqI4mWMyRuDwZtOWcJT0q9+EA= +github.com/multiformats/go-multihash v0.1.0/go.mod h1:RJlXsxt6vHGaia+S8We0ErjhojtKzPP2AH4+kYM7k84= github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5 h1:BvoENQQU+fZ9uukda/RzCAL/191HHwJA5b13R6diVlY= github.com/nfnt/resize v0.0.0-20160724205520-891127d8d1b5/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20190807091052-3d65705ee9f1/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e h1:ZOcivgkkFRnjfoTcGsDq3UQYiBmekwLA+qg0OjyB/ls= -github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e/go.mod h1:uIp+gprXxxrWSjjklXD+mN4wed/tMfjMMmN/9+JsA9o= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa/go.mod h1:2RVY1rIf+2J2o/IM9+vPq9RzmHDSseB7FoXiSNIUsoU= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 h1:RC6RW7j+1+HkWaX/Yh71Ee5ZHaHYt7ZP4sQgUrm6cDU= github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -261,16 +110,6 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/warpfork/go-testmark v0.10.0 h1:E86YlUMYfwIacEsQGlnTvjk1IgYkyTGjPhF0RnwTCmw= -github.com/warpfork/go-wish v0.0.0-20180510122957-5ad1f5abf436/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a h1:G++j5e0OC488te356JvdhaM8YS6nMsjLAYF7JxCv07w= -github.com/warpfork/go-wish v0.0.0-20200122115046-b9ea61034e4a/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= -github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158/go.mod h1:Xj/M2wWU+QdTdRbu/L/1dIZY8/Wb2K9pAhtroQuxJJI= -github.com/whyrusleeping/cbor-gen v0.0.0-20220514204315-f29c37e9c44c h1:6VPKXBDRt7mDUyiHx9X8ROnPYFDf3L7OfEuKCI5dZDI= -github.com/whyrusleeping/cbor-gen v0.0.0-20220514204315-f29c37e9c44c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ= -github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E= -github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f/go.mod h1:p9UJB6dDgdPgMJZs7UjUOdulKyRr9fqkS+6JKAInPy8= -github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -282,60 +121,43 @@ github.com/zeebo/errs v1.2.2 h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g= github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= -go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw= -go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo= -go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc= -go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQgW5XwmSvR/nA2JmJ0RErg= golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b h1:ZmngSVLe/wycRns9MKikG9OWIEjGcGAkacif7oYQaUY= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190302025703-b6889370fb10/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -344,23 +166,14 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210309074719-68d13333faf2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 h1:v6hYoSR9T5oet+pMXwUWkbiVqx/63mlHjefrHmxwfeY= -golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -369,28 +182,25 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw= gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0= -lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= +lukechampine.com/blake3 v1.1.6 h1:H3cROdztr7RCfoaTpGZFQsrqvweFLrqS73j7L7cmR5c= +lukechampine.com/blake3 v1.1.6/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= storj.io/drpc v0.0.32 h1:5p5ZwsK/VOgapaCu+oxaPVwO6UwIs+iwdMiD50+R4PI= storj.io/drpc v0.0.32/go.mod h1:6rcOyR/QQkSTX/9L5ZGtlZaE2PtXTTZl8d+ulSeeYEg= diff --git a/pkg/acl/aclchanges/aclpb/aclchanges.pb.go b/pkg/acl/aclchanges/aclpb/aclchanges.pb.go index c026319c..d42f22ba 100644 --- a/pkg/acl/aclchanges/aclpb/aclchanges.pb.go +++ b/pkg/acl/aclchanges/aclpb/aclchanges.pb.go @@ -22,60 +22,35 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type ACLChangeUserPermissions int32 +type ACLChange_UserPermissions int32 const ( - ACLChange_Admin ACLChangeUserPermissions = 0 - ACLChange_Writer ACLChangeUserPermissions = 1 - ACLChange_Reader ACLChangeUserPermissions = 2 - ACLChange_Removed ACLChangeUserPermissions = 3 + ACLChange_Admin ACLChange_UserPermissions = 0 + ACLChange_Writer ACLChange_UserPermissions = 1 + ACLChange_Reader ACLChange_UserPermissions = 2 + ACLChange_Removed ACLChange_UserPermissions = 3 ) -var ACLChangeUserPermissions_name = map[int32]string{ +var ACLChange_UserPermissions_name = map[int32]string{ 0: "Admin", 1: "Writer", 2: "Reader", 3: "Removed", } -var ACLChangeUserPermissions_value = map[string]int32{ +var ACLChange_UserPermissions_value = map[string]int32{ "Admin": 0, "Writer": 1, "Reader": 2, "Removed": 3, } -func (x ACLChangeUserPermissions) String() string { - return proto.EnumName(ACLChangeUserPermissions_name, int32(x)) +func (x ACLChange_UserPermissions) String() string { + return proto.EnumName(ACLChange_UserPermissions_name, int32(x)) } -func (ACLChangeUserPermissions) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 0} -} - -type HeaderDocType int32 - -const ( - Header_ACL HeaderDocType = 0 - Header_DocTree HeaderDocType = 1 -) - -var HeaderDocType_name = map[int32]string{ - 0: "ACL", - 1: "DocTree", -} - -var HeaderDocType_value = map[string]int32{ - "ACL": 0, - "DocTree": 1, -} - -func (x HeaderDocType) String() string { - return proto.EnumName(HeaderDocType_name, int32(x)) -} - -func (HeaderDocType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{5, 0} +func (ACLChange_UserPermissions) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 0} } type RawChange struct { @@ -138,72 +113,12 @@ func (m *RawChange) GetId() string { return "" } -type RawRecord struct { - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *RawRecord) Reset() { *m = RawRecord{} } -func (m *RawRecord) String() string { return proto.CompactTextString(m) } -func (*RawRecord) ProtoMessage() {} -func (*RawRecord) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{1} -} -func (m *RawRecord) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RawRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RawRecord.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *RawRecord) XXX_Merge(src proto.Message) { - xxx_messageInfo_RawRecord.Merge(m, src) -} -func (m *RawRecord) XXX_Size() int { - return m.Size() -} -func (m *RawRecord) XXX_DiscardUnknown() { - xxx_messageInfo_RawRecord.DiscardUnknown(m) -} - -var xxx_messageInfo_RawRecord proto.InternalMessageInfo - -func (m *RawRecord) GetPayload() []byte { - if m != nil { - return m.Payload - } - return nil -} - -func (m *RawRecord) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *RawRecord) GetId() string { - if m != nil { - return m.Id - } - return "" -} - // the element of change tree used to store and internal apply smartBlock history type ACLChange struct { - TreeHeadIds []string `protobuf:"bytes,1,rep,name=treeHeadIds,proto3" json:"treeHeadIds,omitempty"` - AclHeadIds []string `protobuf:"bytes,2,rep,name=aclHeadIds,proto3" json:"aclHeadIds,omitempty"` - SnapshotBaseId string `protobuf:"bytes,3,opt,name=snapshotBaseId,proto3" json:"snapshotBaseId,omitempty"` - AclData *ACLChangeACLData `protobuf:"bytes,4,opt,name=aclData,proto3" json:"aclData,omitempty"` + TreeHeadIds []string `protobuf:"bytes,1,rep,name=treeHeadIds,proto3" json:"treeHeadIds,omitempty"` + AclHeadIds []string `protobuf:"bytes,2,rep,name=aclHeadIds,proto3" json:"aclHeadIds,omitempty"` + SnapshotBaseId string `protobuf:"bytes,3,opt,name=snapshotBaseId,proto3" json:"snapshotBaseId,omitempty"` + AclData *ACLChange_ACLData `protobuf:"bytes,4,opt,name=aclData,proto3" json:"aclData,omitempty"` // the data is encoded with read key and should be read in ChangesData format ChangesData []byte `protobuf:"bytes,5,opt,name=changesData,proto3" json:"changesData,omitempty"` CurrentReadKeyHash uint64 `protobuf:"varint,6,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` @@ -215,7 +130,7 @@ func (m *ACLChange) Reset() { *m = ACLChange{} } func (m *ACLChange) String() string { return proto.CompactTextString(m) } func (*ACLChange) ProtoMessage() {} func (*ACLChange) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2} + return fileDescriptor_37a022c841a51877, []int{1} } func (m *ACLChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -265,7 +180,7 @@ func (m *ACLChange) GetSnapshotBaseId() string { return "" } -func (m *ACLChange) GetAclData() *ACLChangeACLData { +func (m *ACLChange) GetAclData() *ACLChange_ACLData { if m != nil { return m.AclData } @@ -300,29 +215,30 @@ func (m *ACLChange) GetIdentity() string { return "" } -type ACLChangeACLContentValue struct { +type ACLChange_ACLContentValue struct { // Types that are valid to be assigned to Value: - // *ACLChangeACLContentValueValueOfUserAdd - // *ACLChangeACLContentValueValueOfUserRemove - // *ACLChangeACLContentValueValueOfUserPermissionChange - // *ACLChangeACLContentValueValueOfUserInvite - // *ACLChangeACLContentValueValueOfUserJoin - // *ACLChangeACLContentValueValueOfUserConfirm - Value IsACLChangeACLContentValueValue `protobuf_oneof:"value"` + // + // *ACLChange_ACLContent_Value_UserAdd + // *ACLChange_ACLContent_Value_UserRemove + // *ACLChange_ACLContent_Value_UserPermissionChange + // *ACLChange_ACLContent_Value_UserInvite + // *ACLChange_ACLContent_Value_UserJoin + // *ACLChange_ACLContent_Value_UserConfirm + Value isACLChange_ACLContent_Value_Value `protobuf_oneof:"value"` } -func (m *ACLChangeACLContentValue) Reset() { *m = ACLChangeACLContentValue{} } -func (m *ACLChangeACLContentValue) String() string { return proto.CompactTextString(m) } -func (*ACLChangeACLContentValue) ProtoMessage() {} -func (*ACLChangeACLContentValue) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 0} +func (m *ACLChange_ACLContentValue) Reset() { *m = ACLChange_ACLContentValue{} } +func (m *ACLChange_ACLContentValue) String() string { return proto.CompactTextString(m) } +func (*ACLChange_ACLContentValue) ProtoMessage() {} +func (*ACLChange_ACLContentValue) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 0} } -func (m *ACLChangeACLContentValue) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_ACLContentValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeACLContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_ACLContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeACLContentValue.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_ACLContentValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -332,128 +248,128 @@ func (m *ACLChangeACLContentValue) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *ACLChangeACLContentValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeACLContentValue.Merge(m, src) +func (m *ACLChange_ACLContentValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_ACLContentValue.Merge(m, src) } -func (m *ACLChangeACLContentValue) XXX_Size() int { +func (m *ACLChange_ACLContentValue) XXX_Size() int { return m.Size() } -func (m *ACLChangeACLContentValue) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeACLContentValue.DiscardUnknown(m) +func (m *ACLChange_ACLContentValue) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_ACLContentValue.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeACLContentValue proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_ACLContentValue proto.InternalMessageInfo -type IsACLChangeACLContentValueValue interface { - IsACLChangeACLContentValueValue() +type isACLChange_ACLContent_Value_Value interface { + isACLChange_ACLContent_Value_Value() MarshalTo([]byte) (int, error) Size() int } -type ACLChangeACLContentValueValueOfUserAdd struct { - UserAdd *ACLChangeUserAdd `protobuf:"bytes,1,opt,name=userAdd,proto3,oneof" json:"userAdd,omitempty"` +type ACLChange_ACLContent_Value_UserAdd struct { + UserAdd *ACLChange_UserAdd `protobuf:"bytes,1,opt,name=userAdd,proto3,oneof" json:"userAdd,omitempty"` } -type ACLChangeACLContentValueValueOfUserRemove struct { - UserRemove *ACLChangeUserRemove `protobuf:"bytes,2,opt,name=userRemove,proto3,oneof" json:"userRemove,omitempty"` +type ACLChange_ACLContent_Value_UserRemove struct { + UserRemove *ACLChange_UserRemove `protobuf:"bytes,2,opt,name=userRemove,proto3,oneof" json:"userRemove,omitempty"` } -type ACLChangeACLContentValueValueOfUserPermissionChange struct { - UserPermissionChange *ACLChangeUserPermissionChange `protobuf:"bytes,3,opt,name=userPermissionChange,proto3,oneof" json:"userPermissionChange,omitempty"` +type ACLChange_ACLContent_Value_UserPermissionChange struct { + UserPermissionChange *ACLChange_UserPermissionChange `protobuf:"bytes,3,opt,name=userPermissionChange,proto3,oneof" json:"userPermissionChange,omitempty"` } -type ACLChangeACLContentValueValueOfUserInvite struct { - UserInvite *ACLChangeUserInvite `protobuf:"bytes,4,opt,name=userInvite,proto3,oneof" json:"userInvite,omitempty"` +type ACLChange_ACLContent_Value_UserInvite struct { + UserInvite *ACLChange_UserInvite `protobuf:"bytes,4,opt,name=userInvite,proto3,oneof" json:"userInvite,omitempty"` } -type ACLChangeACLContentValueValueOfUserJoin struct { - UserJoin *ACLChangeUserJoin `protobuf:"bytes,5,opt,name=userJoin,proto3,oneof" json:"userJoin,omitempty"` +type ACLChange_ACLContent_Value_UserJoin struct { + UserJoin *ACLChange_UserJoin `protobuf:"bytes,5,opt,name=userJoin,proto3,oneof" json:"userJoin,omitempty"` } -type ACLChangeACLContentValueValueOfUserConfirm struct { - UserConfirm *ACLChangeUserConfirm `protobuf:"bytes,6,opt,name=userConfirm,proto3,oneof" json:"userConfirm,omitempty"` +type ACLChange_ACLContent_Value_UserConfirm struct { + UserConfirm *ACLChange_UserConfirm `protobuf:"bytes,6,opt,name=userConfirm,proto3,oneof" json:"userConfirm,omitempty"` } -func (*ACLChangeACLContentValueValueOfUserAdd) IsACLChangeACLContentValueValue() {} -func (*ACLChangeACLContentValueValueOfUserRemove) IsACLChangeACLContentValueValue() {} -func (*ACLChangeACLContentValueValueOfUserPermissionChange) IsACLChangeACLContentValueValue() {} -func (*ACLChangeACLContentValueValueOfUserInvite) IsACLChangeACLContentValueValue() {} -func (*ACLChangeACLContentValueValueOfUserJoin) IsACLChangeACLContentValueValue() {} -func (*ACLChangeACLContentValueValueOfUserConfirm) IsACLChangeACLContentValueValue() {} +func (*ACLChange_ACLContent_Value_UserAdd) isACLChange_ACLContent_Value_Value() {} +func (*ACLChange_ACLContent_Value_UserRemove) isACLChange_ACLContent_Value_Value() {} +func (*ACLChange_ACLContent_Value_UserPermissionChange) isACLChange_ACLContent_Value_Value() {} +func (*ACLChange_ACLContent_Value_UserInvite) isACLChange_ACLContent_Value_Value() {} +func (*ACLChange_ACLContent_Value_UserJoin) isACLChange_ACLContent_Value_Value() {} +func (*ACLChange_ACLContent_Value_UserConfirm) isACLChange_ACLContent_Value_Value() {} -func (m *ACLChangeACLContentValue) GetValue() IsACLChangeACLContentValueValue { +func (m *ACLChange_ACLContentValue) GetValue() isACLChange_ACLContent_Value_Value { if m != nil { return m.Value } return nil } -func (m *ACLChangeACLContentValue) GetUserAdd() *ACLChangeUserAdd { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserAdd); ok { +func (m *ACLChange_ACLContentValue) GetUserAdd() *ACLChange_UserAdd { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserAdd); ok { return x.UserAdd } return nil } -func (m *ACLChangeACLContentValue) GetUserRemove() *ACLChangeUserRemove { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserRemove); ok { +func (m *ACLChange_ACLContentValue) GetUserRemove() *ACLChange_UserRemove { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserRemove); ok { return x.UserRemove } return nil } -func (m *ACLChangeACLContentValue) GetUserPermissionChange() *ACLChangeUserPermissionChange { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserPermissionChange); ok { +func (m *ACLChange_ACLContentValue) GetUserPermissionChange() *ACLChange_UserPermissionChange { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserPermissionChange); ok { return x.UserPermissionChange } return nil } -func (m *ACLChangeACLContentValue) GetUserInvite() *ACLChangeUserInvite { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserInvite); ok { +func (m *ACLChange_ACLContentValue) GetUserInvite() *ACLChange_UserInvite { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserInvite); ok { return x.UserInvite } return nil } -func (m *ACLChangeACLContentValue) GetUserJoin() *ACLChangeUserJoin { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserJoin); ok { +func (m *ACLChange_ACLContentValue) GetUserJoin() *ACLChange_UserJoin { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserJoin); ok { return x.UserJoin } return nil } -func (m *ACLChangeACLContentValue) GetUserConfirm() *ACLChangeUserConfirm { - if x, ok := m.GetValue().(*ACLChangeACLContentValueValueOfUserConfirm); ok { +func (m *ACLChange_ACLContentValue) GetUserConfirm() *ACLChange_UserConfirm { + if x, ok := m.GetValue().(*ACLChange_ACLContent_Value_UserConfirm); ok { return x.UserConfirm } return nil } // XXX_OneofWrappers is for the internal use of the proto package. -func (*ACLChangeACLContentValue) XXX_OneofWrappers() []interface{} { +func (*ACLChange_ACLContentValue) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*ACLChangeACLContentValueValueOfUserAdd)(nil), - (*ACLChangeACLContentValueValueOfUserRemove)(nil), - (*ACLChangeACLContentValueValueOfUserPermissionChange)(nil), - (*ACLChangeACLContentValueValueOfUserInvite)(nil), - (*ACLChangeACLContentValueValueOfUserJoin)(nil), - (*ACLChangeACLContentValueValueOfUserConfirm)(nil), + (*ACLChange_ACLContent_Value_UserAdd)(nil), + (*ACLChange_ACLContent_Value_UserRemove)(nil), + (*ACLChange_ACLContent_Value_UserPermissionChange)(nil), + (*ACLChange_ACLContent_Value_UserInvite)(nil), + (*ACLChange_ACLContent_Value_UserJoin)(nil), + (*ACLChange_ACLContent_Value_UserConfirm)(nil), } } -type ACLChangeACLData struct { - AclSnapshot *ACLChangeACLSnapshot `protobuf:"bytes,1,opt,name=aclSnapshot,proto3" json:"aclSnapshot,omitempty"` - AclContent []*ACLChangeACLContentValue `protobuf:"bytes,2,rep,name=aclContent,proto3" json:"aclContent,omitempty"` +type ACLChange_ACLData struct { + AclSnapshot *ACLChange_ACLSnapshot `protobuf:"bytes,1,opt,name=aclSnapshot,proto3" json:"aclSnapshot,omitempty"` + AclContent []*ACLChange_ACLContentValue `protobuf:"bytes,2,rep,name=aclContent,proto3" json:"aclContent,omitempty"` } -func (m *ACLChangeACLData) Reset() { *m = ACLChangeACLData{} } -func (m *ACLChangeACLData) String() string { return proto.CompactTextString(m) } -func (*ACLChangeACLData) ProtoMessage() {} -func (*ACLChangeACLData) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 1} +func (m *ACLChange_ACLData) Reset() { *m = ACLChange_ACLData{} } +func (m *ACLChange_ACLData) String() string { return proto.CompactTextString(m) } +func (*ACLChange_ACLData) ProtoMessage() {} +func (*ACLChange_ACLData) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 1} } -func (m *ACLChangeACLData) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_ACLData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeACLData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_ACLData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeACLData.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_ACLData.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -463,49 +379,49 @@ func (m *ACLChangeACLData) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *ACLChangeACLData) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeACLData.Merge(m, src) +func (m *ACLChange_ACLData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_ACLData.Merge(m, src) } -func (m *ACLChangeACLData) XXX_Size() int { +func (m *ACLChange_ACLData) XXX_Size() int { return m.Size() } -func (m *ACLChangeACLData) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeACLData.DiscardUnknown(m) +func (m *ACLChange_ACLData) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_ACLData.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeACLData proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_ACLData proto.InternalMessageInfo -func (m *ACLChangeACLData) GetAclSnapshot() *ACLChangeACLSnapshot { +func (m *ACLChange_ACLData) GetAclSnapshot() *ACLChange_ACLSnapshot { if m != nil { return m.AclSnapshot } return nil } -func (m *ACLChangeACLData) GetAclContent() []*ACLChangeACLContentValue { +func (m *ACLChange_ACLData) GetAclContent() []*ACLChange_ACLContentValue { if m != nil { return m.AclContent } return nil } -type ACLChangeACLSnapshot struct { +type ACLChange_ACLSnapshot struct { // We don't need ACLState as a separate message now, because we simplified the snapshot model - AclState *ACLChangeACLState `protobuf:"bytes,1,opt,name=aclState,proto3" json:"aclState,omitempty"` + AclState *ACLChange_ACLState `protobuf:"bytes,1,opt,name=aclState,proto3" json:"aclState,omitempty"` } -func (m *ACLChangeACLSnapshot) Reset() { *m = ACLChangeACLSnapshot{} } -func (m *ACLChangeACLSnapshot) String() string { return proto.CompactTextString(m) } -func (*ACLChangeACLSnapshot) ProtoMessage() {} -func (*ACLChangeACLSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 2} +func (m *ACLChange_ACLSnapshot) Reset() { *m = ACLChange_ACLSnapshot{} } +func (m *ACLChange_ACLSnapshot) String() string { return proto.CompactTextString(m) } +func (*ACLChange_ACLSnapshot) ProtoMessage() {} +func (*ACLChange_ACLSnapshot) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 2} } -func (m *ACLChangeACLSnapshot) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_ACLSnapshot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeACLSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_ACLSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeACLSnapshot.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_ACLSnapshot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -515,43 +431,43 @@ func (m *ACLChangeACLSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *ACLChangeACLSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeACLSnapshot.Merge(m, src) +func (m *ACLChange_ACLSnapshot) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_ACLSnapshot.Merge(m, src) } -func (m *ACLChangeACLSnapshot) XXX_Size() int { +func (m *ACLChange_ACLSnapshot) XXX_Size() int { return m.Size() } -func (m *ACLChangeACLSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeACLSnapshot.DiscardUnknown(m) +func (m *ACLChange_ACLSnapshot) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_ACLSnapshot.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeACLSnapshot proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_ACLSnapshot proto.InternalMessageInfo -func (m *ACLChangeACLSnapshot) GetAclState() *ACLChangeACLState { +func (m *ACLChange_ACLSnapshot) GetAclState() *ACLChange_ACLState { if m != nil { return m.AclState } return nil } -type ACLChangeACLState struct { - ReadKeyHashes []uint64 `protobuf:"varint,1,rep,packed,name=readKeyHashes,proto3" json:"readKeyHashes,omitempty"` - UserStates []*ACLChangeUserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` - Invites map[string]*ACLChangeUserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +type ACLChange_ACLState struct { + ReadKeyHashes []uint64 `protobuf:"varint,1,rep,packed,name=readKeyHashes,proto3" json:"readKeyHashes,omitempty"` + UserStates []*ACLChange_UserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` + Invites map[string]*ACLChange_UserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ACLChangeACLState) Reset() { *m = ACLChangeACLState{} } -func (m *ACLChangeACLState) String() string { return proto.CompactTextString(m) } -func (*ACLChangeACLState) ProtoMessage() {} -func (*ACLChangeACLState) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 3} +func (m *ACLChange_ACLState) Reset() { *m = ACLChange_ACLState{} } +func (m *ACLChange_ACLState) String() string { return proto.CompactTextString(m) } +func (*ACLChange_ACLState) ProtoMessage() {} +func (*ACLChange_ACLState) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 3} } -func (m *ACLChangeACLState) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_ACLState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeACLState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_ACLState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeACLState.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_ACLState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -561,59 +477,59 @@ func (m *ACLChangeACLState) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ACLChangeACLState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeACLState.Merge(m, src) +func (m *ACLChange_ACLState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_ACLState.Merge(m, src) } -func (m *ACLChangeACLState) XXX_Size() int { +func (m *ACLChange_ACLState) XXX_Size() int { return m.Size() } -func (m *ACLChangeACLState) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeACLState.DiscardUnknown(m) +func (m *ACLChange_ACLState) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_ACLState.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeACLState proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_ACLState proto.InternalMessageInfo -func (m *ACLChangeACLState) GetReadKeyHashes() []uint64 { +func (m *ACLChange_ACLState) GetReadKeyHashes() []uint64 { if m != nil { return m.ReadKeyHashes } return nil } -func (m *ACLChangeACLState) GetUserStates() []*ACLChangeUserState { +func (m *ACLChange_ACLState) GetUserStates() []*ACLChange_UserState { if m != nil { return m.UserStates } return nil } -func (m *ACLChangeACLState) GetInvites() map[string]*ACLChangeUserInvite { +func (m *ACLChange_ACLState) GetInvites() map[string]*ACLChange_UserInvite { if m != nil { return m.Invites } return nil } -type ACLChangeUserState struct { - Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions ACLChangeUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChangeUserPermissions" json:"permissions,omitempty"` - IsConfirmed bool `protobuf:"varint,5,opt,name=IsConfirmed,proto3" json:"IsConfirmed,omitempty"` +type ACLChange_UserState struct { + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` + EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` + Permissions ACLChange_UserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChange_UserPermissions" json:"permissions,omitempty"` + IsConfirmed bool `protobuf:"varint,5,opt,name=IsConfirmed,proto3" json:"IsConfirmed,omitempty"` } -func (m *ACLChangeUserState) Reset() { *m = ACLChangeUserState{} } -func (m *ACLChangeUserState) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserState) ProtoMessage() {} -func (*ACLChangeUserState) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 4} +func (m *ACLChange_UserState) Reset() { *m = ACLChange_UserState{} } +func (m *ACLChange_UserState) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserState) ProtoMessage() {} +func (*ACLChange_UserState) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 4} } -func (m *ACLChangeUserState) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserState.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -623,47 +539,47 @@ func (m *ACLChangeUserState) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *ACLChangeUserState) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserState.Merge(m, src) +func (m *ACLChange_UserState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserState.Merge(m, src) } -func (m *ACLChangeUserState) XXX_Size() int { +func (m *ACLChange_UserState) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserState) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserState.DiscardUnknown(m) +func (m *ACLChange_UserState) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserState.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserState proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserState proto.InternalMessageInfo -func (m *ACLChangeUserState) GetIdentity() string { +func (m *ACLChange_UserState) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserState) GetEncryptionKey() []byte { +func (m *ACLChange_UserState) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLChangeUserState) GetEncryptedReadKeys() [][]byte { +func (m *ACLChange_UserState) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -func (m *ACLChangeUserState) GetPermissions() ACLChangeUserPermissions { +func (m *ACLChange_UserState) GetPermissions() ACLChange_UserPermissions { if m != nil { return m.Permissions } return ACLChange_Admin } -func (m *ACLChangeUserState) GetIsConfirmed() bool { +func (m *ACLChange_UserState) GetIsConfirmed() bool { if m != nil { return m.IsConfirmed } @@ -671,25 +587,25 @@ func (m *ACLChangeUserState) GetIsConfirmed() bool { } // we already know identity and encryptionKey -type ACLChangeUserAdd struct { - Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions ACLChangeUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChangeUserPermissions" json:"permissions,omitempty"` +type ACLChange_UserAdd struct { + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` + EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` + Permissions ACLChange_UserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChange_UserPermissions" json:"permissions,omitempty"` } -func (m *ACLChangeUserAdd) Reset() { *m = ACLChangeUserAdd{} } -func (m *ACLChangeUserAdd) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserAdd) ProtoMessage() {} -func (*ACLChangeUserAdd) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 5} +func (m *ACLChange_UserAdd) Reset() { *m = ACLChange_UserAdd{} } +func (m *ACLChange_UserAdd) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserAdd) ProtoMessage() {} +func (*ACLChange_UserAdd) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 5} } -func (m *ACLChangeUserAdd) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserAdd) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserAdd.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserAdd.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -699,40 +615,40 @@ func (m *ACLChangeUserAdd) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *ACLChangeUserAdd) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserAdd.Merge(m, src) +func (m *ACLChange_UserAdd) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserAdd.Merge(m, src) } -func (m *ACLChangeUserAdd) XXX_Size() int { +func (m *ACLChange_UserAdd) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserAdd) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserAdd.DiscardUnknown(m) +func (m *ACLChange_UserAdd) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserAdd.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserAdd proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserAdd proto.InternalMessageInfo -func (m *ACLChangeUserAdd) GetIdentity() string { +func (m *ACLChange_UserAdd) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserAdd) GetEncryptionKey() []byte { +func (m *ACLChange_UserAdd) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLChangeUserAdd) GetEncryptedReadKeys() [][]byte { +func (m *ACLChange_UserAdd) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -func (m *ACLChangeUserAdd) GetPermissions() ACLChangeUserPermissions { +func (m *ACLChange_UserAdd) GetPermissions() ACLChange_UserPermissions { if m != nil { return m.Permissions } @@ -740,23 +656,23 @@ func (m *ACLChangeUserAdd) GetPermissions() ACLChangeUserPermissions { } // TODO: this is not used as of now -type ACLChangeUserConfirm struct { +type ACLChange_UserConfirm struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` UserAddId string `protobuf:"bytes,2,opt,name=userAddId,proto3" json:"userAddId,omitempty"` } -func (m *ACLChangeUserConfirm) Reset() { *m = ACLChangeUserConfirm{} } -func (m *ACLChangeUserConfirm) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserConfirm) ProtoMessage() {} -func (*ACLChangeUserConfirm) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 6} +func (m *ACLChange_UserConfirm) Reset() { *m = ACLChange_UserConfirm{} } +func (m *ACLChange_UserConfirm) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserConfirm) ProtoMessage() {} +func (*ACLChange_UserConfirm) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 6} } -func (m *ACLChangeUserConfirm) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserConfirm) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserConfirm.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserConfirm.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -766,52 +682,52 @@ func (m *ACLChangeUserConfirm) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *ACLChangeUserConfirm) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserConfirm.Merge(m, src) +func (m *ACLChange_UserConfirm) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserConfirm.Merge(m, src) } -func (m *ACLChangeUserConfirm) XXX_Size() int { +func (m *ACLChange_UserConfirm) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserConfirm) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserConfirm.DiscardUnknown(m) +func (m *ACLChange_UserConfirm) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserConfirm.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserConfirm proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserConfirm proto.InternalMessageInfo -func (m *ACLChangeUserConfirm) GetIdentity() string { +func (m *ACLChange_UserConfirm) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserConfirm) GetUserAddId() string { +func (m *ACLChange_UserConfirm) GetUserAddId() string { if m != nil { return m.UserAddId } return "" } -type ACLChangeUserInvite struct { - AcceptPublicKey []byte `protobuf:"bytes,1,opt,name=acceptPublicKey,proto3" json:"acceptPublicKey,omitempty"` - EncryptPublicKey []byte `protobuf:"bytes,2,opt,name=encryptPublicKey,proto3" json:"encryptPublicKey,omitempty"` - EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions ACLChangeUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChangeUserPermissions" json:"permissions,omitempty"` - InviteId string `protobuf:"bytes,5,opt,name=InviteId,proto3" json:"InviteId,omitempty"` +type ACLChange_UserInvite struct { + AcceptPublicKey []byte `protobuf:"bytes,1,opt,name=acceptPublicKey,proto3" json:"acceptPublicKey,omitempty"` + EncryptPublicKey []byte `protobuf:"bytes,2,opt,name=encryptPublicKey,proto3" json:"encryptPublicKey,omitempty"` + EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` + Permissions ACLChange_UserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=acl.ACLChange_UserPermissions" json:"permissions,omitempty"` + InviteId string `protobuf:"bytes,5,opt,name=InviteId,proto3" json:"InviteId,omitempty"` } -func (m *ACLChangeUserInvite) Reset() { *m = ACLChangeUserInvite{} } -func (m *ACLChangeUserInvite) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserInvite) ProtoMessage() {} -func (*ACLChangeUserInvite) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 7} +func (m *ACLChange_UserInvite) Reset() { *m = ACLChange_UserInvite{} } +func (m *ACLChange_UserInvite) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserInvite) ProtoMessage() {} +func (*ACLChange_UserInvite) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 7} } -func (m *ACLChangeUserInvite) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserInvite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserInvite.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserInvite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -821,54 +737,54 @@ func (m *ACLChangeUserInvite) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *ACLChangeUserInvite) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserInvite.Merge(m, src) +func (m *ACLChange_UserInvite) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserInvite.Merge(m, src) } -func (m *ACLChangeUserInvite) XXX_Size() int { +func (m *ACLChange_UserInvite) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserInvite) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserInvite.DiscardUnknown(m) +func (m *ACLChange_UserInvite) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserInvite.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserInvite proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserInvite proto.InternalMessageInfo -func (m *ACLChangeUserInvite) GetAcceptPublicKey() []byte { +func (m *ACLChange_UserInvite) GetAcceptPublicKey() []byte { if m != nil { return m.AcceptPublicKey } return nil } -func (m *ACLChangeUserInvite) GetEncryptPublicKey() []byte { +func (m *ACLChange_UserInvite) GetEncryptPublicKey() []byte { if m != nil { return m.EncryptPublicKey } return nil } -func (m *ACLChangeUserInvite) GetEncryptedReadKeys() [][]byte { +func (m *ACLChange_UserInvite) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -func (m *ACLChangeUserInvite) GetPermissions() ACLChangeUserPermissions { +func (m *ACLChange_UserInvite) GetPermissions() ACLChange_UserPermissions { if m != nil { return m.Permissions } return ACLChange_Admin } -func (m *ACLChangeUserInvite) GetInviteId() string { +func (m *ACLChange_UserInvite) GetInviteId() string { if m != nil { return m.InviteId } return "" } -type ACLChangeUserJoin struct { +type ACLChange_UserJoin struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` AcceptSignature []byte `protobuf:"bytes,3,opt,name=acceptSignature,proto3" json:"acceptSignature,omitempty"` @@ -876,18 +792,18 @@ type ACLChangeUserJoin struct { EncryptedReadKeys [][]byte `protobuf:"bytes,5,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` } -func (m *ACLChangeUserJoin) Reset() { *m = ACLChangeUserJoin{} } -func (m *ACLChangeUserJoin) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserJoin) ProtoMessage() {} -func (*ACLChangeUserJoin) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 8} +func (m *ACLChange_UserJoin) Reset() { *m = ACLChange_UserJoin{} } +func (m *ACLChange_UserJoin) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserJoin) ProtoMessage() {} +func (*ACLChange_UserJoin) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 8} } -func (m *ACLChangeUserJoin) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserJoin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserJoin.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserJoin.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -897,70 +813,70 @@ func (m *ACLChangeUserJoin) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *ACLChangeUserJoin) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserJoin.Merge(m, src) +func (m *ACLChange_UserJoin) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserJoin.Merge(m, src) } -func (m *ACLChangeUserJoin) XXX_Size() int { +func (m *ACLChange_UserJoin) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserJoin) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserJoin.DiscardUnknown(m) +func (m *ACLChange_UserJoin) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserJoin.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserJoin proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserJoin proto.InternalMessageInfo -func (m *ACLChangeUserJoin) GetIdentity() string { +func (m *ACLChange_UserJoin) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserJoin) GetEncryptionKey() []byte { +func (m *ACLChange_UserJoin) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLChangeUserJoin) GetAcceptSignature() []byte { +func (m *ACLChange_UserJoin) GetAcceptSignature() []byte { if m != nil { return m.AcceptSignature } return nil } -func (m *ACLChangeUserJoin) GetUserInviteId() string { +func (m *ACLChange_UserJoin) GetUserInviteId() string { if m != nil { return m.UserInviteId } return "" } -func (m *ACLChangeUserJoin) GetEncryptedReadKeys() [][]byte { +func (m *ACLChange_UserJoin) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys } return nil } -type ACLChangeUserRemove struct { - Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - ReadKeyReplaces []*ACLChangeReadKeyReplace `protobuf:"bytes,3,rep,name=readKeyReplaces,proto3" json:"readKeyReplaces,omitempty"` +type ACLChange_UserRemove struct { + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + ReadKeyReplaces []*ACLChange_ReadKeyReplace `protobuf:"bytes,3,rep,name=readKeyReplaces,proto3" json:"readKeyReplaces,omitempty"` } -func (m *ACLChangeUserRemove) Reset() { *m = ACLChangeUserRemove{} } -func (m *ACLChangeUserRemove) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserRemove) ProtoMessage() {} -func (*ACLChangeUserRemove) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 9} +func (m *ACLChange_UserRemove) Reset() { *m = ACLChange_UserRemove{} } +func (m *ACLChange_UserRemove) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserRemove) ProtoMessage() {} +func (*ACLChange_UserRemove) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 9} } -func (m *ACLChangeUserRemove) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserRemove) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserRemove.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserRemove.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -970,50 +886,50 @@ func (m *ACLChangeUserRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *ACLChangeUserRemove) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserRemove.Merge(m, src) +func (m *ACLChange_UserRemove) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserRemove.Merge(m, src) } -func (m *ACLChangeUserRemove) XXX_Size() int { +func (m *ACLChange_UserRemove) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserRemove) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserRemove.DiscardUnknown(m) +func (m *ACLChange_UserRemove) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserRemove.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserRemove proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserRemove proto.InternalMessageInfo -func (m *ACLChangeUserRemove) GetIdentity() string { +func (m *ACLChange_UserRemove) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserRemove) GetReadKeyReplaces() []*ACLChangeReadKeyReplace { +func (m *ACLChange_UserRemove) GetReadKeyReplaces() []*ACLChange_ReadKeyReplace { if m != nil { return m.ReadKeyReplaces } return nil } -type ACLChangeReadKeyReplace struct { +type ACLChange_ReadKeyReplace struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` EncryptedReadKey []byte `protobuf:"bytes,3,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` } -func (m *ACLChangeReadKeyReplace) Reset() { *m = ACLChangeReadKeyReplace{} } -func (m *ACLChangeReadKeyReplace) String() string { return proto.CompactTextString(m) } -func (*ACLChangeReadKeyReplace) ProtoMessage() {} -func (*ACLChangeReadKeyReplace) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 10} +func (m *ACLChange_ReadKeyReplace) Reset() { *m = ACLChange_ReadKeyReplace{} } +func (m *ACLChange_ReadKeyReplace) String() string { return proto.CompactTextString(m) } +func (*ACLChange_ReadKeyReplace) ProtoMessage() {} +func (*ACLChange_ReadKeyReplace) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 10} } -func (m *ACLChangeReadKeyReplace) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_ReadKeyReplace) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_ReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeReadKeyReplace.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_ReadKeyReplace.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1023,56 +939,56 @@ func (m *ACLChangeReadKeyReplace) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *ACLChangeReadKeyReplace) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeReadKeyReplace.Merge(m, src) +func (m *ACLChange_ReadKeyReplace) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_ReadKeyReplace.Merge(m, src) } -func (m *ACLChangeReadKeyReplace) XXX_Size() int { +func (m *ACLChange_ReadKeyReplace) XXX_Size() int { return m.Size() } -func (m *ACLChangeReadKeyReplace) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeReadKeyReplace.DiscardUnknown(m) +func (m *ACLChange_ReadKeyReplace) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_ReadKeyReplace.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeReadKeyReplace proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_ReadKeyReplace proto.InternalMessageInfo -func (m *ACLChangeReadKeyReplace) GetIdentity() string { +func (m *ACLChange_ReadKeyReplace) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeReadKeyReplace) GetEncryptionKey() []byte { +func (m *ACLChange_ReadKeyReplace) GetEncryptionKey() []byte { if m != nil { return m.EncryptionKey } return nil } -func (m *ACLChangeReadKeyReplace) GetEncryptedReadKey() []byte { +func (m *ACLChange_ReadKeyReplace) GetEncryptedReadKey() []byte { if m != nil { return m.EncryptedReadKey } return nil } -type ACLChangeUserPermissionChange struct { - Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - Permissions ACLChangeUserPermissions `protobuf:"varint,2,opt,name=permissions,proto3,enum=acl.ACLChangeUserPermissions" json:"permissions,omitempty"` +type ACLChange_UserPermissionChange struct { + Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + Permissions ACLChange_UserPermissions `protobuf:"varint,2,opt,name=permissions,proto3,enum=acl.ACLChange_UserPermissions" json:"permissions,omitempty"` } -func (m *ACLChangeUserPermissionChange) Reset() { *m = ACLChangeUserPermissionChange{} } -func (m *ACLChangeUserPermissionChange) String() string { return proto.CompactTextString(m) } -func (*ACLChangeUserPermissionChange) ProtoMessage() {} -func (*ACLChangeUserPermissionChange) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{2, 11} +func (m *ACLChange_UserPermissionChange) Reset() { *m = ACLChange_UserPermissionChange{} } +func (m *ACLChange_UserPermissionChange) String() string { return proto.CompactTextString(m) } +func (*ACLChange_UserPermissionChange) ProtoMessage() {} +func (*ACLChange_UserPermissionChange) Descriptor() ([]byte, []int) { + return fileDescriptor_37a022c841a51877, []int{1, 11} } -func (m *ACLChangeUserPermissionChange) XXX_Unmarshal(b []byte) error { +func (m *ACLChange_UserPermissionChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *ACLChangeUserPermissionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ACLChange_UserPermissionChange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_ACLChangeUserPermissionChange.Marshal(b, m, deterministic) + return xxx_messageInfo_ACLChange_UserPermissionChange.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1082,298 +998,49 @@ func (m *ACLChangeUserPermissionChange) XXX_Marshal(b []byte, deterministic bool return b[:n], nil } } -func (m *ACLChangeUserPermissionChange) XXX_Merge(src proto.Message) { - xxx_messageInfo_ACLChangeUserPermissionChange.Merge(m, src) +func (m *ACLChange_UserPermissionChange) XXX_Merge(src proto.Message) { + xxx_messageInfo_ACLChange_UserPermissionChange.Merge(m, src) } -func (m *ACLChangeUserPermissionChange) XXX_Size() int { +func (m *ACLChange_UserPermissionChange) XXX_Size() int { return m.Size() } -func (m *ACLChangeUserPermissionChange) XXX_DiscardUnknown() { - xxx_messageInfo_ACLChangeUserPermissionChange.DiscardUnknown(m) +func (m *ACLChange_UserPermissionChange) XXX_DiscardUnknown() { + xxx_messageInfo_ACLChange_UserPermissionChange.DiscardUnknown(m) } -var xxx_messageInfo_ACLChangeUserPermissionChange proto.InternalMessageInfo +var xxx_messageInfo_ACLChange_UserPermissionChange proto.InternalMessageInfo -func (m *ACLChangeUserPermissionChange) GetIdentity() string { +func (m *ACLChange_UserPermissionChange) GetIdentity() string { if m != nil { return m.Identity } return "" } -func (m *ACLChangeUserPermissionChange) GetPermissions() ACLChangeUserPermissions { +func (m *ACLChange_UserPermissionChange) GetPermissions() ACLChange_UserPermissions { if m != nil { return m.Permissions } return ACLChange_Admin } -type Change struct { - TreeHeadIds []string `protobuf:"bytes,1,rep,name=treeHeadIds,proto3" json:"treeHeadIds,omitempty"` - AclHeadId string `protobuf:"bytes,2,opt,name=aclHeadId,proto3" json:"aclHeadId,omitempty"` - SnapshotBaseId string `protobuf:"bytes,3,opt,name=snapshotBaseId,proto3" json:"snapshotBaseId,omitempty"` - ChangesData []byte `protobuf:"bytes,4,opt,name=changesData,proto3" json:"changesData,omitempty"` - CurrentReadKeyHash uint64 `protobuf:"varint,5,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` - Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - Identity string `protobuf:"bytes,7,opt,name=identity,proto3" json:"identity,omitempty"` - IsSnapshot bool `protobuf:"varint,8,opt,name=isSnapshot,proto3" json:"isSnapshot,omitempty"` -} - -func (m *Change) Reset() { *m = Change{} } -func (m *Change) String() string { return proto.CompactTextString(m) } -func (*Change) ProtoMessage() {} -func (*Change) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{3} -} -func (m *Change) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Change) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Change.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Change) XXX_Merge(src proto.Message) { - xxx_messageInfo_Change.Merge(m, src) -} -func (m *Change) XXX_Size() int { - return m.Size() -} -func (m *Change) XXX_DiscardUnknown() { - xxx_messageInfo_Change.DiscardUnknown(m) -} - -var xxx_messageInfo_Change proto.InternalMessageInfo - -func (m *Change) GetTreeHeadIds() []string { - if m != nil { - return m.TreeHeadIds - } - return nil -} - -func (m *Change) GetAclHeadId() string { - if m != nil { - return m.AclHeadId - } - return "" -} - -func (m *Change) GetSnapshotBaseId() string { - if m != nil { - return m.SnapshotBaseId - } - return "" -} - -func (m *Change) GetChangesData() []byte { - if m != nil { - return m.ChangesData - } - return nil -} - -func (m *Change) GetCurrentReadKeyHash() uint64 { - if m != nil { - return m.CurrentReadKeyHash - } - return 0 -} - -func (m *Change) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *Change) GetIdentity() string { - if m != nil { - return m.Identity - } - return "" -} - -func (m *Change) GetIsSnapshot() bool { - if m != nil { - return m.IsSnapshot - } - return false -} - -type Record struct { - PrevId string `protobuf:"bytes,1,opt,name=prevId,proto3" json:"prevId,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - CurrentReadKeyHash uint64 `protobuf:"varint,4,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` - Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (m *Record) Reset() { *m = Record{} } -func (m *Record) String() string { return proto.CompactTextString(m) } -func (*Record) ProtoMessage() {} -func (*Record) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{4} -} -func (m *Record) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Record.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Record) XXX_Merge(src proto.Message) { - xxx_messageInfo_Record.Merge(m, src) -} -func (m *Record) XXX_Size() int { - return m.Size() -} -func (m *Record) XXX_DiscardUnknown() { - xxx_messageInfo_Record.DiscardUnknown(m) -} - -var xxx_messageInfo_Record proto.InternalMessageInfo - -func (m *Record) GetPrevId() string { - if m != nil { - return m.PrevId - } - return "" -} - -func (m *Record) GetIdentity() string { - if m != nil { - return m.Identity - } - return "" -} - -func (m *Record) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *Record) GetCurrentReadKeyHash() uint64 { - if m != nil { - return m.CurrentReadKeyHash - } - return 0 -} - -func (m *Record) GetTimestamp() int64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -type Header struct { - FirstId string `protobuf:"bytes,1,opt,name=firstId,proto3" json:"firstId,omitempty"` - AclListId string `protobuf:"bytes,2,opt,name=aclListId,proto3" json:"aclListId,omitempty"` - WorkspaceId string `protobuf:"bytes,3,opt,name=workspaceId,proto3" json:"workspaceId,omitempty"` - DocType HeaderDocType `protobuf:"varint,4,opt,name=docType,proto3,enum=acl.HeaderDocType" json:"docType,omitempty"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_37a022c841a51877, []int{5} -} -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} -func (m *Header) XXX_Size() int { - return m.Size() -} -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -func (m *Header) GetFirstId() string { - if m != nil { - return m.FirstId - } - return "" -} - -func (m *Header) GetAclListId() string { - if m != nil { - return m.AclListId - } - return "" -} - -func (m *Header) GetWorkspaceId() string { - if m != nil { - return m.WorkspaceId - } - return "" -} - -func (m *Header) GetDocType() HeaderDocType { - if m != nil { - return m.DocType - } - return Header_ACL -} - func init() { - proto.RegisterEnum("acl.ACLChangeUserPermissions", ACLChangeUserPermissions_name, ACLChangeUserPermissions_value) - proto.RegisterEnum("acl.HeaderDocType", HeaderDocType_name, HeaderDocType_value) + proto.RegisterEnum("acl.ACLChange_UserPermissions", ACLChange_UserPermissions_name, ACLChange_UserPermissions_value) proto.RegisterType((*RawChange)(nil), "acl.RawChange") - proto.RegisterType((*RawRecord)(nil), "acl.RawRecord") proto.RegisterType((*ACLChange)(nil), "acl.ACLChange") - proto.RegisterType((*ACLChangeACLContentValue)(nil), "acl.ACLChange.ACLContentValue") - proto.RegisterType((*ACLChangeACLData)(nil), "acl.ACLChange.ACLData") - proto.RegisterType((*ACLChangeACLSnapshot)(nil), "acl.ACLChange.ACLSnapshot") - proto.RegisterType((*ACLChangeACLState)(nil), "acl.ACLChange.ACLState") - proto.RegisterMapType((map[string]*ACLChangeUserInvite)(nil), "acl.ACLChange.ACLState.InvitesEntry") - proto.RegisterType((*ACLChangeUserState)(nil), "acl.ACLChange.UserState") - proto.RegisterType((*ACLChangeUserAdd)(nil), "acl.ACLChange.UserAdd") - proto.RegisterType((*ACLChangeUserConfirm)(nil), "acl.ACLChange.UserConfirm") - proto.RegisterType((*ACLChangeUserInvite)(nil), "acl.ACLChange.UserInvite") - proto.RegisterType((*ACLChangeUserJoin)(nil), "acl.ACLChange.UserJoin") - proto.RegisterType((*ACLChangeUserRemove)(nil), "acl.ACLChange.UserRemove") - proto.RegisterType((*ACLChangeReadKeyReplace)(nil), "acl.ACLChange.ReadKeyReplace") - proto.RegisterType((*ACLChangeUserPermissionChange)(nil), "acl.ACLChange.UserPermissionChange") - proto.RegisterType((*Change)(nil), "acl.Change") - proto.RegisterType((*Record)(nil), "acl.Record") - proto.RegisterType((*Header)(nil), "acl.Header") + proto.RegisterType((*ACLChange_ACLContentValue)(nil), "acl.ACLChange.ACLContentValue") + proto.RegisterType((*ACLChange_ACLData)(nil), "acl.ACLChange.ACLData") + proto.RegisterType((*ACLChange_ACLSnapshot)(nil), "acl.ACLChange.ACLSnapshot") + proto.RegisterType((*ACLChange_ACLState)(nil), "acl.ACLChange.ACLState") + proto.RegisterMapType((map[string]*ACLChange_UserInvite)(nil), "acl.ACLChange.ACLState.InvitesEntry") + proto.RegisterType((*ACLChange_UserState)(nil), "acl.ACLChange.UserState") + proto.RegisterType((*ACLChange_UserAdd)(nil), "acl.ACLChange.UserAdd") + proto.RegisterType((*ACLChange_UserConfirm)(nil), "acl.ACLChange.UserConfirm") + proto.RegisterType((*ACLChange_UserInvite)(nil), "acl.ACLChange.UserInvite") + proto.RegisterType((*ACLChange_UserJoin)(nil), "acl.ACLChange.UserJoin") + proto.RegisterType((*ACLChange_UserRemove)(nil), "acl.ACLChange.UserRemove") + proto.RegisterType((*ACLChange_ReadKeyReplace)(nil), "acl.ACLChange.ReadKeyReplace") + proto.RegisterType((*ACLChange_UserPermissionChange)(nil), "acl.ACLChange.UserPermissionChange") } func init() { @@ -1381,78 +1048,67 @@ func init() { } var fileDescriptor_37a022c841a51877 = []byte{ - // 1131 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xf8, 0xdf, 0x7a, 0xdf, 0x86, 0xc4, 0x4c, 0xab, 0xd6, 0xac, 0x8a, 0x6b, 0x99, 0x0a, - 0x59, 0x08, 0x9c, 0xca, 0x15, 0x52, 0x05, 0x28, 0x22, 0x49, 0x51, 0x6d, 0x92, 0x43, 0x35, 0xa1, - 0x20, 0xb8, 0x4d, 0x76, 0xa7, 0xc9, 0x2a, 0xf6, 0xee, 0xb2, 0x33, 0x49, 0xe5, 0x0b, 0x12, 0x27, - 0xae, 0x9c, 0x11, 0xe2, 0x43, 0x70, 0xe5, 0x0b, 0xf4, 0xd8, 0x23, 0x37, 0x50, 0x72, 0xe7, 0xc2, - 0x17, 0x40, 0xf3, 0x67, 0xd7, 0xeb, 0xf5, 0x26, 0x0a, 0x52, 0x84, 0xc4, 0x21, 0xd2, 0xcc, 0xef, - 0xfd, 0xde, 0xf8, 0xbd, 0xf7, 0x7b, 0xf3, 0x32, 0x0b, 0x0f, 0xe3, 0x93, 0xa3, 0x4d, 0xea, 0x4d, - 0xe5, 0x9f, 0x77, 0x4c, 0xc3, 0x23, 0xc6, 0xe5, 0x32, 0x3e, 0xdc, 0x8c, 0x93, 0x48, 0x44, 0x3c, - 0x87, 0x0f, 0x15, 0x82, 0x6b, 0xd4, 0x9b, 0xf6, 0x0f, 0xc0, 0x26, 0xf4, 0xe5, 0xae, 0x32, 0xe0, - 0x0e, 0x58, 0x31, 0x9d, 0x4f, 0x23, 0xea, 0x77, 0x50, 0x0f, 0x0d, 0xd6, 0x48, 0xba, 0xc5, 0xf7, - 0xc0, 0xe6, 0xc1, 0x51, 0x48, 0xc5, 0x69, 0xc2, 0x3a, 0x55, 0x65, 0x5b, 0x00, 0x78, 0x1d, 0xaa, - 0x81, 0xdf, 0xa9, 0xf5, 0xd0, 0xc0, 0x26, 0xd5, 0xc0, 0x37, 0x87, 0x12, 0xe6, 0x45, 0x89, 0x7f, - 0x63, 0x87, 0xfe, 0x7d, 0x0b, 0xec, 0xed, 0xdd, 0x7d, 0x13, 0x6a, 0x0f, 0x1c, 0x91, 0x30, 0x36, - 0x66, 0xd4, 0x9f, 0xf8, 0xbc, 0x83, 0x7a, 0xb5, 0x81, 0x4d, 0xf2, 0x10, 0xee, 0x02, 0x50, 0x6f, - 0x9a, 0x12, 0xaa, 0x8a, 0x90, 0x43, 0xf0, 0xbb, 0xb0, 0xce, 0x43, 0x1a, 0xf3, 0xe3, 0x48, 0xec, - 0x50, 0xce, 0x26, 0xe9, 0x6f, 0x15, 0x50, 0xfc, 0x10, 0x2c, 0xea, 0x4d, 0x9f, 0x50, 0x41, 0x3b, - 0xf5, 0x1e, 0x1a, 0x38, 0xa3, 0x3b, 0x43, 0xea, 0x4d, 0x87, 0x59, 0x28, 0x72, 0x25, 0xad, 0x24, - 0xa5, 0xc9, 0xd8, 0x4c, 0xa5, 0x95, 0x57, 0x43, 0x65, 0x96, 0x87, 0xf0, 0x10, 0xb0, 0x77, 0x9a, - 0x24, 0x2c, 0x14, 0x84, 0x51, 0x7f, 0x8f, 0xcd, 0xc7, 0x94, 0x1f, 0x77, 0x9a, 0x3d, 0x34, 0xa8, - 0x93, 0x12, 0x8b, 0xac, 0x94, 0x08, 0x66, 0x8c, 0x0b, 0x3a, 0x8b, 0x3b, 0x56, 0x0f, 0x0d, 0x6a, - 0x64, 0x01, 0x60, 0x17, 0x5a, 0x81, 0xcf, 0x42, 0x11, 0x88, 0x79, 0xa7, 0xa5, 0x72, 0xc8, 0xf6, - 0xee, 0x4f, 0x35, 0xd8, 0x90, 0xa1, 0x46, 0xa1, 0x60, 0xa1, 0xf8, 0x92, 0x4e, 0x4f, 0x19, 0x1e, - 0x81, 0x75, 0xca, 0x59, 0xb2, 0xed, 0x6b, 0x45, 0x56, 0x33, 0x7a, 0xae, 0xad, 0xe3, 0x0a, 0x49, - 0x89, 0xf8, 0x63, 0x00, 0xb9, 0x24, 0x6c, 0x16, 0x9d, 0x69, 0xb1, 0x9c, 0xd1, 0x5b, 0x25, 0x6e, - 0x9a, 0x30, 0xae, 0x90, 0x1c, 0x1d, 0x7f, 0x0d, 0xb7, 0xe5, 0xee, 0x19, 0x4b, 0x66, 0x01, 0xe7, - 0x41, 0x14, 0x6a, 0x07, 0x55, 0x70, 0x67, 0xf4, 0x4e, 0xc9, 0x31, 0x45, 0xea, 0xb8, 0x42, 0x4a, - 0x8f, 0x48, 0xe3, 0x9a, 0x84, 0x67, 0x81, 0x60, 0x46, 0xa0, 0xb2, 0xb8, 0x34, 0x21, 0x8d, 0x4b, - 0xef, 0xf0, 0x87, 0xd0, 0x92, 0xbb, 0xcf, 0xa3, 0x20, 0x54, 0x2a, 0x39, 0xa3, 0xbb, 0x25, 0xae, - 0xd2, 0x3c, 0xae, 0x90, 0x8c, 0x8a, 0xb7, 0xc0, 0x91, 0xeb, 0xdd, 0x28, 0x7c, 0x11, 0x24, 0x33, - 0x25, 0x9b, 0x33, 0x72, 0x4b, 0x3c, 0x0d, 0x63, 0x5c, 0x21, 0x79, 0x87, 0x1d, 0x0b, 0x1a, 0x67, - 0x52, 0x08, 0xf7, 0x07, 0x04, 0x96, 0xe9, 0x1e, 0xfc, 0x09, 0x38, 0xd4, 0x9b, 0x1e, 0x98, 0xde, - 0x33, 0xc2, 0xb8, 0xab, 0xad, 0x96, 0x32, 0x48, 0x9e, 0x8e, 0xb7, 0x54, 0xb3, 0x1b, 0x95, 0x55, - 0xb3, 0x3b, 0xa3, 0xee, 0xaa, 0x73, 0xbe, 0x0d, 0x48, 0xce, 0xc3, 0xdd, 0x01, 0x27, 0x77, 0x36, - 0x7e, 0x04, 0x2d, 0x79, 0xba, 0xa0, 0x82, 0x99, 0x48, 0xee, 0x96, 0x44, 0x22, 0xcd, 0x24, 0x23, - 0xba, 0xdf, 0x57, 0xa1, 0x95, 0xc2, 0xf8, 0x01, 0xbc, 0x91, 0x2c, 0x1a, 0x98, 0xe9, 0x1b, 0x5a, - 0x27, 0xcb, 0x20, 0x7e, 0xac, 0xd5, 0x53, 0x2e, 0xdc, 0x84, 0xdd, 0x29, 0x29, 0xa4, 0xfe, 0xa9, - 0x1c, 0x17, 0x6f, 0x81, 0x15, 0x28, 0x11, 0x79, 0xa7, 0xa6, 0xdc, 0x1e, 0x5c, 0x12, 0xe0, 0x50, - 0x6b, 0xcd, 0x3f, 0x0b, 0x45, 0x32, 0x27, 0xa9, 0x93, 0xfb, 0x1c, 0xd6, 0xf2, 0x06, 0xdc, 0x86, - 0xda, 0x09, 0x9b, 0xab, 0x64, 0x6d, 0x22, 0x97, 0x78, 0xd3, 0xa8, 0x74, 0x45, 0xb3, 0xeb, 0x13, - 0x88, 0xe6, 0x7d, 0x54, 0x7d, 0x8c, 0xdc, 0x3f, 0x10, 0xd8, 0x59, 0xc0, 0x4b, 0x17, 0x13, 0x2d, - 0x5f, 0x4c, 0x59, 0x20, 0x16, 0x7a, 0xc9, 0x3c, 0x16, 0x41, 0x14, 0xee, 0xb1, 0xb9, 0x19, 0x80, - 0xcb, 0x20, 0x7e, 0x1f, 0xde, 0x34, 0x00, 0xf3, 0xcd, 0x40, 0xd0, 0x09, 0xaf, 0x91, 0x55, 0x03, - 0xfe, 0x14, 0x9c, 0x38, 0xbb, 0x20, 0x5c, 0xdd, 0x86, 0xf5, 0x95, 0x36, 0x58, 0xbe, 0x5e, 0x9c, - 0xe4, 0x5d, 0xe4, 0xe8, 0x9a, 0x70, 0xd3, 0xa7, 0xcc, 0x57, 0x97, 0xa2, 0x45, 0xf2, 0x90, 0xfb, - 0x1b, 0x02, 0xcb, 0xcc, 0x87, 0xff, 0x5f, 0x7e, 0xee, 0x53, 0x70, 0x72, 0x17, 0xf3, 0xca, 0x04, - 0xee, 0x81, 0x6d, 0x86, 0xdf, 0xc4, 0x57, 0xc1, 0xdb, 0x64, 0x01, 0xb8, 0x7f, 0x21, 0x80, 0x45, - 0x0b, 0xe0, 0x01, 0x6c, 0x50, 0xcf, 0x63, 0xb1, 0x78, 0x76, 0x7a, 0x38, 0x0d, 0xbc, 0x3d, 0xd3, - 0x4a, 0x6b, 0xa4, 0x08, 0xe3, 0xf7, 0xa0, 0x6d, 0x12, 0x5b, 0x50, 0x75, 0x69, 0x56, 0xf0, 0xff, - 0x5c, 0x7d, 0x17, 0x5a, 0x3a, 0x9f, 0x89, 0x96, 0xde, 0x26, 0xd9, 0xde, 0x7d, 0x85, 0xa0, 0x95, - 0x4e, 0xc3, 0x1b, 0x10, 0x3e, 0x2b, 0xd8, 0x41, 0xf6, 0x02, 0xa8, 0xe5, 0x0b, 0x96, 0xc1, 0xb8, - 0x0f, 0x6b, 0x8b, 0x91, 0x3d, 0xf1, 0x55, 0x5e, 0x36, 0x59, 0xc2, 0xca, 0x0b, 0xd5, 0xb8, 0xa4, - 0x50, 0xee, 0xb7, 0x5a, 0x3a, 0xf3, 0xcf, 0xe9, 0xaa, 0x5c, 0x9e, 0xc2, 0x86, 0x19, 0x58, 0x84, - 0xc5, 0x53, 0xea, 0x65, 0xd3, 0xe6, 0xed, 0x42, 0x59, 0xc9, 0x12, 0x8b, 0x14, 0xbd, 0xdc, 0xef, - 0x60, 0x7d, 0x99, 0x72, 0x03, 0x25, 0x5c, 0x74, 0x52, 0x96, 0x9b, 0xa9, 0xe1, 0x0a, 0xee, 0x0a, - 0xb8, 0x5d, 0xf6, 0x6f, 0xf5, 0xca, 0x28, 0x0a, 0xfd, 0x54, 0xfd, 0xd7, 0xfd, 0xd4, 0xdf, 0x86, - 0x8d, 0x82, 0x1d, 0xdb, 0xd0, 0xd8, 0xf6, 0x67, 0x41, 0xd8, 0xae, 0x60, 0x80, 0xe6, 0x57, 0x49, - 0x20, 0x58, 0xd2, 0x46, 0x72, 0x2d, 0x43, 0x65, 0x49, 0xbb, 0x8a, 0x1d, 0xb0, 0xb4, 0x34, 0x7e, - 0xbb, 0xd6, 0xff, 0xb9, 0x0a, 0xcd, 0x6b, 0x3f, 0xf9, 0xee, 0x81, 0x9d, 0x3d, 0xf0, 0xd2, 0x2b, - 0x9b, 0x01, 0xd7, 0x7e, 0xf0, 0x15, 0x9e, 0x6f, 0xf5, 0xeb, 0x3e, 0xdf, 0x1a, 0xd7, 0x7b, 0xbe, - 0x35, 0xaf, 0x7a, 0xbe, 0x59, 0x05, 0x0d, 0xba, 0x00, 0x01, 0xcf, 0x1e, 0x05, 0x2d, 0x35, 0x8e, - 0x73, 0x48, 0xff, 0x17, 0x24, 0x0b, 0xa7, 0xde, 0xd9, 0x77, 0xa0, 0x19, 0x27, 0xec, 0x6c, 0xe2, - 0x1b, 0x21, 0xcd, 0x6e, 0xe9, 0xf8, 0x6a, 0xe1, 0x78, 0x0c, 0x75, 0x5f, 0xe6, 0xa8, 0xdb, 0x46, - 0xad, 0x2f, 0x49, 0xae, 0x7e, 0xbd, 0xe4, 0x1a, 0x85, 0xe4, 0xfa, 0xbf, 0x22, 0x68, 0x8e, 0x95, - 0xb2, 0xf2, 0x43, 0xe0, 0x45, 0x90, 0x70, 0x91, 0x45, 0x98, 0x6e, 0x8d, 0x6e, 0xfb, 0x81, 0xb2, - 0x2d, 0x74, 0xd3, 0x80, 0xd4, 0xe3, 0x65, 0x94, 0x9c, 0xf0, 0x98, 0x7a, 0x0b, 0xd1, 0xf2, 0x10, - 0xfe, 0x00, 0x2c, 0x3f, 0xf2, 0xbe, 0x98, 0xc7, 0xcc, 0x4c, 0xbd, 0x5b, 0xaa, 0x4b, 0xf5, 0xef, - 0x0e, 0x9f, 0x68, 0x13, 0x49, 0x39, 0xfd, 0xfb, 0x60, 0x19, 0x0c, 0x5b, 0x50, 0xdb, 0xde, 0xdd, - 0x6f, 0x57, 0x64, 0xd3, 0x49, 0x2c, 0x61, 0xac, 0x8d, 0x76, 0xee, 0xbf, 0x3a, 0xef, 0xa2, 0xd7, - 0xe7, 0x5d, 0xf4, 0xe7, 0x79, 0x17, 0xfd, 0x78, 0xd1, 0xad, 0xbc, 0xbe, 0xe8, 0x56, 0x7e, 0xbf, - 0xe8, 0x56, 0xbe, 0x69, 0xa8, 0x4f, 0xaa, 0xc3, 0xa6, 0xfa, 0x82, 0x7a, 0xf4, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x14, 0x6d, 0xee, 0xf8, 0x75, 0x0d, 0x00, 0x00, + // 948 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0xe3, 0x44, + 0x14, 0xf7, 0xc4, 0x4d, 0x1d, 0x3f, 0x87, 0x36, 0x0c, 0x2b, 0xd6, 0x58, 0x4b, 0x88, 0xca, 0x0a, + 0x45, 0x08, 0xa5, 0xab, 0xac, 0x90, 0x56, 0x80, 0x2a, 0xda, 0x82, 0x36, 0xa1, 0x1c, 0x56, 0x53, + 0x2d, 0x08, 0x6e, 0x53, 0x7b, 0x68, 0xad, 0x75, 0x6c, 0xe3, 0x99, 0x14, 0xe5, 0x82, 0xc4, 0x89, + 0x2b, 0x67, 0xbe, 0x0a, 0x5f, 0x60, 0x8f, 0x7b, 0xe4, 0x06, 0x6a, 0xef, 0x5c, 0xf8, 0x02, 0x68, + 0xfe, 0xd8, 0x71, 0x12, 0x6f, 0x24, 0xa4, 0x15, 0x12, 0x87, 0x4a, 0x33, 0xbf, 0xf7, 0x7b, 0xd3, + 0xf7, 0xde, 0xef, 0xbd, 0x17, 0xc3, 0x83, 0xfc, 0xd9, 0xe5, 0x21, 0x0d, 0x13, 0xf9, 0x17, 0x5e, + 0xd1, 0xf4, 0x92, 0x71, 0x79, 0xcc, 0x2f, 0x0e, 0xf3, 0x22, 0x13, 0x19, 0xaf, 0xe1, 0x23, 0x85, + 0x60, 0x9b, 0x86, 0xc9, 0xc1, 0x39, 0xb8, 0x84, 0xfe, 0x70, 0xaa, 0x0c, 0xd8, 0x07, 0x27, 0xa7, + 0x8b, 0x24, 0xa3, 0x91, 0x8f, 0x06, 0x68, 0xd8, 0x25, 0xe5, 0x15, 0xdf, 0x03, 0x97, 0xc7, 0x97, + 0x29, 0x15, 0xf3, 0x82, 0xf9, 0x2d, 0x65, 0x5b, 0x02, 0x78, 0x0f, 0x5a, 0x71, 0xe4, 0xdb, 0x03, + 0x34, 0x74, 0x49, 0x2b, 0x8e, 0x0e, 0xfe, 0x7e, 0x03, 0xdc, 0xe3, 0xd3, 0x2f, 0xcd, 0xab, 0x03, + 0xf0, 0x44, 0xc1, 0xd8, 0x84, 0xd1, 0x68, 0x1a, 0x71, 0x1f, 0x0d, 0xec, 0xa1, 0x4b, 0xea, 0x10, + 0xee, 0x03, 0xd0, 0x30, 0x29, 0x09, 0x2d, 0x45, 0xa8, 0x21, 0xf8, 0x3d, 0xd8, 0xe3, 0x29, 0xcd, + 0xf9, 0x55, 0x26, 0x4e, 0x28, 0x67, 0xd3, 0xf2, 0x7f, 0xad, 0xa1, 0xf8, 0x01, 0x38, 0x34, 0x4c, + 0x3e, 0xa3, 0x82, 0xfa, 0x3b, 0x03, 0x34, 0xf4, 0xc6, 0x6f, 0x8e, 0x68, 0x98, 0x8c, 0xaa, 0x50, + 0xe4, 0x49, 0x5a, 0x49, 0x49, 0x93, 0xb1, 0x99, 0xa2, 0x28, 0xaf, 0xb6, 0xca, 0xac, 0x0e, 0xe1, + 0x11, 0xe0, 0x70, 0x5e, 0x14, 0x2c, 0x15, 0x84, 0xd1, 0xe8, 0x8c, 0x2d, 0x26, 0x94, 0x5f, 0xf9, + 0xbb, 0x03, 0x34, 0xdc, 0x21, 0x0d, 0x16, 0x59, 0x29, 0x11, 0xcf, 0x18, 0x17, 0x74, 0x96, 0xfb, + 0xce, 0x00, 0x0d, 0x6d, 0xb2, 0x04, 0x70, 0x00, 0x9d, 0x38, 0x62, 0xa9, 0x88, 0xc5, 0xc2, 0xef, + 0xa8, 0x1c, 0xaa, 0x7b, 0xf0, 0xab, 0x0d, 0xfb, 0x32, 0xd4, 0x2c, 0x15, 0x2c, 0x15, 0x5f, 0xd1, + 0x64, 0xce, 0xf0, 0x18, 0x9c, 0x39, 0x67, 0xc5, 0x71, 0xa4, 0x15, 0xd9, 0xcc, 0xe8, 0xa9, 0xb6, + 0x4e, 0x2c, 0x52, 0x12, 0xf1, 0xc7, 0x00, 0xf2, 0x48, 0xd8, 0x2c, 0xbb, 0xd6, 0x62, 0x79, 0xe3, + 0xb7, 0x1a, 0xdc, 0x34, 0x61, 0x62, 0x91, 0x1a, 0x1d, 0x7f, 0x03, 0x77, 0xe4, 0xed, 0x09, 0x2b, + 0x66, 0x31, 0xe7, 0x71, 0x96, 0x6a, 0x07, 0x55, 0x70, 0x6f, 0xfc, 0x6e, 0xc3, 0x33, 0xeb, 0xd4, + 0x89, 0x45, 0x1a, 0x9f, 0x28, 0xe3, 0x9a, 0xa6, 0xd7, 0xb1, 0x60, 0x46, 0xa0, 0xa6, 0xb8, 0x34, + 0xa1, 0x8c, 0x4b, 0xdf, 0xf0, 0x87, 0xd0, 0x91, 0xb7, 0x2f, 0xb2, 0x38, 0x55, 0x2a, 0x79, 0xe3, + 0xbb, 0x0d, 0xae, 0xd2, 0x3c, 0xb1, 0x48, 0x45, 0xc5, 0x47, 0xe0, 0xc9, 0xf3, 0x69, 0x96, 0x7e, + 0x17, 0x17, 0x33, 0x25, 0x9b, 0x37, 0x0e, 0x1a, 0x3c, 0x0d, 0x63, 0x62, 0x91, 0xba, 0xc3, 0x89, + 0x03, 0xed, 0x6b, 0x29, 0x44, 0xf0, 0x33, 0x02, 0xc7, 0x74, 0x0f, 0xfe, 0x04, 0x3c, 0x1a, 0x26, + 0xe7, 0xa6, 0xf7, 0x8c, 0x30, 0xc1, 0x66, 0xab, 0x95, 0x0c, 0x52, 0xa7, 0xe3, 0x23, 0xd5, 0xec, + 0x46, 0x65, 0xd5, 0xec, 0xde, 0xb8, 0xbf, 0xe9, 0x5c, 0x6f, 0x03, 0x52, 0xf3, 0x08, 0x4e, 0xc0, + 0xab, 0xbd, 0x8d, 0x1f, 0x42, 0x47, 0xbe, 0x2e, 0xa8, 0x60, 0x26, 0x92, 0xbb, 0x0d, 0x91, 0x48, + 0x33, 0xa9, 0x88, 0xc1, 0x4f, 0x2d, 0xe8, 0x94, 0x30, 0xbe, 0x0f, 0xaf, 0x15, 0xcb, 0x06, 0x66, + 0x7a, 0x42, 0x77, 0xc8, 0x2a, 0x88, 0x1f, 0x69, 0xf5, 0x94, 0x0b, 0x37, 0x61, 0xfb, 0x0d, 0x85, + 0xd4, 0xff, 0xaa, 0xc6, 0xc5, 0x47, 0xe0, 0xc4, 0x4a, 0x44, 0xee, 0xdb, 0xca, 0xed, 0xfe, 0x4b, + 0x02, 0x1c, 0x69, 0xad, 0xf9, 0xe7, 0xa9, 0x28, 0x16, 0xa4, 0x74, 0x0a, 0x9e, 0x42, 0xb7, 0x6e, + 0xc0, 0x3d, 0xb0, 0x9f, 0xb1, 0x85, 0x4a, 0xd6, 0x25, 0xf2, 0x88, 0x0f, 0x8d, 0x4a, 0x5b, 0x9a, + 0x5d, 0xbf, 0x40, 0x34, 0xef, 0xa3, 0xd6, 0x23, 0x14, 0xfc, 0x81, 0xc0, 0xad, 0x02, 0x5e, 0x19, + 0x4c, 0xb4, 0x3a, 0x98, 0xb2, 0x40, 0x2c, 0x0d, 0x8b, 0x45, 0x2e, 0xe2, 0x2c, 0x3d, 0x63, 0x0b, + 0xb3, 0x00, 0x57, 0x41, 0xfc, 0x01, 0xbc, 0x6e, 0x00, 0x16, 0x99, 0x85, 0xa0, 0x13, 0xee, 0x92, + 0x4d, 0x03, 0xfe, 0x14, 0xbc, 0xbc, 0x1a, 0x10, 0xae, 0xa6, 0x61, 0x6f, 0xa3, 0x0d, 0x56, 0xc7, + 0x8b, 0x93, 0xba, 0x8b, 0x5c, 0x5d, 0x53, 0x6e, 0xfa, 0x94, 0x45, 0x6a, 0x28, 0x3a, 0xa4, 0x0e, + 0x05, 0xbf, 0x21, 0x70, 0xcc, 0x7e, 0xf8, 0xff, 0xe5, 0x17, 0x3c, 0x06, 0xaf, 0x36, 0x98, 0x5b, + 0x13, 0xb8, 0x07, 0xae, 0x59, 0x7e, 0xd3, 0x48, 0x05, 0xef, 0x92, 0x25, 0x10, 0xfc, 0x85, 0x00, + 0x96, 0x2d, 0x80, 0x87, 0xb0, 0x4f, 0xc3, 0x90, 0xe5, 0xe2, 0xc9, 0xfc, 0x22, 0x89, 0xc3, 0x33, + 0xd3, 0x4a, 0x5d, 0xb2, 0x0e, 0xe3, 0xf7, 0xa1, 0x67, 0x12, 0x5b, 0x52, 0x75, 0x69, 0x36, 0xf0, + 0xff, 0x5c, 0xfd, 0x00, 0x3a, 0x3a, 0x9f, 0xa9, 0x96, 0xde, 0x25, 0xd5, 0x3d, 0x78, 0x8e, 0xa0, + 0x53, 0x6e, 0xc3, 0x57, 0x20, 0x7c, 0x55, 0xb0, 0xf3, 0xea, 0x0b, 0xc0, 0xae, 0x17, 0xac, 0x82, + 0xf1, 0x01, 0x74, 0x97, 0x2b, 0x7b, 0x1a, 0xa9, 0xbc, 0x5c, 0xb2, 0x82, 0x35, 0x17, 0xaa, 0xfd, + 0x92, 0x42, 0x05, 0xdf, 0x6b, 0xe9, 0xcc, 0x8f, 0xd3, 0xb6, 0x5c, 0x1e, 0xc3, 0xbe, 0x59, 0x58, + 0x84, 0xe5, 0x09, 0x0d, 0xab, 0x6d, 0xf3, 0xf6, 0x5a, 0x59, 0xc9, 0x0a, 0x8b, 0xac, 0x7b, 0x05, + 0x3f, 0xc2, 0xde, 0x2a, 0xe5, 0x15, 0x94, 0x70, 0xd9, 0x49, 0x55, 0x6e, 0xa6, 0x86, 0x1b, 0x78, + 0x20, 0xe0, 0x4e, 0xd3, 0xcf, 0xea, 0xd6, 0x28, 0xd6, 0xfa, 0xa9, 0xf5, 0xaf, 0xfb, 0xe9, 0xe0, + 0x18, 0xf6, 0xd7, 0xec, 0xd8, 0x85, 0xf6, 0x71, 0x34, 0x8b, 0xd3, 0x9e, 0x85, 0x01, 0x76, 0xbf, + 0x2e, 0x62, 0xc1, 0x8a, 0x1e, 0x92, 0x67, 0x19, 0x2a, 0x2b, 0x7a, 0x2d, 0xec, 0x81, 0xa3, 0xa5, + 0x89, 0x7a, 0xf6, 0xc9, 0x3b, 0xcf, 0x6f, 0xfa, 0xe8, 0xc5, 0x4d, 0x1f, 0xfd, 0x79, 0xd3, 0x47, + 0xbf, 0xdc, 0xf6, 0xad, 0x17, 0xb7, 0x7d, 0xeb, 0xf7, 0xdb, 0xbe, 0xf5, 0x6d, 0x5b, 0x7d, 0x88, + 0x5e, 0xec, 0xaa, 0xef, 0xce, 0x87, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x2a, 0xe8, 0x23, 0x71, + 0xab, 0x0a, 0x00, 0x00, } func (m *RawChange) Marshal() (dAtA []byte, err error) { @@ -1499,50 +1155,6 @@ func (m *RawChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *RawRecord) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RawRecord) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RawRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Id) > 0 { - i -= len(m.Id) - copy(dAtA[i:], m.Id) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Id))) - i-- - dAtA[i] = 0x1a - } - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x12 - } - if len(m.Payload) > 0 { - i -= len(m.Payload) - copy(dAtA[i:], m.Payload) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Payload))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *ACLChange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1627,7 +1239,7 @@ func (m *ACLChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValue) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_ACLContentValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1637,12 +1249,12 @@ func (m *ACLChangeACLContentValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeACLContentValue) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContentValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1659,12 +1271,12 @@ func (m *ACLChangeACLContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserAdd) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserAdd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserAdd != nil { { @@ -1680,12 +1292,12 @@ func (m *ACLChangeACLContentValueValueOfUserAdd) MarshalToSizedBuffer(dAtA []byt } return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserRemove) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserRemove != nil { { @@ -1701,12 +1313,12 @@ func (m *ACLChangeACLContentValueValueOfUserRemove) MarshalToSizedBuffer(dAtA [] } return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserPermissionChange) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserPermissionChange) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserPermissionChange != nil { { @@ -1722,12 +1334,12 @@ func (m *ACLChangeACLContentValueValueOfUserPermissionChange) MarshalToSizedBuff } return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserInvite) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserInvite) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserInvite != nil { { @@ -1743,12 +1355,12 @@ func (m *ACLChangeACLContentValueValueOfUserInvite) MarshalToSizedBuffer(dAtA [] } return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserJoin) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserJoin) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserJoin != nil { { @@ -1764,12 +1376,12 @@ func (m *ACLChangeACLContentValueValueOfUserJoin) MarshalToSizedBuffer(dAtA []by } return len(dAtA) - i, nil } -func (m *ACLChangeACLContentValueValueOfUserConfirm) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserConfirm) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLContentValueValueOfUserConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLContent_Value_UserConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UserConfirm != nil { { @@ -1785,7 +1397,7 @@ func (m *ACLChangeACLContentValueValueOfUserConfirm) MarshalToSizedBuffer(dAtA [ } return len(dAtA) - i, nil } -func (m *ACLChangeACLData) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_ACLData) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1795,12 +1407,12 @@ func (m *ACLChangeACLData) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeACLData) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLData) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLData) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1834,7 +1446,7 @@ func (m *ACLChangeACLData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeACLSnapshot) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_ACLSnapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1844,12 +1456,12 @@ func (m *ACLChangeACLSnapshot) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeACLSnapshot) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLSnapshot) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1869,7 +1481,7 @@ func (m *ACLChangeACLSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeACLState) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_ACLState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1879,12 +1491,12 @@ func (m *ACLChangeACLState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeACLState) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ACLState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeACLState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ACLState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1950,7 +1562,7 @@ func (m *ACLChangeACLState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserState) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1960,12 +1572,12 @@ func (m *ACLChangeUserState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserState) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2011,7 +1623,7 @@ func (m *ACLChangeUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserAdd) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserAdd) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2021,12 +1633,12 @@ func (m *ACLChangeUserAdd) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserAdd) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserAdd) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2062,7 +1674,7 @@ func (m *ACLChangeUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserConfirm) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserConfirm) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2072,12 +1684,12 @@ func (m *ACLChangeUserConfirm) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserConfirm) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserConfirm) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2099,7 +1711,7 @@ func (m *ACLChangeUserConfirm) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserInvite) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserInvite) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2109,12 +1721,12 @@ func (m *ACLChangeUserInvite) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserInvite) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserInvite) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2157,7 +1769,7 @@ func (m *ACLChangeUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserJoin) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserJoin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2167,12 +1779,12 @@ func (m *ACLChangeUserJoin) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserJoin) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserJoin) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2217,7 +1829,7 @@ func (m *ACLChangeUserJoin) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeUserRemove) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserRemove) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2227,12 +1839,12 @@ func (m *ACLChangeUserRemove) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserRemove) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserRemove) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2261,7 +1873,7 @@ func (m *ACLChangeUserRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ACLChangeReadKeyReplace) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_ReadKeyReplace) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2271,12 +1883,12 @@ func (m *ACLChangeReadKeyReplace) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeReadKeyReplace) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_ReadKeyReplace) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_ReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2305,7 +1917,7 @@ func (m *ACLChangeReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *ACLChangeUserPermissionChange) Marshal() (dAtA []byte, err error) { +func (m *ACLChange_UserPermissionChange) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2315,12 +1927,12 @@ func (m *ACLChangeUserPermissionChange) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ACLChangeUserPermissionChange) MarshalTo(dAtA []byte) (int, error) { +func (m *ACLChange_UserPermissionChange) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *ACLChangeUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ACLChange_UserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2340,189 +1952,6 @@ func (m *ACLChangeUserPermissionChange) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *Change) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Change) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Change) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsSnapshot { - i-- - if m.IsSnapshot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x40 - } - if len(m.Identity) > 0 { - i -= len(m.Identity) - copy(dAtA[i:], m.Identity) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Identity))) - i-- - dAtA[i] = 0x3a - } - if m.Timestamp != 0 { - i = encodeVarintAclchanges(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x30 - } - if m.CurrentReadKeyHash != 0 { - i = encodeVarintAclchanges(dAtA, i, uint64(m.CurrentReadKeyHash)) - i-- - dAtA[i] = 0x28 - } - if len(m.ChangesData) > 0 { - i -= len(m.ChangesData) - copy(dAtA[i:], m.ChangesData) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.ChangesData))) - i-- - dAtA[i] = 0x22 - } - if len(m.SnapshotBaseId) > 0 { - i -= len(m.SnapshotBaseId) - copy(dAtA[i:], m.SnapshotBaseId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.SnapshotBaseId))) - i-- - dAtA[i] = 0x1a - } - if len(m.AclHeadId) > 0 { - i -= len(m.AclHeadId) - copy(dAtA[i:], m.AclHeadId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.AclHeadId))) - i-- - dAtA[i] = 0x12 - } - if len(m.TreeHeadIds) > 0 { - for iNdEx := len(m.TreeHeadIds) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.TreeHeadIds[iNdEx]) - copy(dAtA[i:], m.TreeHeadIds[iNdEx]) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.TreeHeadIds[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Record) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Record) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Timestamp != 0 { - i = encodeVarintAclchanges(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x28 - } - if m.CurrentReadKeyHash != 0 { - i = encodeVarintAclchanges(dAtA, i, uint64(m.CurrentReadKeyHash)) - i-- - dAtA[i] = 0x20 - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if len(m.Identity) > 0 { - i -= len(m.Identity) - copy(dAtA[i:], m.Identity) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.Identity))) - i-- - dAtA[i] = 0x12 - } - if len(m.PrevId) > 0 { - i -= len(m.PrevId) - copy(dAtA[i:], m.PrevId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.PrevId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Header) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Header) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.DocType != 0 { - i = encodeVarintAclchanges(dAtA, i, uint64(m.DocType)) - i-- - dAtA[i] = 0x20 - } - if len(m.WorkspaceId) > 0 { - i -= len(m.WorkspaceId) - copy(dAtA[i:], m.WorkspaceId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.WorkspaceId))) - i-- - dAtA[i] = 0x1a - } - if len(m.AclListId) > 0 { - i -= len(m.AclListId) - copy(dAtA[i:], m.AclListId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.AclListId))) - i-- - dAtA[i] = 0x12 - } - if len(m.FirstId) > 0 { - i -= len(m.FirstId) - copy(dAtA[i:], m.FirstId) - i = encodeVarintAclchanges(dAtA, i, uint64(len(m.FirstId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func encodeVarintAclchanges(dAtA []byte, offset int, v uint64) int { offset -= sovAclchanges(v) base := offset @@ -2555,27 +1984,6 @@ func (m *RawChange) Size() (n int) { return n } -func (m *RawRecord) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Payload) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.Id) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - return n -} - func (m *ACLChange) Size() (n int) { if m == nil { return 0 @@ -2619,7 +2027,7 @@ func (m *ACLChange) Size() (n int) { return n } -func (m *ACLChangeACLContentValue) Size() (n int) { +func (m *ACLChange_ACLContentValue) Size() (n int) { if m == nil { return 0 } @@ -2631,7 +2039,7 @@ func (m *ACLChangeACLContentValue) Size() (n int) { return n } -func (m *ACLChangeACLContentValueValueOfUserAdd) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserAdd) Size() (n int) { if m == nil { return 0 } @@ -2643,7 +2051,7 @@ func (m *ACLChangeACLContentValueValueOfUserAdd) Size() (n int) { } return n } -func (m *ACLChangeACLContentValueValueOfUserRemove) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserRemove) Size() (n int) { if m == nil { return 0 } @@ -2655,7 +2063,7 @@ func (m *ACLChangeACLContentValueValueOfUserRemove) Size() (n int) { } return n } -func (m *ACLChangeACLContentValueValueOfUserPermissionChange) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserPermissionChange) Size() (n int) { if m == nil { return 0 } @@ -2667,7 +2075,7 @@ func (m *ACLChangeACLContentValueValueOfUserPermissionChange) Size() (n int) { } return n } -func (m *ACLChangeACLContentValueValueOfUserInvite) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserInvite) Size() (n int) { if m == nil { return 0 } @@ -2679,7 +2087,7 @@ func (m *ACLChangeACLContentValueValueOfUserInvite) Size() (n int) { } return n } -func (m *ACLChangeACLContentValueValueOfUserJoin) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserJoin) Size() (n int) { if m == nil { return 0 } @@ -2691,7 +2099,7 @@ func (m *ACLChangeACLContentValueValueOfUserJoin) Size() (n int) { } return n } -func (m *ACLChangeACLContentValueValueOfUserConfirm) Size() (n int) { +func (m *ACLChange_ACLContent_Value_UserConfirm) Size() (n int) { if m == nil { return 0 } @@ -2703,7 +2111,7 @@ func (m *ACLChangeACLContentValueValueOfUserConfirm) Size() (n int) { } return n } -func (m *ACLChangeACLData) Size() (n int) { +func (m *ACLChange_ACLData) Size() (n int) { if m == nil { return 0 } @@ -2722,7 +2130,7 @@ func (m *ACLChangeACLData) Size() (n int) { return n } -func (m *ACLChangeACLSnapshot) Size() (n int) { +func (m *ACLChange_ACLSnapshot) Size() (n int) { if m == nil { return 0 } @@ -2735,7 +2143,7 @@ func (m *ACLChangeACLSnapshot) Size() (n int) { return n } -func (m *ACLChangeACLState) Size() (n int) { +func (m *ACLChange_ACLState) Size() (n int) { if m == nil { return 0 } @@ -2770,7 +2178,7 @@ func (m *ACLChangeACLState) Size() (n int) { return n } -func (m *ACLChangeUserState) Size() (n int) { +func (m *ACLChange_UserState) Size() (n int) { if m == nil { return 0 } @@ -2799,7 +2207,7 @@ func (m *ACLChangeUserState) Size() (n int) { return n } -func (m *ACLChangeUserAdd) Size() (n int) { +func (m *ACLChange_UserAdd) Size() (n int) { if m == nil { return 0 } @@ -2825,7 +2233,7 @@ func (m *ACLChangeUserAdd) Size() (n int) { return n } -func (m *ACLChangeUserConfirm) Size() (n int) { +func (m *ACLChange_UserConfirm) Size() (n int) { if m == nil { return 0 } @@ -2842,7 +2250,7 @@ func (m *ACLChangeUserConfirm) Size() (n int) { return n } -func (m *ACLChangeUserInvite) Size() (n int) { +func (m *ACLChange_UserInvite) Size() (n int) { if m == nil { return 0 } @@ -2872,7 +2280,7 @@ func (m *ACLChangeUserInvite) Size() (n int) { return n } -func (m *ACLChangeUserJoin) Size() (n int) { +func (m *ACLChange_UserJoin) Size() (n int) { if m == nil { return 0 } @@ -2903,7 +2311,7 @@ func (m *ACLChangeUserJoin) Size() (n int) { return n } -func (m *ACLChangeUserRemove) Size() (n int) { +func (m *ACLChange_UserRemove) Size() (n int) { if m == nil { return 0 } @@ -2922,7 +2330,7 @@ func (m *ACLChangeUserRemove) Size() (n int) { return n } -func (m *ACLChangeReadKeyReplace) Size() (n int) { +func (m *ACLChange_ReadKeyReplace) Size() (n int) { if m == nil { return 0 } @@ -2943,7 +2351,7 @@ func (m *ACLChangeReadKeyReplace) Size() (n int) { return n } -func (m *ACLChangeUserPermissionChange) Size() (n int) { +func (m *ACLChange_UserPermissionChange) Size() (n int) { if m == nil { return 0 } @@ -2959,97 +2367,6 @@ func (m *ACLChangeUserPermissionChange) Size() (n int) { return n } -func (m *Change) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TreeHeadIds) > 0 { - for _, s := range m.TreeHeadIds { - l = len(s) - n += 1 + l + sovAclchanges(uint64(l)) - } - } - l = len(m.AclHeadId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.SnapshotBaseId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.ChangesData) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - if m.CurrentReadKeyHash != 0 { - n += 1 + sovAclchanges(uint64(m.CurrentReadKeyHash)) - } - if m.Timestamp != 0 { - n += 1 + sovAclchanges(uint64(m.Timestamp)) - } - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - if m.IsSnapshot { - n += 2 - } - return n -} - -func (m *Record) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.PrevId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - if m.CurrentReadKeyHash != 0 { - n += 1 + sovAclchanges(uint64(m.CurrentReadKeyHash)) - } - if m.Timestamp != 0 { - n += 1 + sovAclchanges(uint64(m.Timestamp)) - } - return n -} - -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.FirstId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.AclListId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - l = len(m.WorkspaceId) - if l > 0 { - n += 1 + l + sovAclchanges(uint64(l)) - } - if m.DocType != 0 { - n += 1 + sovAclchanges(uint64(m.DocType)) - } - return n -} - func sovAclchanges(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3206,156 +2523,6 @@ func (m *RawChange) Unmarshal(dAtA []byte) error { } return nil } -func (m *RawRecord) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RawRecord: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RawRecord: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Payload = append(m.Payload[:0], dAtA[iNdEx:postIndex]...) - if m.Payload == nil { - m.Payload = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Id = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipAclchanges(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAclchanges - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *ACLChange) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3511,7 +2678,7 @@ func (m *ACLChange) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.AclData == nil { - m.AclData = &ACLChangeACLData{} + m.AclData = &ACLChange_ACLData{} } if err := m.AclData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3642,7 +2809,7 @@ func (m *ACLChange) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { +func (m *ACLChange_ACLContentValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3700,11 +2867,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserAdd{} + v := &ACLChange_UserAdd{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserAdd{v} + m.Value = &ACLChange_ACLContent_Value_UserAdd{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -3735,11 +2902,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserRemove{} + v := &ACLChange_UserRemove{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserRemove{v} + m.Value = &ACLChange_ACLContent_Value_UserRemove{v} iNdEx = postIndex case 3: if wireType != 2 { @@ -3770,11 +2937,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserPermissionChange{} + v := &ACLChange_UserPermissionChange{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserPermissionChange{v} + m.Value = &ACLChange_ACLContent_Value_UserPermissionChange{v} iNdEx = postIndex case 4: if wireType != 2 { @@ -3805,11 +2972,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserInvite{} + v := &ACLChange_UserInvite{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserInvite{v} + m.Value = &ACLChange_ACLContent_Value_UserInvite{v} iNdEx = postIndex case 5: if wireType != 2 { @@ -3840,11 +3007,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserJoin{} + v := &ACLChange_UserJoin{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserJoin{v} + m.Value = &ACLChange_ACLContent_Value_UserJoin{v} iNdEx = postIndex case 6: if wireType != 2 { @@ -3875,11 +3042,11 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &ACLChangeUserConfirm{} + v := &ACLChange_UserConfirm{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &ACLChangeACLContentValueValueOfUserConfirm{v} + m.Value = &ACLChange_ACLContent_Value_UserConfirm{v} iNdEx = postIndex default: iNdEx = preIndex @@ -3902,7 +3069,7 @@ func (m *ACLChangeACLContentValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeACLData) Unmarshal(dAtA []byte) error { +func (m *ACLChange_ACLData) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3961,7 +3128,7 @@ func (m *ACLChangeACLData) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.AclSnapshot == nil { - m.AclSnapshot = &ACLChangeACLSnapshot{} + m.AclSnapshot = &ACLChange_ACLSnapshot{} } if err := m.AclSnapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3996,7 +3163,7 @@ func (m *ACLChangeACLData) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AclContent = append(m.AclContent, &ACLChangeACLContentValue{}) + m.AclContent = append(m.AclContent, &ACLChange_ACLContentValue{}) if err := m.AclContent[len(m.AclContent)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4022,7 +3189,7 @@ func (m *ACLChangeACLData) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeACLSnapshot) Unmarshal(dAtA []byte) error { +func (m *ACLChange_ACLSnapshot) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4081,7 +3248,7 @@ func (m *ACLChangeACLSnapshot) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.AclState == nil { - m.AclState = &ACLChangeACLState{} + m.AclState = &ACLChange_ACLState{} } if err := m.AclState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -4108,7 +3275,7 @@ func (m *ACLChangeACLSnapshot) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeACLState) Unmarshal(dAtA []byte) error { +func (m *ACLChange_ACLState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4242,7 +3409,7 @@ func (m *ACLChangeACLState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.UserStates = append(m.UserStates, &ACLChangeUserState{}) + m.UserStates = append(m.UserStates, &ACLChange_UserState{}) if err := m.UserStates[len(m.UserStates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -4277,10 +3444,10 @@ func (m *ACLChangeACLState) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Invites == nil { - m.Invites = make(map[string]*ACLChangeUserInvite) + m.Invites = make(map[string]*ACLChange_UserInvite) } var mapkey string - var mapvalue *ACLChangeUserInvite + var mapvalue *ACLChange_UserInvite for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 @@ -4354,7 +3521,7 @@ func (m *ACLChangeACLState) Unmarshal(dAtA []byte) error { if postmsgIndex > l { return io.ErrUnexpectedEOF } - mapvalue = &ACLChangeUserInvite{} + mapvalue = &ACLChange_UserInvite{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } @@ -4397,7 +3564,7 @@ func (m *ACLChangeACLState) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserState) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4538,7 +3705,7 @@ func (m *ACLChangeUserState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLChangeUserPermissions(b&0x7F) << shift + m.Permissions |= ACLChange_UserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -4584,7 +3751,7 @@ func (m *ACLChangeUserState) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserAdd) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserAdd) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4725,7 +3892,7 @@ func (m *ACLChangeUserAdd) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLChangeUserPermissions(b&0x7F) << shift + m.Permissions |= ACLChange_UserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -4751,7 +3918,7 @@ func (m *ACLChangeUserAdd) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserConfirm) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserConfirm) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4865,7 +4032,7 @@ func (m *ACLChangeUserConfirm) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserInvite) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserInvite) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5008,7 +4175,7 @@ func (m *ACLChangeUserInvite) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLChangeUserPermissions(b&0x7F) << shift + m.Permissions |= ACLChange_UserPermissions(b&0x7F) << shift if b < 0x80 { break } @@ -5066,7 +4233,7 @@ func (m *ACLChangeUserInvite) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserJoin) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserJoin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5280,7 +4447,7 @@ func (m *ACLChangeUserJoin) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserRemove) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserRemove) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5370,7 +4537,7 @@ func (m *ACLChangeUserRemove) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ReadKeyReplaces = append(m.ReadKeyReplaces, &ACLChangeReadKeyReplace{}) + m.ReadKeyReplaces = append(m.ReadKeyReplaces, &ACLChange_ReadKeyReplace{}) if err := m.ReadKeyReplaces[len(m.ReadKeyReplaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5396,7 +4563,7 @@ func (m *ACLChangeUserRemove) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeReadKeyReplace) Unmarshal(dAtA []byte) error { +func (m *ACLChange_ReadKeyReplace) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5546,7 +4713,7 @@ func (m *ACLChangeReadKeyReplace) Unmarshal(dAtA []byte) error { } return nil } -func (m *ACLChangeUserPermissionChange) Unmarshal(dAtA []byte) error { +func (m *ACLChange_UserPermissionChange) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -5621,628 +4788,7 @@ func (m *ACLChangeUserPermissionChange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Permissions |= ACLChangeUserPermissions(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAclchanges(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAclchanges - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Change) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Change: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Change: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeHeadIds", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TreeHeadIds = append(m.TreeHeadIds, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AclHeadId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AclHeadId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotBaseId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SnapshotBaseId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChangesData", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChangesData = append(m.ChangesData[:0], dAtA[iNdEx:postIndex]...) - if m.ChangesData == nil { - m.ChangesData = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentReadKeyHash", wireType) - } - m.CurrentReadKeyHash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentReadKeyHash |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsSnapshot", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsSnapshot = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipAclchanges(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAclchanges - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Record) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Record: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Record: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrevId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PrevId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentReadKeyHash", wireType) - } - m.CurrentReadKeyHash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentReadKeyHash |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipAclchanges(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthAclchanges - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Header) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FirstId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FirstId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AclListId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AclListId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WorkspaceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthAclchanges - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthAclchanges - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.WorkspaceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DocType", wireType) - } - m.DocType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclchanges - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.DocType |= HeaderDocType(b&0x7F) << shift + m.Permissions |= ACLChange_UserPermissions(b&0x7F) << shift if b < 0x80 { break } diff --git a/pkg/acl/acltree/aclstatebuilder.go b/pkg/acl/acltree/aclstatebuilder.go new file mode 100644 index 00000000..8528f9cf --- /dev/null +++ b/pkg/acl/acltree/aclstatebuilder.go @@ -0,0 +1,186 @@ +package acltree + +import ( + "fmt" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/account" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/encryptionkey" + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/signingkey" +) + +type aclStateBuilder struct { + tree *Tree + identity string + key encryptionkey.PrivKey + decoder signingkey.PubKeyDecoder +} + +type decreasedPermissionsParameters struct { + users []*aclpb.ACLChange_UserPermissionChange + startChange string +} + +func newACLStateBuilder(decoder signingkey.PubKeyDecoder, accountData *account.AccountData) *aclStateBuilder { + return &aclStateBuilder{ + decoder: decoder, + identity: accountData.Identity, + key: accountData.EncKey, + } +} + +func (sb *aclStateBuilder) Init(tree *Tree) error { + sb.tree = tree + return nil +} + +func (sb *aclStateBuilder) Build() (*ACLState, error) { + state, _, err := sb.BuildBefore("") + return state, err +} + +// TODO: we can probably have only one state builder, because we can Build both at the same time +func (sb *aclStateBuilder) BuildBefore(beforeId string) (*ACLState, bool, error) { + var ( + err error + startChange = sb.tree.root + foundId bool + idSeenMap = make(map[string][]*Change) + decreasedPermissions *decreasedPermissionsParameters + ) + root := sb.tree.Root() + if !root.IsSnapshot { + return nil, false, fmt.Errorf("root should always be a snapshot") + } + + state, err := newACLStateFromSnapshotChange( + root.Content, + sb.identity, + sb.key, + sb.decoder) + if err != nil { + return nil, false, fmt.Errorf("could not build ACLState from snapshot: %w", err) + } + + idSeenMap[startChange.Content.Identity] = append(idSeenMap[startChange.Content.Identity], startChange) + + if startChange.Content.GetChangesData() != nil { + key, exists := state.userReadKeys[startChange.Content.CurrentReadKeyHash] + if !exists { + return nil, false, fmt.Errorf("no first snapshot") + } + + err = startChange.DecryptContents(key) + if err != nil { + return nil, false, fmt.Errorf("failed to decrypt contents of first snapshot") + } + } + + if beforeId == startChange.Id { + return state, true, nil + } + + for { + // TODO: we should optimize this method to just remember last state of iterator and not iterate from the start and skip if nothing was removed from the Tree + sb.tree.IterateSkip(sb.tree.root.Id, startChange.Id, func(c *Change) (isContinue bool) { + defer func() { + if err == nil { + startChange = c + } else if err != ErrDocumentForbidden { + //log.Errorf("marking change %s as invalid: %v", c.Id, err) + sb.tree.RemoveInvalidChange(c.Id) + } + }() + + // not applying root change + if c.Id == startChange.Id { + return true + } + + idSeenMap[c.Content.Identity] = append(idSeenMap[c.Content.Identity], c) + if c.Content.GetAclData() != nil { + err = state.applyChange(c.Content) + if err != nil { + return false + } + + // if we have some users who have less permissions now + users := state.getPermissionDecreasedUsers(c.Content) + if len(users) > 0 { + decreasedPermissions = &decreasedPermissionsParameters{ + users: users, + startChange: c.Id, + } + return false + } + } + + // the user can't make changes + if !state.hasPermission(c.Content.Identity, aclpb.ACLChange_Writer) && !state.hasPermission(c.Content.Identity, aclpb.ACLChange_Admin) { + err = fmt.Errorf("user %s cannot make changes", c.Content.Identity) + return false + } + + // decrypting contents on the fly + if c.Content.GetChangesData() != nil { + key, exists := state.userReadKeys[c.Content.CurrentReadKeyHash] + if !exists { + err = fmt.Errorf("failed to find key with hash: %d", c.Content.CurrentReadKeyHash) + return false + } + + err = c.DecryptContents(key) + if err != nil { + err = fmt.Errorf("failed to decrypt contents for hash: %d", c.Content.CurrentReadKeyHash) + return false + } + } + + if c.Id == beforeId { + foundId = true + return false + } + + return true + }) + + // if we have users with decreased permissions + if decreasedPermissions != nil { + var removed bool + validChanges := sb.tree.dfs(decreasedPermissions.startChange) + + for _, permChange := range decreasedPermissions.users { + seenChanges := idSeenMap[permChange.Identity] + + for _, seen := range seenChanges { + // if we find some invalid changes + if _, exists := validChanges[seen.Id]; !exists { + // if the user didn't have enough permission to make changes + if seen.IsACLChange() || permChange.Permissions > aclpb.ACLChange_Writer { + removed = true + sb.tree.RemoveInvalidChange(seen.Id) + } + } + } + } + + decreasedPermissions = nil + if removed { + // starting from the beginning but with updated Tree + return sb.BuildBefore(beforeId) + } + } else if err == nil { + // we can finish the acl state building process + break + } + + // the user is forbidden to access the document + if err == ErrDocumentForbidden { + return nil, foundId, err + } + + // otherwise we have to continue from the change which we had + err = nil + } + + return state, foundId, err +} diff --git a/pkg/acl/acltree/change.go b/pkg/acl/acltree/change.go new file mode 100644 index 00000000..a615dfa9 --- /dev/null +++ b/pkg/acl/acltree/change.go @@ -0,0 +1,97 @@ +package acltree + +import ( + "fmt" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" + "github.com/gogo/protobuf/proto" + + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/symmetric" +) + +type ChangeContent struct { + ChangesData proto.Marshaler + ACLData *aclpb.ACLChange_ACLData + Id string // TODO: this is just for testing, because id should be created automatically from content +} + +// Change is an abstract type for all types of changes +type Change struct { + Next []*Change + Unattached []*Change + PreviousIds []string + Id string + SnapshotId string + IsSnapshot bool + DecryptedDocumentChange []byte + + Content *aclpb.ACLChange + Sign []byte +} + +func (ch *Change) DecryptContents(key *symmetric.Key) error { + if ch.Content.ChangesData == nil { + return nil + } + + decrypted, err := key.Decrypt(ch.Content.ChangesData) + if err != nil { + return fmt.Errorf("failed to decrypt changes data: %w", err) + } + + ch.DecryptedDocumentChange = decrypted + return nil +} + +func (ch *Change) IsACLChange() bool { + return ch.Content.GetAclData() != nil +} + +func NewFromRawChange(rawChange *aclpb.RawChange) (*Change, error) { + unmarshalled := &aclpb.ACLChange{} + err := proto.Unmarshal(rawChange.Payload, unmarshalled) + if err != nil { + return nil, err + } + + ch := NewChange(rawChange.Id, unmarshalled) + ch.Sign = rawChange.Signature + return ch, nil +} + +func NewChange(id string, ch *aclpb.ACLChange) *Change { + return &Change{ + Next: nil, + PreviousIds: ch.TreeHeadIds, + Id: id, + Content: ch, + SnapshotId: ch.SnapshotBaseId, + IsSnapshot: ch.GetAclData().GetAclSnapshot() != nil, + } +} + +func NewACLChange(id string, ch *aclpb.ACLChange) *Change { + return &Change{ + Next: nil, + PreviousIds: ch.AclHeadIds, + Id: id, + Content: ch, + SnapshotId: ch.SnapshotBaseId, + IsSnapshot: ch.GetAclData().GetAclSnapshot() != nil, + } +} + +func (ch *Change) ProtoChange() *aclpb.ACLChange { + return ch.Content +} + +func (ch *Change) DecryptedChangeContent() []byte { + return ch.DecryptedDocumentChange +} + +func (ch *Change) Signature() []byte { + return ch.Sign +} + +func (ch *Change) CID() string { + return ch.Id +} diff --git a/pkg/acl/example/plaintextdocument/document.go b/pkg/acl/example/plaintextdocument/document.go new file mode 100644 index 00000000..2c66b5b1 --- /dev/null +++ b/pkg/acl/example/plaintextdocument/document.go @@ -0,0 +1,169 @@ +package plaintextdocument + +import ( + "context" + "fmt" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/account" + aclpb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/acltree" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/testchangepb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage" + + "github.com/gogo/protobuf/proto" +) + +type PlainTextDocument interface { + Text() string + AddText(ctx context.Context, text string) error +} + +// TODO: this struct is not thread-safe, so use it wisely :-) +type plainTextDocument struct { + heads []string + aclTree acltree.ACLTree + state *DocumentState +} + +func (p *plainTextDocument) Text() string { + if p.state != nil { + return p.state.Text + } + return "" +} + +func (p *plainTextDocument) AddText(ctx context.Context, text string) error { + _, err := p.aclTree.AddContent(ctx, func(builder acltree.ChangeBuilder) error { + builder.AddChangeContent( + &testchangepb.PlainTextChange_Data{ + Content: []*testchangepb.PlainTextChange_Content{ + createAppendTextChangeContent(text), + }, + }) + return nil + }) + return err +} + +func (p *plainTextDocument) Update(tree acltree.ACLTree) { + p.aclTree = tree + var err error + defer func() { + if err != nil { + fmt.Println("rebuild has returned error:", err) + } + }() + + prevHeads := p.heads + p.heads = tree.Heads() + startId := prevHeads[0] + tree.IterateFrom(startId, func(change *acltree.Change) (isContinue bool) { + if change.Id == startId { + return true + } + if change.DecryptedDocumentChange != nil { + p.state, err = p.state.ApplyChange(change.DecryptedDocumentChange, change.Id) + if err != nil { + return false + } + } + return true + }) +} + +func (p *plainTextDocument) Rebuild(tree acltree.ACLTree) { + p.aclTree = tree + p.heads = tree.Heads() + var startId string + var err error + defer func() { + if err != nil { + fmt.Println("rebuild has returned error:", err) + } + }() + + rootChange := tree.Root() + + if rootChange.DecryptedDocumentChange == nil { + err = fmt.Errorf("root doesn't have decrypted change") + return + } + + state, err := BuildDocumentStateFromChange(rootChange.DecryptedDocumentChange, rootChange.Id) + if err != nil { + return + } + + startId = rootChange.Id + tree.Iterate(func(change *acltree.Change) (isContinue bool) { + if startId == change.Id { + return true + } + if change.DecryptedDocumentChange != nil { + state, err = state.ApplyChange(change.DecryptedDocumentChange, change.Id) + if err != nil { + return false + } + } + return true + }) + if err != nil { + return + } + p.state = state +} + +func NewInMemoryPlainTextDocument(acc *account.AccountData, text string) (PlainTextDocument, error) { + return NewPlainTextDocument(acc, treestorage.NewInMemoryTreeStorage, text) +} + +func NewPlainTextDocument( + acc *account.AccountData, + create treestorage.CreatorFunc, + text string) (PlainTextDocument, error) { + changeBuilder := func(builder acltree.ChangeBuilder) error { + err := builder.UserAdd(acc.Identity, acc.EncKey.GetPublic(), aclpb.ACLChange_Admin) + if err != nil { + return err + } + builder.AddChangeContent(createInitialChangeContent(text)) + return nil + } + t, err := acltree.CreateNewTreeStorageWithACL( + acc, + changeBuilder, + create) + if err != nil { + return nil, err + } + + doc := &plainTextDocument{ + heads: nil, + aclTree: nil, + state: nil, + } + tree, err := acltree.BuildACLTree(t, acc, doc) + if err != nil { + return nil, err + } + doc.aclTree = tree + return doc, nil +} + +func createInitialChangeContent(text string) proto.Marshaler { + return &testchangepb.PlainTextChange_Data{ + Content: []*testchangepb.PlainTextChange_Content{ + createAppendTextChangeContent(text), + }, + Snapshot: &testchangepb.PlainTextChange_Snapshot{Text: text}, + } +} + +func createAppendTextChangeContent(text string) *testchangepb.PlainTextChange_Content { + return &testchangepb.PlainTextChange_Content{ + Value: &testchangepb.PlainTextChange_Content_TextAppend{ + TextAppend: &testchangepb.PlainTextChange_TextAppend{ + Text: text, + }, + }, + } +} diff --git a/pkg/acl/example/plaintextdocument/plaintextdocstate.go b/pkg/acl/example/plaintextdocument/plaintextdocstate.go new file mode 100644 index 00000000..22ac1e4d --- /dev/null +++ b/pkg/acl/example/plaintextdocument/plaintextdocstate.go @@ -0,0 +1,59 @@ +package plaintextdocument + +import ( + "fmt" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/testchangepb" + + "github.com/gogo/protobuf/proto" +) + +type DocumentState struct { + LastChangeId string + Text string +} + +func NewDocumentState(text string, id string) *DocumentState { + return &DocumentState{ + LastChangeId: id, + Text: text, + } +} + +func BuildDocumentStateFromChange(change []byte, id string) (*DocumentState, error) { + var changesData testchangepb.PlainTextChange_Data + err := proto.Unmarshal(change, &changesData) + if err != nil { + return nil, err + } + + if changesData.GetSnapshot() == nil { + return nil, fmt.Errorf("could not create state from empty snapshot") + } + return NewDocumentState(changesData.GetSnapshot().GetText(), id), nil +} + +func (p *DocumentState) ApplyChange(change []byte, id string) (*DocumentState, error) { + var changesData testchangepb.PlainTextChange_Data + err := proto.Unmarshal(change, &changesData) + if err != nil { + return nil, err + } + + for _, content := range changesData.GetContent() { + err = p.applyChange(content) + if err != nil { + return nil, err + } + } + p.LastChangeId = id + return p, nil +} + +func (p *DocumentState) applyChange(ch *testchangepb.PlainTextChange_Content) error { + switch { + case ch.GetTextAppend() != nil: + text := ch.GetTextAppend().GetText() + p.Text += "|" + text + } + return nil +} diff --git a/pkg/acl/list/aclstate.go b/pkg/acl/list/aclstate.go index 6765ee99..d28d59b2 100644 --- a/pkg/acl/list/aclstate.go +++ b/pkg/acl/list/aclstate.go @@ -1,189 +1,135 @@ -package list +package acltree import ( + "bytes" "errors" "fmt" - "github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/common" - "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys" "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/encryptionkey" "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/signingkey" "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/symmetric" - "github.com/gogo/protobuf/proto" - "go.uber.org/zap" "hash/fnv" ) -var log = logger.NewNamed("acllist").Sugar() - var ErrNoSuchUser = errors.New("no such user") var ErrFailedToDecrypt = errors.New("failed to decrypt key") var ErrUserRemoved = errors.New("user was removed from the document") var ErrDocumentForbidden = errors.New("your user was forbidden access to the document") var ErrUserAlreadyExists = errors.New("user already exists") -var ErrNoSuchRecord = errors.New("no such record") -var ErrInsufficientPermissions = errors.New("insufficient permissions") -var ErrNoReadKey = errors.New("acl state doesn't have a read key") -var ErrInvalidSignature = errors.New("signature is invalid") - -type UserPermissionPair struct { - Identity string - Permission aclpb.ACLChangeUserPermissions -} type ACLState struct { - currentReadKeyHash uint64 - userReadKeys map[uint64]*symmetric.Key - userStates map[string]*aclpb.ACLChangeUserState - userInvites map[string]*aclpb.ACLChangeUserInvite - - signingPubKeyDecoder keys.Decoder + currentReadKeyHash uint64 + userReadKeys map[uint64]*symmetric.Key + userStates map[string]*aclpb.ACLChange_UserState + userInvites map[string]*aclpb.ACLChange_UserInvite + signingPubKeyDecoder signingkey.PubKeyDecoder encryptionKey encryptionkey.PrivKey - - identity string - permissionsAtRecord map[string][]UserPermissionPair - - keychain *common.Keychain + identity string } -func newACLStateWithIdentity( +func newACLState( identity string, encryptionKey encryptionkey.PrivKey, - decoder keys.Decoder) *ACLState { + signingPubKeyDecoder signingkey.PubKeyDecoder) *ACLState { return &ACLState{ identity: identity, encryptionKey: encryptionKey, userReadKeys: make(map[uint64]*symmetric.Key), - userStates: make(map[string]*aclpb.ACLChangeUserState), - userInvites: make(map[string]*aclpb.ACLChangeUserInvite), - signingPubKeyDecoder: decoder, - permissionsAtRecord: make(map[string][]UserPermissionPair), - keychain: common.NewKeychain(), + userStates: make(map[string]*aclpb.ACLChange_UserState), + userInvites: make(map[string]*aclpb.ACLChange_UserInvite), + signingPubKeyDecoder: signingPubKeyDecoder, } } -func newACLState(decoder keys.Decoder) *ACLState { - return &ACLState{ - signingPubKeyDecoder: decoder, +func newACLStateFromSnapshotChange( + snapshotChange *aclpb.ACLChange, + identity string, + encryptionKey encryptionkey.PrivKey, + signingPubKeyDecoder signingkey.PubKeyDecoder) (*ACLState, error) { + st := &ACLState{ + identity: identity, + encryptionKey: encryptionKey, userReadKeys: make(map[uint64]*symmetric.Key), - userStates: make(map[string]*aclpb.ACLChangeUserState), - userInvites: make(map[string]*aclpb.ACLChangeUserInvite), - permissionsAtRecord: make(map[string][]UserPermissionPair), - keychain: common.NewKeychain(), + userStates: make(map[string]*aclpb.ACLChange_UserState), + userInvites: make(map[string]*aclpb.ACLChange_UserInvite), + signingPubKeyDecoder: signingPubKeyDecoder, } + err := st.recreateFromSnapshotChange(snapshotChange) + if err != nil { + return nil, err + } + return st, nil } -func (st *ACLState) CurrentReadKeyHash() uint64 { - return st.currentReadKeyHash -} +func (st *ACLState) recreateFromSnapshotChange(snapshotChange *aclpb.ACLChange) error { + snapshot := snapshotChange.GetAclData().GetAclSnapshot() + if snapshot == nil { + return fmt.Errorf("could not create state from snapshot, because it is nil") + } + state := snapshot.AclState + for _, userState := range state.UserStates { + st.userStates[userState.Identity] = userState + } -func (st *ACLState) CurrentReadKey() (*symmetric.Key, error) { - key, exists := st.userReadKeys[st.currentReadKeyHash] + userState, exists := st.userStates[st.identity] if !exists { - return nil, ErrNoReadKey + return ErrNoSuchUser } - return key, nil -} - -func (st *ACLState) UserReadKeys() map[uint64]*symmetric.Key { - return st.userReadKeys -} - -func (st *ACLState) PermissionsAtRecord(id string, identity string) (UserPermissionPair, error) { - permissions, ok := st.permissionsAtRecord[id] - if !ok { - log.Errorf("missing record at id %s", id) - return UserPermissionPair{}, ErrNoSuchRecord - } - - for _, perm := range permissions { - if perm.Identity == identity { - return perm, nil - } - } - return UserPermissionPair{}, ErrNoSuchUser -} - -func (st *ACLState) applyRecord(record *aclpb.Record) (err error) { - aclData := &aclpb.ACLChangeACLData{} - - err = proto.Unmarshal(record.Data, aclData) - if err != nil { - return - } - - err = st.applyChangeData(aclData, record.CurrentReadKeyHash, record.Identity) - if err != nil { - return - } - - st.currentReadKeyHash = record.CurrentReadKeyHash - return -} - -func (st *ACLState) applyChangeAndUpdate(recordWrapper *Record) (err error) { - var ( - change = recordWrapper.Content - aclData = &aclpb.ACLChangeACLData{} - ) - - if recordWrapper.Model != nil { - aclData = recordWrapper.Model.(*aclpb.ACLChangeACLData) - } else { - err = proto.Unmarshal(change.Data, aclData) + for _, key := range userState.EncryptedReadKeys { + key, hash, err := st.decryptReadKeyAndHash(key) if err != nil { - return + return ErrFailedToDecrypt } - recordWrapper.Model = aclData - } - err = st.applyChangeData(aclData, recordWrapper.Content.CurrentReadKeyHash, recordWrapper.Content.Identity) - if err != nil { - return + st.userReadKeys[hash] = key } - - // getting all permissions for users at record - var permissions []UserPermissionPair - for _, state := range st.userStates { - permission := UserPermissionPair{ - Identity: state.Identity, - Permission: state.Permissions, - } - permissions = append(permissions, permission) + st.currentReadKeyHash = snapshotChange.CurrentReadKeyHash + if snapshot.GetAclState().GetInvites() != nil { + st.userInvites = snapshot.GetAclState().GetInvites() } - - st.permissionsAtRecord[recordWrapper.Id] = permissions return nil } -func (st *ACLState) applyChangeData(changeData *aclpb.ACLChangeACLData, hash uint64, identity string) (err error) { +func (st *ACLState) makeSnapshot() *aclpb.ACLChange_ACLSnapshot { + var userStates []*aclpb.ACLChange_UserState + for _, st := range st.userStates { + userStates = append(userStates, st) + } + + return &aclpb.ACLChange_ACLSnapshot{AclState: &aclpb.ACLChange_ACLState{ + ReadKeyHashes: nil, + UserStates: userStates, // TODO: make states and invites in same format + Invites: st.userInvites, + }} +} + +func (st *ACLState) applyChange(change *aclpb.ACLChange) (err error) { defer func() { if err != nil { return } - st.currentReadKeyHash = hash + st.currentReadKeyHash = change.CurrentReadKeyHash }() // we can't check this for the user which is joining, because it will not be in our list // the same is for the first change to be added - skipIdentityCheck := st.isUserJoin(changeData) || (st.currentReadKeyHash == 0 && st.isUserAdd(changeData, identity)) + skipIdentityCheck := st.isUserJoin(change) || (st.currentReadKeyHash == 0 && st.isUserAdd(change)) if !skipIdentityCheck { // we check signature when we add this to the Tree, so no need to do it here - if _, exists := st.userStates[identity]; !exists { + if _, exists := st.userStates[change.Identity]; !exists { err = ErrNoSuchUser return } - if !st.hasPermission(identity, aclpb.ACLChange_Admin) { - err = fmt.Errorf("user %s must have admin permissions", identity) + if !st.hasPermission(change.Identity, aclpb.ACLChange_Admin) { + err = fmt.Errorf("user %s must have admin permissions", change.Identity) return } } - for _, ch := range changeData.GetAclContent() { + for _, ch := range change.GetAclData().GetAclContent() { if err = st.applyChangeContent(ch); err != nil { - log.Info("error while applying changes: %v; ignore", zap.Error(err)) + //log.Infof("error while applying changes: %v; ignore", err) return err } } @@ -191,7 +137,8 @@ func (st *ACLState) applyChangeData(changeData *aclpb.ACLChangeACLData, hash uin return nil } -func (st *ACLState) applyChangeContent(ch *aclpb.ACLChangeACLContentValue) error { +// TODO: remove changeId, because it is not needed +func (st *ACLState) applyChangeContent(ch *aclpb.ACLChange_ACLContentValue) error { switch { case ch.GetUserPermissionChange() != nil: return st.applyUserPermissionChange(ch.GetUserPermissionChange()) @@ -210,7 +157,7 @@ func (st *ACLState) applyChangeContent(ch *aclpb.ACLChangeACLContentValue) error } } -func (st *ACLState) applyUserPermissionChange(ch *aclpb.ACLChangeUserPermissionChange) error { +func (st *ACLState) applyUserPermissionChange(ch *aclpb.ACLChange_UserPermissionChange) error { if _, exists := st.userStates[ch.Identity]; !exists { return ErrNoSuchUser } @@ -219,12 +166,12 @@ func (st *ACLState) applyUserPermissionChange(ch *aclpb.ACLChangeUserPermissionC return nil } -func (st *ACLState) applyUserInvite(ch *aclpb.ACLChangeUserInvite) error { +func (st *ACLState) applyUserInvite(ch *aclpb.ACLChange_UserInvite) error { st.userInvites[ch.InviteId] = ch return nil } -func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error { +func (st *ACLState) applyUserJoin(ch *aclpb.ACLChange_UserJoin) error { invite, exists := st.userInvites[ch.UserInviteId] if !exists { return fmt.Errorf("no such invite with id %s", ch.UserInviteId) @@ -246,12 +193,12 @@ func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error { return fmt.Errorf("failed to decode signing identity as bytes") } - res, err := verificationKey.(signingkey.PubKey).Verify(rawSignedId, signature) + res, err := verificationKey.Verify(rawSignedId, signature) if err != nil { return fmt.Errorf("verification returned error: %w", err) } if !res { - return ErrInvalidSignature + return fmt.Errorf("signature is invalid") } // if ourselves -> we need to decrypt the read keys @@ -267,7 +214,7 @@ func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error { } // adding user to the list - userState := &aclpb.ACLChangeUserState{ + userState := &aclpb.ACLChange_UserState{ Identity: ch.Identity, EncryptionKey: ch.EncryptionKey, EncryptedReadKeys: ch.EncryptedReadKeys, @@ -278,12 +225,12 @@ func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error { return nil } -func (st *ACLState) applyUserAdd(ch *aclpb.ACLChangeUserAdd) error { +func (st *ACLState) applyUserAdd(ch *aclpb.ACLChange_UserAdd) error { if _, exists := st.userStates[ch.Identity]; exists { return ErrUserAlreadyExists } - st.userStates[ch.Identity] = &aclpb.ACLChangeUserState{ + st.userStates[ch.Identity] = &aclpb.ACLChange_UserState{ Identity: ch.Identity, EncryptionKey: ch.EncryptionKey, Permissions: ch.Permissions, @@ -304,7 +251,7 @@ func (st *ACLState) applyUserAdd(ch *aclpb.ACLChangeUserAdd) error { return nil } -func (st *ACLState) applyUserRemove(ch *aclpb.ACLChangeUserRemove) error { +func (st *ACLState) applyUserRemove(ch *aclpb.ACLChange_UserRemove) error { if ch.Identity == st.identity { return ErrDocumentForbidden } @@ -336,7 +283,7 @@ func (st *ACLState) applyUserRemove(ch *aclpb.ACLChangeUserRemove) error { return nil } -func (st *ACLState) applyUserConfirm(ch *aclpb.ACLChangeUserConfirm) error { +func (st *ACLState) applyUserConfirm(ch *aclpb.ACLChange_UserConfirm) error { if _, exists := st.userStates[ch.Identity]; !exists { return ErrNoSuchUser } @@ -362,7 +309,7 @@ func (st *ACLState) decryptReadKeyAndHash(msg []byte) (*symmetric.Key, uint64, e return key, hasher.Sum64(), nil } -func (st *ACLState) hasPermission(identity string, permission aclpb.ACLChangeUserPermissions) bool { +func (st *ACLState) hasPermission(identity string, permission aclpb.ACLChange_UserPermissions) bool { state, exists := st.userStates[identity] if !exists { return false @@ -371,17 +318,94 @@ func (st *ACLState) hasPermission(identity string, permission aclpb.ACLChangeUse return state.Permissions == permission } -func (st *ACLState) isUserJoin(data *aclpb.ACLChangeACLData) bool { +func (st *ACLState) isUserJoin(ch *aclpb.ACLChange) bool { // if we have a UserJoin, then it should always be the first one applied - return data.GetAclContent() != nil && data.GetAclContent()[0].GetUserJoin() != nil + return ch.AclData.GetAclContent() != nil && ch.AclData.GetAclContent()[0].GetUserJoin() != nil } -func (st *ACLState) isUserAdd(data *aclpb.ACLChangeACLData, identity string) bool { +func (st *ACLState) isUserAdd(ch *aclpb.ACLChange) bool { // if we have a UserAdd, then it should always be the first one applied - userAdd := data.GetAclContent()[0].GetUserAdd() - return data.GetAclContent() != nil && userAdd != nil && userAdd.GetIdentity() == identity + userAdd := ch.AclData.GetAclContent()[0].GetUserAdd() + return ch.AclData.GetAclContent() != nil && userAdd != nil && userAdd.GetIdentity() == ch.Identity } -func (st *ACLState) GetUserStates() map[string]*aclpb.ACLChangeUserState { +func (st *ACLState) getPermissionDecreasedUsers(ch *aclpb.ACLChange) (identities []*aclpb.ACLChange_UserPermissionChange) { + // this should be called after general checks are completed + if ch.GetAclData().GetAclContent() == nil { + return nil + } + + contents := ch.GetAclData().GetAclContent() + for _, c := range contents { + if c.GetUserPermissionChange() != nil { + content := c.GetUserPermissionChange() + + currentState := st.userStates[content.Identity] + // the comparison works in different direction :-) + if content.Permissions > currentState.Permissions { + identities = append(identities, &aclpb.ACLChange_UserPermissionChange{ + Identity: content.Identity, + Permissions: content.Permissions, + }) + } + } + if c.GetUserRemove() != nil { + content := c.GetUserRemove() + identities = append(identities, &aclpb.ACLChange_UserPermissionChange{ + Identity: content.Identity, + Permissions: aclpb.ACLChange_Removed, + }) + } + } + + return identities +} + +func (st *ACLState) equal(other *ACLState) bool { + if st == nil && other == nil { + return true + } + + if st == nil || other == nil { + return false + } + + if st.currentReadKeyHash != other.currentReadKeyHash { + return false + } + + if st.identity != other.identity { + return false + } + + if len(st.userStates) != len(other.userStates) { + return false + } + + for _, st := range st.userStates { + otherSt, exists := other.userStates[st.Identity] + if !exists { + return false + } + + if st.Permissions != otherSt.Permissions { + return false + } + + if bytes.Compare(st.EncryptionKey, otherSt.EncryptionKey) != 0 { + return false + } + } + + if len(st.userInvites) != len(other.userInvites) { + return false + } + + // TODO: add detailed user invites comparison + compare other stuff + return true +} + +func (st *ACLState) GetUserStates() map[string]*aclpb.ACLChange_UserState { + // TODO: we should provide better API that would not allow to change this map from the outside return st.userStates } diff --git a/pkg/acl/list/changebuilder.go b/pkg/acl/list/changebuilder.go index f5d2fa17..5bfb145f 100644 --- a/pkg/acl/list/changebuilder.go +++ b/pkg/acl/list/changebuilder.go @@ -1,4 +1,4 @@ -package list +package acltree import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/account" @@ -14,31 +14,39 @@ import ( type MarshalledChange = []byte type ACLChangeBuilder interface { - UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChangeUserPermissions) error - AddId(id string) // TODO: this is only for testing + UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChange_UserPermissions) error + AddId(id string) // TODO: this is only for testing + SetMakeSnapshot(bool) // TODO: who should decide this? probably ACLTree so we can delete it } -type aclChangeBuilder struct { +type ChangeBuilder interface { + ACLChangeBuilder + AddChangeContent(marshaler proto.Marshaler) // user code should be responsible for making regular snapshots +} + +type changeBuilder struct { aclState *ACLState - list ACLList + tree *Tree acc *account.AccountData - aclData *aclpb.ACLChangeACLData - id string - readKey *symmetric.Key - readKeyHash uint64 + aclData *aclpb.ACLChange_ACLData + changeContent proto.Marshaler + id string + makeSnapshot bool + readKey *symmetric.Key + readKeyHash uint64 } -func newACLChangeBuilder() *aclChangeBuilder { - return &aclChangeBuilder{} +func newChangeBuilder() *changeBuilder { + return &changeBuilder{} } -func (c *aclChangeBuilder) Init(state *ACLState, list ACLList, acc *account.AccountData) { +func (c *changeBuilder) Init(state *ACLState, tree *Tree, acc *account.AccountData) { c.aclState = state - c.list = list + c.tree = tree c.acc = acc - c.aclData = &aclpb.ACLChangeACLData{} + c.aclData = &aclpb.ACLChange_ACLData{} // setting read key for further encryption etc if state.currentReadKeyHash == 0 { c.readKey, _ = symmetric.NewRandom() @@ -52,11 +60,15 @@ func (c *aclChangeBuilder) Init(state *ACLState, list ACLList, acc *account.Acco } } -func (c *aclChangeBuilder) AddId(id string) { +func (c *changeBuilder) AddId(id string) { c.id = id } -func (c *aclChangeBuilder) UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChangeUserPermissions) error { +func (c *changeBuilder) SetMakeSnapshot(b bool) { + c.makeSnapshot = b +} + +func (c *changeBuilder) UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChange_UserPermissions) error { var allKeys []*symmetric.Key if c.aclState.currentReadKeyHash != 0 { for _, key := range c.aclState.userReadKeys { @@ -79,9 +91,9 @@ func (c *aclChangeBuilder) UserAdd(identity string, encryptionKey encryptionkey. if err != nil { return err } - ch := &aclpb.ACLChangeACLContentValue{ - Value: &aclpb.ACLChangeACLContentValueValueOfUserAdd{ - UserAdd: &aclpb.ACLChangeUserAdd{ + ch := &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContent_Value_UserAdd{ + UserAdd: &aclpb.ACLChange_UserAdd{ Identity: identity, EncryptionKey: rawKey, EncryptedReadKeys: encryptedKeys, @@ -93,25 +105,41 @@ func (c *aclChangeBuilder) UserAdd(identity string, encryptionKey encryptionkey. return nil } -func (c *aclChangeBuilder) BuildAndApply() (*Record, []byte, error) { - aclRecord := &aclpb.Record{ - PrevId: c.list.Head().Id, +func (c *changeBuilder) BuildAndApply() (*Change, []byte, error) { + aclChange := &aclpb.ACLChange{ + TreeHeadIds: c.tree.Heads(), + AclHeadIds: c.tree.ACLHeads(), + SnapshotBaseId: c.tree.RootId(), + AclData: c.aclData, CurrentReadKeyHash: c.readKeyHash, Timestamp: int64(time.Now().Nanosecond()), Identity: c.acc.Identity, } - - marshalledData, err := proto.Marshal(c.aclData) - if err != nil { - return nil, nil, err - } - aclRecord.Data = marshalledData - err = c.aclState.applyRecord(aclRecord) + err := c.aclState.applyChange(aclChange) if err != nil { return nil, nil, err } - fullMarshalledChange, err := proto.Marshal(aclRecord) + if c.makeSnapshot { + c.aclData.AclSnapshot = c.aclState.makeSnapshot() + } + + var marshalled []byte + if c.changeContent != nil { + marshalled, err = c.changeContent.Marshal() + if err != nil { + return nil, nil, err + } + + encrypted, err := c.aclState.userReadKeys[c.aclState.currentReadKeyHash]. + Encrypt(marshalled) + if err != nil { + return nil, nil, err + } + aclChange.ChangesData = encrypted + } + + fullMarshalledChange, err := proto.Marshal(aclChange) if err != nil { return nil, nil, err } @@ -123,9 +151,13 @@ func (c *aclChangeBuilder) BuildAndApply() (*Record, []byte, error) { if err != nil { return nil, nil, err } - ch := NewRecord(id, aclRecord) - ch.Model = c.aclData + ch := NewChange(id, aclChange) + ch.DecryptedDocumentChange = marshalled ch.Sign = signature return ch, fullMarshalledChange, nil } + +func (c *changeBuilder) AddChangeContent(marshaler proto.Marshaler) { + c.changeContent = marshaler +} diff --git a/pkg/acl/testutils/testchanges/proto/test.pb.go b/pkg/acl/testutils/testchanges/proto/test.pb.go index 53be5aba..cfec475b 100644 --- a/pkg/acl/testutils/testchanges/proto/test.pb.go +++ b/pkg/acl/testutils/testchanges/proto/test.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pkg/acl/testutils/testchanges/proto/test.proto +// source: pkg/acl/testutils/testchanges/testchangepb/protos/testdocumentchanges.proto -package testchanges +package testchangepb import ( fmt "fmt" @@ -29,7 +29,7 @@ func (m *PlainTextChange) Reset() { *m = PlainTextChange{} } func (m *PlainTextChange) String() string { return proto.CompactTextString(m) } func (*PlainTextChange) ProtoMessage() {} func (*PlainTextChange) Descriptor() ([]byte, []int) { - return fileDescriptor_37f33c266ada4318, []int{0} + return fileDescriptor_c07268f9f08f2beb, []int{0} } func (m *PlainTextChange) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -58,24 +58,25 @@ func (m *PlainTextChange) XXX_DiscardUnknown() { var xxx_messageInfo_PlainTextChange proto.InternalMessageInfo -type PlainTextChangeContent struct { +type PlainTextChange_Content struct { // Types that are valid to be assigned to Value: - // *PlainTextChangeContentValueOfTextAppend - Value IsPlainTextChangeContentValue `protobuf_oneof:"value"` + // + // *PlainTextChange_Content_TextAppend + Value isPlainTextChange_Content_Value `protobuf_oneof:"value"` } -func (m *PlainTextChangeContent) Reset() { *m = PlainTextChangeContent{} } -func (m *PlainTextChangeContent) String() string { return proto.CompactTextString(m) } -func (*PlainTextChangeContent) ProtoMessage() {} -func (*PlainTextChangeContent) Descriptor() ([]byte, []int) { - return fileDescriptor_37f33c266ada4318, []int{0, 0} +func (m *PlainTextChange_Content) Reset() { *m = PlainTextChange_Content{} } +func (m *PlainTextChange_Content) String() string { return proto.CompactTextString(m) } +func (*PlainTextChange_Content) ProtoMessage() {} +func (*PlainTextChange_Content) Descriptor() ([]byte, []int) { + return fileDescriptor_c07268f9f08f2beb, []int{0, 0} } -func (m *PlainTextChangeContent) XXX_Unmarshal(b []byte) error { +func (m *PlainTextChange_Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PlainTextChangeContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlainTextChange_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PlainTextChangeContent.Marshal(b, m, deterministic) + return xxx_messageInfo_PlainTextChange_Content.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -85,67 +86,67 @@ func (m *PlainTextChangeContent) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *PlainTextChangeContent) XXX_Merge(src proto.Message) { - xxx_messageInfo_PlainTextChangeContent.Merge(m, src) +func (m *PlainTextChange_Content) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTextChange_Content.Merge(m, src) } -func (m *PlainTextChangeContent) XXX_Size() int { +func (m *PlainTextChange_Content) XXX_Size() int { return m.Size() } -func (m *PlainTextChangeContent) XXX_DiscardUnknown() { - xxx_messageInfo_PlainTextChangeContent.DiscardUnknown(m) +func (m *PlainTextChange_Content) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTextChange_Content.DiscardUnknown(m) } -var xxx_messageInfo_PlainTextChangeContent proto.InternalMessageInfo +var xxx_messageInfo_PlainTextChange_Content proto.InternalMessageInfo -type IsPlainTextChangeContentValue interface { - IsPlainTextChangeContentValue() +type isPlainTextChange_Content_Value interface { + isPlainTextChange_Content_Value() MarshalTo([]byte) (int, error) Size() int } -type PlainTextChangeContentValueOfTextAppend struct { - TextAppend *PlainTextChangeTextAppend `protobuf:"bytes,1,opt,name=textAppend,proto3,oneof" json:"textAppend,omitempty"` +type PlainTextChange_Content_TextAppend struct { + TextAppend *PlainTextChange_TextAppend `protobuf:"bytes,1,opt,name=textAppend,proto3,oneof" json:"textAppend,omitempty"` } -func (*PlainTextChangeContentValueOfTextAppend) IsPlainTextChangeContentValue() {} +func (*PlainTextChange_Content_TextAppend) isPlainTextChange_Content_Value() {} -func (m *PlainTextChangeContent) GetValue() IsPlainTextChangeContentValue { +func (m *PlainTextChange_Content) GetValue() isPlainTextChange_Content_Value { if m != nil { return m.Value } return nil } -func (m *PlainTextChangeContent) GetTextAppend() *PlainTextChangeTextAppend { - if x, ok := m.GetValue().(*PlainTextChangeContentValueOfTextAppend); ok { +func (m *PlainTextChange_Content) GetTextAppend() *PlainTextChange_TextAppend { + if x, ok := m.GetValue().(*PlainTextChange_Content_TextAppend); ok { return x.TextAppend } return nil } // XXX_OneofWrappers is for the internal use of the proto package. -func (*PlainTextChangeContent) XXX_OneofWrappers() []interface{} { +func (*PlainTextChange_Content) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*PlainTextChangeContentValueOfTextAppend)(nil), + (*PlainTextChange_Content_TextAppend)(nil), } } -type PlainTextChangeTextAppend struct { +type PlainTextChange_TextAppend struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` } -func (m *PlainTextChangeTextAppend) Reset() { *m = PlainTextChangeTextAppend{} } -func (m *PlainTextChangeTextAppend) String() string { return proto.CompactTextString(m) } -func (*PlainTextChangeTextAppend) ProtoMessage() {} -func (*PlainTextChangeTextAppend) Descriptor() ([]byte, []int) { - return fileDescriptor_37f33c266ada4318, []int{0, 1} +func (m *PlainTextChange_TextAppend) Reset() { *m = PlainTextChange_TextAppend{} } +func (m *PlainTextChange_TextAppend) String() string { return proto.CompactTextString(m) } +func (*PlainTextChange_TextAppend) ProtoMessage() {} +func (*PlainTextChange_TextAppend) Descriptor() ([]byte, []int) { + return fileDescriptor_c07268f9f08f2beb, []int{0, 1} } -func (m *PlainTextChangeTextAppend) XXX_Unmarshal(b []byte) error { +func (m *PlainTextChange_TextAppend) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PlainTextChangeTextAppend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlainTextChange_TextAppend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PlainTextChangeTextAppend.Marshal(b, m, deterministic) + return xxx_messageInfo_PlainTextChange_TextAppend.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -155,41 +156,41 @@ func (m *PlainTextChangeTextAppend) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *PlainTextChangeTextAppend) XXX_Merge(src proto.Message) { - xxx_messageInfo_PlainTextChangeTextAppend.Merge(m, src) +func (m *PlainTextChange_TextAppend) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTextChange_TextAppend.Merge(m, src) } -func (m *PlainTextChangeTextAppend) XXX_Size() int { +func (m *PlainTextChange_TextAppend) XXX_Size() int { return m.Size() } -func (m *PlainTextChangeTextAppend) XXX_DiscardUnknown() { - xxx_messageInfo_PlainTextChangeTextAppend.DiscardUnknown(m) +func (m *PlainTextChange_TextAppend) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTextChange_TextAppend.DiscardUnknown(m) } -var xxx_messageInfo_PlainTextChangeTextAppend proto.InternalMessageInfo +var xxx_messageInfo_PlainTextChange_TextAppend proto.InternalMessageInfo -func (m *PlainTextChangeTextAppend) GetText() string { +func (m *PlainTextChange_TextAppend) GetText() string { if m != nil { return m.Text } return "" } -type PlainTextChangeSnapshot struct { +type PlainTextChange_Snapshot struct { Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` } -func (m *PlainTextChangeSnapshot) Reset() { *m = PlainTextChangeSnapshot{} } -func (m *PlainTextChangeSnapshot) String() string { return proto.CompactTextString(m) } -func (*PlainTextChangeSnapshot) ProtoMessage() {} -func (*PlainTextChangeSnapshot) Descriptor() ([]byte, []int) { - return fileDescriptor_37f33c266ada4318, []int{0, 2} +func (m *PlainTextChange_Snapshot) Reset() { *m = PlainTextChange_Snapshot{} } +func (m *PlainTextChange_Snapshot) String() string { return proto.CompactTextString(m) } +func (*PlainTextChange_Snapshot) ProtoMessage() {} +func (*PlainTextChange_Snapshot) Descriptor() ([]byte, []int) { + return fileDescriptor_c07268f9f08f2beb, []int{0, 2} } -func (m *PlainTextChangeSnapshot) XXX_Unmarshal(b []byte) error { +func (m *PlainTextChange_Snapshot) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PlainTextChangeSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlainTextChange_Snapshot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PlainTextChangeSnapshot.Marshal(b, m, deterministic) + return xxx_messageInfo_PlainTextChange_Snapshot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -199,42 +200,42 @@ func (m *PlainTextChangeSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *PlainTextChangeSnapshot) XXX_Merge(src proto.Message) { - xxx_messageInfo_PlainTextChangeSnapshot.Merge(m, src) +func (m *PlainTextChange_Snapshot) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTextChange_Snapshot.Merge(m, src) } -func (m *PlainTextChangeSnapshot) XXX_Size() int { +func (m *PlainTextChange_Snapshot) XXX_Size() int { return m.Size() } -func (m *PlainTextChangeSnapshot) XXX_DiscardUnknown() { - xxx_messageInfo_PlainTextChangeSnapshot.DiscardUnknown(m) +func (m *PlainTextChange_Snapshot) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTextChange_Snapshot.DiscardUnknown(m) } -var xxx_messageInfo_PlainTextChangeSnapshot proto.InternalMessageInfo +var xxx_messageInfo_PlainTextChange_Snapshot proto.InternalMessageInfo -func (m *PlainTextChangeSnapshot) GetText() string { +func (m *PlainTextChange_Snapshot) GetText() string { if m != nil { return m.Text } return "" } -type PlainTextChangeData struct { - Content []*PlainTextChangeContent `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` - Snapshot *PlainTextChangeSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` +type PlainTextChange_Data struct { + Content []*PlainTextChange_Content `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"` + Snapshot *PlainTextChange_Snapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` } -func (m *PlainTextChangeData) Reset() { *m = PlainTextChangeData{} } -func (m *PlainTextChangeData) String() string { return proto.CompactTextString(m) } -func (*PlainTextChangeData) ProtoMessage() {} -func (*PlainTextChangeData) Descriptor() ([]byte, []int) { - return fileDescriptor_37f33c266ada4318, []int{0, 3} +func (m *PlainTextChange_Data) Reset() { *m = PlainTextChange_Data{} } +func (m *PlainTextChange_Data) String() string { return proto.CompactTextString(m) } +func (*PlainTextChange_Data) ProtoMessage() {} +func (*PlainTextChange_Data) Descriptor() ([]byte, []int) { + return fileDescriptor_c07268f9f08f2beb, []int{0, 3} } -func (m *PlainTextChangeData) XXX_Unmarshal(b []byte) error { +func (m *PlainTextChange_Data) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PlainTextChangeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlainTextChange_Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PlainTextChangeData.Marshal(b, m, deterministic) + return xxx_messageInfo_PlainTextChange_Data.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -244,26 +245,26 @@ func (m *PlainTextChangeData) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *PlainTextChangeData) XXX_Merge(src proto.Message) { - xxx_messageInfo_PlainTextChangeData.Merge(m, src) +func (m *PlainTextChange_Data) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlainTextChange_Data.Merge(m, src) } -func (m *PlainTextChangeData) XXX_Size() int { +func (m *PlainTextChange_Data) XXX_Size() int { return m.Size() } -func (m *PlainTextChangeData) XXX_DiscardUnknown() { - xxx_messageInfo_PlainTextChangeData.DiscardUnknown(m) +func (m *PlainTextChange_Data) XXX_DiscardUnknown() { + xxx_messageInfo_PlainTextChange_Data.DiscardUnknown(m) } -var xxx_messageInfo_PlainTextChangeData proto.InternalMessageInfo +var xxx_messageInfo_PlainTextChange_Data proto.InternalMessageInfo -func (m *PlainTextChangeData) GetContent() []*PlainTextChangeContent { +func (m *PlainTextChange_Data) GetContent() []*PlainTextChange_Content { if m != nil { return m.Content } return nil } -func (m *PlainTextChangeData) GetSnapshot() *PlainTextChangeSnapshot { +func (m *PlainTextChange_Data) GetSnapshot() *PlainTextChange_Snapshot { if m != nil { return m.Snapshot } @@ -272,35 +273,36 @@ func (m *PlainTextChangeData) GetSnapshot() *PlainTextChangeSnapshot { func init() { proto.RegisterType((*PlainTextChange)(nil), "anytype.PlainTextChange") - proto.RegisterType((*PlainTextChangeContent)(nil), "anytype.PlainTextChange.Content") - proto.RegisterType((*PlainTextChangeTextAppend)(nil), "anytype.PlainTextChange.TextAppend") - proto.RegisterType((*PlainTextChangeSnapshot)(nil), "anytype.PlainTextChange.Snapshot") - proto.RegisterType((*PlainTextChangeData)(nil), "anytype.PlainTextChange.Data") + proto.RegisterType((*PlainTextChange_Content)(nil), "anytype.PlainTextChange.Content") + proto.RegisterType((*PlainTextChange_TextAppend)(nil), "anytype.PlainTextChange.TextAppend") + proto.RegisterType((*PlainTextChange_Snapshot)(nil), "anytype.PlainTextChange.Snapshot") + proto.RegisterType((*PlainTextChange_Data)(nil), "anytype.PlainTextChange.Data") } func init() { - proto.RegisterFile("pkg/acl/testutils/testchanges/proto/test.proto", fileDescriptor_37f33c266ada4318) + proto.RegisterFile("pkg/acl/testutils/testchanges/testchangepb/protos/testdocumentchanges.proto", fileDescriptor_c07268f9f08f2beb) } -var fileDescriptor_37f33c266ada4318 = []byte{ - // 266 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x2b, 0xc8, 0x4e, 0xd7, +var fileDescriptor_c07268f9f08f2beb = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x2e, 0xc8, 0x4e, 0xd7, 0x4f, 0x4c, 0xce, 0xd1, 0x2f, 0x49, 0x2d, 0x2e, 0x29, 0x2d, 0xc9, 0xcc, 0x29, 0x06, 0xb3, 0x92, - 0x33, 0x12, 0xf3, 0xd2, 0x53, 0x8b, 0xf5, 0x0b, 0x8a, 0xf2, 0x4b, 0xf2, 0xc1, 0x22, 0x7a, 0x60, - 0xa6, 0x10, 0x7b, 0x62, 0x5e, 0x65, 0x49, 0x65, 0x41, 0xaa, 0xd2, 0x26, 0x26, 0x2e, 0xfe, 0x80, - 0x9c, 0xc4, 0xcc, 0xbc, 0x90, 0xd4, 0x8a, 0x12, 0x67, 0xb0, 0x72, 0xa9, 0x48, 0x2e, 0x76, 0xe7, - 0xfc, 0xbc, 0x92, 0xd4, 0xbc, 0x12, 0x21, 0x57, 0x2e, 0xae, 0x92, 0xd4, 0x8a, 0x12, 0xc7, 0x82, - 0x82, 0xd4, 0xbc, 0x14, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x65, 0x3d, 0xa8, 0x66, 0x3d, - 0x34, 0x8d, 0x7a, 0x21, 0x70, 0xa5, 0x1e, 0x0c, 0x41, 0x48, 0x1a, 0x9d, 0xd8, 0xb9, 0x58, 0xcb, - 0x12, 0x73, 0x4a, 0x53, 0xa5, 0x14, 0xb8, 0xb8, 0x10, 0x8a, 0x84, 0x84, 0xb8, 0x58, 0x40, 0x8a, - 0xc0, 0xe6, 0x72, 0x06, 0x81, 0xd9, 0x52, 0x72, 0x5c, 0x1c, 0xc1, 0x79, 0x89, 0x05, 0xc5, 0x19, - 0xf9, 0x25, 0x58, 0xe5, 0x1b, 0x19, 0xb9, 0x58, 0x5c, 0x12, 0x4b, 0x12, 0x85, 0xac, 0xb8, 0xd8, - 0x93, 0x21, 0xae, 0x94, 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xc0, 0xe9, 0x2e, 0xa8, 0x6f, - 0x82, 0x60, 0x1a, 0x84, 0x6c, 0xb9, 0x38, 0x8a, 0xa1, 0x96, 0x48, 0x30, 0x81, 0x3d, 0xa5, 0x88, - 0x53, 0x33, 0xcc, 0x35, 0x41, 0x70, 0x2d, 0x4e, 0xaa, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, - 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, - 0x2c, 0xc7, 0x10, 0xc5, 0x8d, 0x14, 0xea, 0x49, 0x6c, 0xe0, 0xb0, 0x36, 0x06, 0x04, 0x00, 0x00, - 0xff, 0xff, 0xf8, 0x8c, 0x6a, 0x1d, 0x9d, 0x01, 0x00, 0x00, + 0x33, 0x12, 0xf3, 0xd2, 0x53, 0x91, 0xd9, 0x05, 0x49, 0xfa, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x10, + 0xb1, 0x94, 0xfc, 0xe4, 0xd2, 0xdc, 0xd4, 0x3c, 0x98, 0x3a, 0x3d, 0xb0, 0x94, 0x10, 0x7b, 0x62, + 0x5e, 0x65, 0x49, 0x65, 0x41, 0xaa, 0xd2, 0x26, 0x26, 0x2e, 0xfe, 0x80, 0x9c, 0xc4, 0xcc, 0xbc, + 0x90, 0xd4, 0x8a, 0x12, 0x67, 0xb0, 0x1a, 0xa9, 0x48, 0x2e, 0x76, 0xe7, 0xfc, 0xbc, 0x92, 0xd4, + 0xbc, 0x12, 0x21, 0x57, 0x2e, 0xae, 0x92, 0xd4, 0x8a, 0x12, 0xc7, 0x82, 0x82, 0xd4, 0xbc, 0x14, + 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x65, 0x3d, 0xa8, 0x66, 0x3d, 0x34, 0x8d, 0x7a, 0x21, + 0x70, 0xa5, 0x1e, 0x0c, 0x41, 0x48, 0x1a, 0x9d, 0xd8, 0xb9, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, + 0xa5, 0x14, 0xb8, 0xb8, 0x10, 0x8a, 0x84, 0x84, 0xb8, 0x58, 0x40, 0x8a, 0xc0, 0xe6, 0x72, 0x06, + 0x81, 0xd9, 0x52, 0x72, 0x5c, 0x1c, 0xc1, 0x79, 0x89, 0x05, 0xc5, 0x19, 0xf9, 0x25, 0x58, 0xe5, + 0x1b, 0x19, 0xb9, 0x58, 0x5c, 0x12, 0x4b, 0x12, 0x85, 0xac, 0xb8, 0xd8, 0x93, 0x21, 0xae, 0x94, + 0x60, 0x54, 0x60, 0xd6, 0xe0, 0x36, 0x52, 0xc0, 0xe9, 0x2e, 0xa8, 0x6f, 0x82, 0x60, 0x1a, 0x84, + 0x6c, 0xb9, 0x38, 0x8a, 0xa1, 0x96, 0x48, 0x30, 0x81, 0x3d, 0xa5, 0x88, 0x53, 0x33, 0xcc, 0x35, + 0x41, 0x70, 0x2d, 0x4e, 0x6a, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, + 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xc5, + 0x83, 0x1c, 0x0d, 0x49, 0x6c, 0xe0, 0xc0, 0x36, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x73, + 0xe1, 0xf2, 0xbb, 0x01, 0x00, 0x00, } func (m *PlainTextChange) Marshal() (dAtA []byte, err error) { @@ -326,7 +328,7 @@ func (m *PlainTextChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *PlainTextChangeContent) Marshal() (dAtA []byte, err error) { +func (m *PlainTextChange_Content) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -336,12 +338,12 @@ func (m *PlainTextChangeContent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PlainTextChangeContent) MarshalTo(dAtA []byte) (int, error) { +func (m *PlainTextChange_Content) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PlainTextChangeContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PlainTextChange_Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -358,12 +360,12 @@ func (m *PlainTextChangeContent) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *PlainTextChangeContentValueOfTextAppend) MarshalTo(dAtA []byte) (int, error) { +func (m *PlainTextChange_Content_TextAppend) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PlainTextChangeContentValueOfTextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PlainTextChange_Content_TextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.TextAppend != nil { { @@ -372,14 +374,14 @@ func (m *PlainTextChangeContentValueOfTextAppend) MarshalToSizedBuffer(dAtA []by return 0, err } i -= size - i = encodeVarintTest(dAtA, i, uint64(size)) + i = encodeVarintTestdocumentchanges(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PlainTextChangeTextAppend) Marshal() (dAtA []byte, err error) { +func (m *PlainTextChange_TextAppend) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -389,12 +391,12 @@ func (m *PlainTextChangeTextAppend) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PlainTextChangeTextAppend) MarshalTo(dAtA []byte) (int, error) { +func (m *PlainTextChange_TextAppend) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PlainTextChangeTextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PlainTextChange_TextAppend) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -402,14 +404,14 @@ func (m *PlainTextChangeTextAppend) MarshalToSizedBuffer(dAtA []byte) (int, erro if len(m.Text) > 0 { i -= len(m.Text) copy(dAtA[i:], m.Text) - i = encodeVarintTest(dAtA, i, uint64(len(m.Text))) + i = encodeVarintTestdocumentchanges(dAtA, i, uint64(len(m.Text))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PlainTextChangeSnapshot) Marshal() (dAtA []byte, err error) { +func (m *PlainTextChange_Snapshot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -419,12 +421,12 @@ func (m *PlainTextChangeSnapshot) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PlainTextChangeSnapshot) MarshalTo(dAtA []byte) (int, error) { +func (m *PlainTextChange_Snapshot) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PlainTextChangeSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PlainTextChange_Snapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -432,14 +434,14 @@ func (m *PlainTextChangeSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) if len(m.Text) > 0 { i -= len(m.Text) copy(dAtA[i:], m.Text) - i = encodeVarintTest(dAtA, i, uint64(len(m.Text))) + i = encodeVarintTestdocumentchanges(dAtA, i, uint64(len(m.Text))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *PlainTextChangeData) Marshal() (dAtA []byte, err error) { +func (m *PlainTextChange_Data) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -449,12 +451,12 @@ func (m *PlainTextChangeData) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PlainTextChangeData) MarshalTo(dAtA []byte) (int, error) { +func (m *PlainTextChange_Data) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PlainTextChangeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *PlainTextChange_Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -466,7 +468,7 @@ func (m *PlainTextChangeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintTest(dAtA, i, uint64(size)) + i = encodeVarintTestdocumentchanges(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 @@ -479,7 +481,7 @@ func (m *PlainTextChangeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarintTest(dAtA, i, uint64(size)) + i = encodeVarintTestdocumentchanges(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa @@ -488,8 +490,8 @@ func (m *PlainTextChangeData) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintTest(dAtA []byte, offset int, v uint64) int { - offset -= sovTest(v) +func encodeVarintTestdocumentchanges(dAtA []byte, offset int, v uint64) int { + offset -= sovTestdocumentchanges(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -508,7 +510,7 @@ func (m *PlainTextChange) Size() (n int) { return n } -func (m *PlainTextChangeContent) Size() (n int) { +func (m *PlainTextChange_Content) Size() (n int) { if m == nil { return 0 } @@ -520,7 +522,7 @@ func (m *PlainTextChangeContent) Size() (n int) { return n } -func (m *PlainTextChangeContentValueOfTextAppend) Size() (n int) { +func (m *PlainTextChange_Content_TextAppend) Size() (n int) { if m == nil { return 0 } @@ -528,11 +530,11 @@ func (m *PlainTextChangeContentValueOfTextAppend) Size() (n int) { _ = l if m.TextAppend != nil { l = m.TextAppend.Size() - n += 1 + l + sovTest(uint64(l)) + n += 1 + l + sovTestdocumentchanges(uint64(l)) } return n } -func (m *PlainTextChangeTextAppend) Size() (n int) { +func (m *PlainTextChange_TextAppend) Size() (n int) { if m == nil { return 0 } @@ -540,12 +542,12 @@ func (m *PlainTextChangeTextAppend) Size() (n int) { _ = l l = len(m.Text) if l > 0 { - n += 1 + l + sovTest(uint64(l)) + n += 1 + l + sovTestdocumentchanges(uint64(l)) } return n } -func (m *PlainTextChangeSnapshot) Size() (n int) { +func (m *PlainTextChange_Snapshot) Size() (n int) { if m == nil { return 0 } @@ -553,12 +555,12 @@ func (m *PlainTextChangeSnapshot) Size() (n int) { _ = l l = len(m.Text) if l > 0 { - n += 1 + l + sovTest(uint64(l)) + n += 1 + l + sovTestdocumentchanges(uint64(l)) } return n } -func (m *PlainTextChangeData) Size() (n int) { +func (m *PlainTextChange_Data) Size() (n int) { if m == nil { return 0 } @@ -567,21 +569,21 @@ func (m *PlainTextChangeData) Size() (n int) { if len(m.Content) > 0 { for _, e := range m.Content { l = e.Size() - n += 1 + l + sovTest(uint64(l)) + n += 1 + l + sovTestdocumentchanges(uint64(l)) } } if m.Snapshot != nil { l = m.Snapshot.Size() - n += 1 + l + sovTest(uint64(l)) + n += 1 + l + sovTestdocumentchanges(uint64(l)) } return n } -func sovTest(x uint64) (n int) { +func sovTestdocumentchanges(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } -func sozTest(x uint64) (n int) { - return sovTest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +func sozTestdocumentchanges(x uint64) (n int) { + return sovTestdocumentchanges(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *PlainTextChange) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -591,7 +593,7 @@ func (m *PlainTextChange) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -614,12 +616,12 @@ func (m *PlainTextChange) Unmarshal(dAtA []byte) error { switch fieldNum { default: iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) + skippy, err := skipTestdocumentchanges(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -633,7 +635,7 @@ func (m *PlainTextChange) Unmarshal(dAtA []byte) error { } return nil } -func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error { +func (m *PlainTextChange_Content) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -641,7 +643,7 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -669,7 +671,7 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -682,29 +684,29 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if postIndex > l { return io.ErrUnexpectedEOF } - v := &PlainTextChangeTextAppend{} + v := &PlainTextChange_TextAppend{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &PlainTextChangeContentValueOfTextAppend{v} + m.Value = &PlainTextChange_Content_TextAppend{v} iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) + skippy, err := skipTestdocumentchanges(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -718,7 +720,7 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error { } return nil } -func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { +func (m *PlainTextChange_TextAppend) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -726,7 +728,7 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -754,7 +756,7 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -768,11 +770,11 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if postIndex > l { return io.ErrUnexpectedEOF @@ -781,12 +783,12 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) + skippy, err := skipTestdocumentchanges(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -800,7 +802,7 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error { } return nil } -func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { +func (m *PlainTextChange_Snapshot) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -808,7 +810,7 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -836,7 +838,7 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -850,11 +852,11 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if postIndex > l { return io.ErrUnexpectedEOF @@ -863,12 +865,12 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) + skippy, err := skipTestdocumentchanges(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -882,7 +884,7 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error { } return nil } -func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { +func (m *PlainTextChange_Data) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -890,7 +892,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -918,7 +920,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -931,16 +933,16 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if postIndex > l { return io.ErrUnexpectedEOF } - m.Content = append(m.Content, &PlainTextChangeContent{}) + m.Content = append(m.Content, &PlainTextChange_Content{}) if err := m.Content[len(m.Content)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -952,7 +954,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowTest + return ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -965,17 +967,17 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if postIndex > l { return io.ErrUnexpectedEOF } if m.Snapshot == nil { - m.Snapshot = &PlainTextChangeSnapshot{} + m.Snapshot = &PlainTextChange_Snapshot{} } if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -983,12 +985,12 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipTest(dAtA[iNdEx:]) + skippy, err := skipTestdocumentchanges(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTest + return ErrInvalidLengthTestdocumentchanges } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1002,7 +1004,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error { } return nil } -func skipTest(dAtA []byte) (n int, err error) { +func skipTestdocumentchanges(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 @@ -1010,7 +1012,7 @@ func skipTest(dAtA []byte) (n int, err error) { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowTest + return 0, ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1027,7 +1029,7 @@ func skipTest(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowTest + return 0, ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1043,7 +1045,7 @@ func skipTest(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowTest + return 0, ErrIntOverflowTestdocumentchanges } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1056,14 +1058,14 @@ func skipTest(dAtA []byte) (n int, err error) { } } if length < 0 { - return 0, ErrInvalidLengthTest + return 0, ErrInvalidLengthTestdocumentchanges } iNdEx += length case 3: depth++ case 4: if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTest + return 0, ErrUnexpectedEndOfGroupTestdocumentchanges } depth-- case 5: @@ -1072,7 +1074,7 @@ func skipTest(dAtA []byte) (n int, err error) { return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { - return 0, ErrInvalidLengthTest + return 0, ErrInvalidLengthTestdocumentchanges } if depth == 0 { return iNdEx, nil @@ -1082,7 +1084,7 @@ func skipTest(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthTest = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTest = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTest = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthTestdocumentchanges = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTestdocumentchanges = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTestdocumentchanges = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go b/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go new file mode 100644 index 00000000..3b7c6f7d --- /dev/null +++ b/pkg/acl/testutils/treestoragebuilder/treestoragebuilder.go @@ -0,0 +1,539 @@ +package treestoragebuilder + +import ( + "context" + "fmt" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" + testpb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/testchangepb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/yamltests" + storagepb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/encryptionkey" + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/keys/asymmetric/signingkey" + "github.com/anytypeio/go-anytype-infrastructure-experiments/util/slice" + "io/ioutil" + "path" + + "github.com/gogo/protobuf/proto" + "gopkg.in/yaml.v3" +) + +const plainTextDocType uint16 = 1 + +type treeChange struct { + *aclpb.ACLChange + id string + readKey *SymKey + signKey signingkey.PrivKey + + changesDataDecrypted []byte +} + +type updateUseCase struct { + changes map[string]*treeChange +} + +type TreeStorageBuilder struct { + treeId string + allChanges map[string]*treeChange + updates map[string]*updateUseCase + heads []string + orphans []string + keychain *Keychain + header *storagepb.TreeHeader +} + +func NewTreeStorageBuilder(keychain *Keychain) *TreeStorageBuilder { + return &TreeStorageBuilder{ + allChanges: make(map[string]*treeChange), + updates: make(map[string]*updateUseCase), + keychain: keychain, + } +} + +func NewTreeStorageBuilderWithTestName(name string) (*TreeStorageBuilder, error) { + filePath := path.Join(yamltests.Path(), name) + return NewTreeStorageBuilderFromFile(filePath) +} + +func NewTreeStorageBuilderFromFile(file string) (*TreeStorageBuilder, error) { + content, err := ioutil.ReadFile(file) + if err != nil { + return nil, err + } + + ymlTree := YMLTree{} + err = yaml.Unmarshal(content, &ymlTree) + if err != nil { + return nil, err + } + + tb := NewTreeStorageBuilder(NewKeychain()) + tb.Parse(&ymlTree) + + return tb, nil +} + +func (t *TreeStorageBuilder) TreeID() (string, error) { + return t.treeId, nil +} + +func (t *TreeStorageBuilder) GetKeychain() *Keychain { + return t.keychain +} + +func (t *TreeStorageBuilder) Heads() ([]string, error) { + return t.heads, nil +} + +func (t *TreeStorageBuilder) AddRawChange(change *aclpb.RawChange) error { + aclChange := new(aclpb.ACLChange) + var err error + + if err = proto.Unmarshal(change.Payload, aclChange); err != nil { + return fmt.Errorf("could not unmarshall changes") + } + var changesData []byte + + // get correct readkey + readKey := t.keychain.ReadKeysByHash[aclChange.CurrentReadKeyHash] + if aclChange.ChangesData != nil { + changesData, err = readKey.Key.Decrypt(aclChange.ChangesData) + if err != nil { + return fmt.Errorf("failed to decrypt changes data: %w", err) + } + } + + // get correct signing key + signKey := t.keychain.SigningKeysByIdentity[aclChange.Identity] + + t.allChanges[change.Id] = &treeChange{ + ACLChange: aclChange, + id: change.Id, + readKey: readKey, + signKey: signKey, + changesDataDecrypted: changesData, + } + return nil +} + +func (t *TreeStorageBuilder) AddOrphans(orphans ...string) error { + t.orphans = append(t.orphans, orphans...) + return nil +} + +func (t *TreeStorageBuilder) AddChange(change aclchanges.Change) error { + aclChange := change.ProtoChange() + var err error + var changesData []byte + + // get correct readkey + readKey := t.keychain.ReadKeysByHash[aclChange.CurrentReadKeyHash] + if aclChange.ChangesData != nil { + changesData, err = readKey.Key.Decrypt(aclChange.ChangesData) + if err != nil { + return fmt.Errorf("failed to decrypt changes data: %w", err) + } + } + + // get correct signing key + signKey := t.keychain.SigningKeysByIdentity[aclChange.Identity] + + t.allChanges[change.CID()] = &treeChange{ + ACLChange: aclChange, + id: change.CID(), + readKey: readKey, + signKey: signKey, + changesDataDecrypted: changesData, + } + return nil +} + +func (t *TreeStorageBuilder) Orphans() ([]string, error) { + return t.orphans, nil +} + +func (t *TreeStorageBuilder) SetHeads(heads []string) error { + // we should copy here instead of just setting the value + t.heads = heads + return nil +} + +func (t *TreeStorageBuilder) RemoveOrphans(orphans ...string) error { + t.orphans = slice.Difference(t.orphans, orphans) + return nil +} + +func (t *TreeStorageBuilder) GetChange(ctx context.Context, recordID string) (*aclpb.RawChange, error) { + return t.getChange(recordID, t.allChanges), nil +} + +func (t *TreeStorageBuilder) GetUpdates(useCase string) []*aclpb.RawChange { + var res []*aclpb.RawChange + update := t.updates[useCase] + for _, ch := range update.changes { + rawCh := t.getChange(ch.id, update.changes) + res = append(res, rawCh) + } + return res +} + +func (t *TreeStorageBuilder) Header() (*storagepb.TreeHeader, error) { + return t.header, nil +} + +func (t *TreeStorageBuilder) getChange(changeId string, m map[string]*treeChange) *aclpb.RawChange { + rec := m[changeId] + + if rec.changesDataDecrypted != nil { + encrypted, err := rec.readKey.Key.Encrypt(rec.changesDataDecrypted) + if err != nil { + panic("should be able to encrypt data with read key!") + } + + rec.ChangesData = encrypted + } + + aclMarshaled, err := proto.Marshal(rec.ACLChange) + if err != nil { + panic("should be able to marshal final acl message!") + } + + signature, err := rec.signKey.Sign(aclMarshaled) + if err != nil { + panic("should be able to sign final acl message!") + } + + transformedRec := &aclpb.RawChange{ + Payload: aclMarshaled, + Signature: signature, + Id: changeId, + } + return transformedRec +} + +func (t *TreeStorageBuilder) Parse(tree *YMLTree) { + // Just to clarify - we are generating new identities for the ones that + // are specified in the yml file, because our identities should be Ed25519 + // the same thing is happening for the encryption keys + t.keychain.ParseKeys(&tree.Keys) + t.treeId = t.parseTreeId(tree.Description) + for _, ch := range tree.Changes { + newChange := t.parseChange(ch) + t.allChanges[newChange.id] = newChange + } + + t.parseGraph(tree) + t.parseOrphans(tree) + t.parseHeader(tree) + t.parseUpdates(tree.Updates) +} + +func (t *TreeStorageBuilder) parseChange(ch *Change) *treeChange { + newChange := &treeChange{ + id: ch.Id, + } + k := t.keychain.GetKey(ch.ReadKey).(*SymKey) + newChange.readKey = k + newChange.signKey = t.keychain.SigningKeys[ch.Identity] + aclChange := &aclpb.ACLChange{} + aclChange.Identity = t.keychain.GetIdentity(ch.Identity) + if len(ch.AclChanges) > 0 || ch.AclSnapshot != nil { + aclChange.AclData = &aclpb.ACLChange_ACLData{} + if ch.AclSnapshot != nil { + aclChange.AclData.AclSnapshot = t.parseACLSnapshot(ch.AclSnapshot) + } + if ch.AclChanges != nil { + var aclChangeContents []*aclpb.ACLChange_ACLContentValue + for _, ch := range ch.AclChanges { + aclChangeContent := t.parseACLChange(ch) + aclChangeContents = append(aclChangeContents, aclChangeContent) + } + aclChange.AclData.AclContent = aclChangeContents + } + } + if len(ch.Changes) > 0 || ch.Snapshot != nil { + changesData := &testpb.PlainTextChange_Data{} + if ch.Snapshot != nil { + changesData.Snapshot = t.parseChangeSnapshot(ch.Snapshot) + } + if len(ch.Changes) > 0 { + var changeContents []*testpb.PlainTextChange_Content + for _, ch := range ch.Changes { + aclChangeContent := t.parseDocumentChange(ch) + changeContents = append(changeContents, aclChangeContent) + } + changesData.Content = changeContents + } + m, err := proto.Marshal(changesData) + if err != nil { + return nil + } + newChange.changesDataDecrypted = m + } + aclChange.CurrentReadKeyHash = k.Hash + newChange.ACLChange = aclChange + return newChange +} + +func (t *TreeStorageBuilder) parseTreeId(description *TreeDescription) string { + if description == nil { + panic("no author in tree") + } + return description.Author + ".tree.id" +} + +func (t *TreeStorageBuilder) parseChangeSnapshot(s *PlainTextSnapshot) *testpb.PlainTextChange_Snapshot { + return &testpb.PlainTextChange_Snapshot{ + Text: s.Text, + } +} + +func (t *TreeStorageBuilder) parseACLSnapshot(s *ACLSnapshot) *aclpb.ACLChange_ACLSnapshot { + newState := &aclpb.ACLChange_ACLState{} + for _, state := range s.UserStates { + aclUserState := &aclpb.ACLChange_UserState{} + aclUserState.Identity = t.keychain.GetIdentity(state.Identity) + + encKey := t.keychain. + GetKey(state.EncryptionKey).(encryptionkey.PrivKey) + rawKey, _ := encKey.GetPublic().Raw() + aclUserState.EncryptionKey = rawKey + + aclUserState.EncryptedReadKeys = t.encryptReadKeys(state.EncryptedReadKeys, encKey) + aclUserState.Permissions = t.convertPermission(state.Permissions) + newState.UserStates = append(newState.UserStates, aclUserState) + } + return &aclpb.ACLChange_ACLSnapshot{ + AclState: newState, + } +} + +func (t *TreeStorageBuilder) parseDocumentChange(ch *PlainTextChange) (convCh *testpb.PlainTextChange_Content) { + switch { + case ch.TextAppend != nil: + convCh = &testpb.PlainTextChange_Content{ + Value: &testpb.PlainTextChange_Content_TextAppend{ + TextAppend: &testpb.PlainTextChange_TextAppend{ + Text: ch.TextAppend.Text, + }, + }, + } + } + if convCh == nil { + panic("cannot have empty document change") + } + + return convCh +} + +func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLChange_ACLContentValue) { + switch { + case ch.UserAdd != nil: + add := ch.UserAdd + + encKey := t.keychain. + GetKey(add.EncryptionKey).(encryptionkey.PrivKey) + rawKey, _ := encKey.GetPublic().Raw() + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContent_Value_UserAdd{ + UserAdd: &aclpb.ACLChange_UserAdd{ + Identity: t.keychain.GetIdentity(add.Identity), + EncryptionKey: rawKey, + EncryptedReadKeys: t.encryptReadKeys(add.EncryptedReadKeys, encKey), + Permissions: t.convertPermission(add.Permission), + }, + }, + } + case ch.UserJoin != nil: + join := ch.UserJoin + + encKey := t.keychain. + GetKey(join.EncryptionKey).(encryptionkey.PrivKey) + rawKey, _ := encKey.GetPublic().Raw() + + idKey, _ := t.keychain.SigningKeys[join.Identity].GetPublic().Raw() + signKey := t.keychain.GetKey(join.AcceptSignature).(signingkey.PrivKey) + signature, err := signKey.Sign(idKey) + if err != nil { + panic(err) + } + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContentValueValueOfUserJoin{ + UserJoin: &aclpb.ACLChange_UserJoin{ + Identity: t.keychain.GetIdentity(join.Identity), + EncryptionKey: rawKey, + AcceptSignature: signature, + UserInviteId: join.InviteId, + EncryptedReadKeys: t.encryptReadKeys(join.EncryptedReadKeys, encKey), + }, + }, + } + case ch.UserInvite != nil: + invite := ch.UserInvite + rawAcceptKey, _ := t.keychain.GetKey(invite.AcceptKey).(signingkey.PrivKey).GetPublic().Raw() + encKey := t.keychain. + GetKey(invite.EncryptionKey).(encryptionkey.PrivKey) + rawEncKey, _ := encKey.GetPublic().Raw() + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContentValueValueOfUserInvite{ + UserInvite: &aclpb.ACLChange_UserInvite{ + AcceptPublicKey: rawAcceptKey, + EncryptPublicKey: rawEncKey, + EncryptedReadKeys: t.encryptReadKeys(invite.EncryptedReadKeys, encKey), + Permissions: t.convertPermission(invite.Permissions), + InviteId: invite.InviteId, + }, + }, + } + case ch.UserConfirm != nil: + confirm := ch.UserConfirm + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContentValueValueOfUserConfirm{ + UserConfirm: &aclpb.ACLChange_UserConfirm{ + Identity: t.keychain.GetIdentity(confirm.Identity), + UserAddId: confirm.UserAddId, + }, + }, + } + case ch.UserPermissionChange != nil: + permissionChange := ch.UserPermissionChange + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContentValueValueOfUserPermissionChange{ + UserPermissionChange: &aclpb.ACLChange_UserPermissionChange{ + Identity: t.keychain.GetIdentity(permissionChange.Identity), + Permissions: t.convertPermission(permissionChange.Permission), + }, + }, + } + case ch.UserRemove != nil: + remove := ch.UserRemove + + newReadKey := t.keychain.GetKey(remove.NewReadKey).(*SymKey) + + var replaces []*aclpb.ACLChangeReadKeyReplace + for _, id := range remove.IdentitiesLeft { + identity := t.keychain.GetIdentity(id) + encKey := t.keychain.EncryptionKeys[id] + rawEncKey, _ := encKey.GetPublic().Raw() + encReadKey, err := encKey.GetPublic().Encrypt(newReadKey.Key.Bytes()) + if err != nil { + panic(err) + } + replaces = append(replaces, &aclpb.ACLChangeReadKeyReplace{ + Identity: identity, + EncryptionKey: rawEncKey, + EncryptedReadKey: encReadKey, + }) + } + + convCh = &aclpb.ACLChange_ACLContentValue{ + Value: &aclpb.ACLChange_ACLContentValueValueOfUserRemove{ + UserRemove: &aclpb.ACLChange_UserRemove{ + Identity: t.keychain.GetIdentity(remove.RemovedIdentity), + ReadKeyReplaces: replaces, + }, + }, + } + } + if convCh == nil { + panic("cannot have empty acl change") + } + + return convCh +} + +func (t *TreeStorageBuilder) encryptReadKeys(keys []string, encKey encryptionkey.PrivKey) (enc [][]byte) { + for _, k := range keys { + realKey := t.keychain.GetKey(k).(*SymKey).Key.Bytes() + res, err := encKey.GetPublic().Encrypt(realKey) + if err != nil { + panic(err) + } + + enc = append(enc, res) + } + return +} + +func (t *TreeStorageBuilder) convertPermission(perm string) aclpb.ACLChange_UserPermissions { + switch perm { + case "admin": + return aclpb.ACLChange_Admin + case "writer": + return aclpb.ACLChange_Writer + case "reader": + return aclpb.ACLChange_Reader + default: + panic(fmt.Sprintf("incorrect permission: %s", perm)) + } +} + +func (t *TreeStorageBuilder) traverseFromHeads(f func(t *treeChange) error) error { + uniqMap := map[string]struct{}{} + stack := make([]string, len(t.orphans), 10) + copy(stack, t.orphans) + for len(stack) > 0 { + id := stack[len(stack)-1] + stack = stack[:len(stack)-1] + if _, exists := uniqMap[id]; exists { + continue + } + + ch := t.allChanges[id] + uniqMap[id] = struct{}{} + if err := f(ch); err != nil { + return err + } + + for _, prev := range ch.ACLChange.TreeHeadIds { + stack = append(stack, prev) + } + } + return nil +} + +func (t *TreeStorageBuilder) parseUpdates(updates []*Update) { + for _, update := range updates { + useCase := &updateUseCase{ + changes: map[string]*treeChange{}, + } + for _, ch := range update.Changes { + newChange := t.parseChange(ch) + useCase.changes[newChange.id] = newChange + } + for _, node := range update.Graph { + rec := useCase.changes[node.Id] + rec.AclHeadIds = node.ACLHeads + rec.TreeHeadIds = node.TreeHeads + rec.SnapshotBaseId = node.BaseSnapshot + } + + t.updates[update.UseCase] = useCase + } +} + +func (t *TreeStorageBuilder) parseGraph(tree *YMLTree) { + for _, node := range tree.Graph { + rec := t.allChanges[node.Id] + rec.AclHeadIds = node.ACLHeads + rec.TreeHeadIds = node.TreeHeads + rec.SnapshotBaseId = node.BaseSnapshot + } +} + +func (t *TreeStorageBuilder) parseOrphans(tree *YMLTree) { + t.orphans = tree.Orphans +} + +func (t *TreeStorageBuilder) parseHeader(tree *YMLTree) { + t.header = &storagepb.TreeHeader{ + FirstChangeId: tree.Header.FirstChangeId, + IsWorkspace: tree.Header.IsWorkspace, + } +} diff --git a/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go b/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go new file mode 100644 index 00000000..9d973a24 --- /dev/null +++ b/pkg/acl/testutils/treestoragebuilder/treestoragebuildergraph_nix.go @@ -0,0 +1,162 @@ +//go:build (linux || darwin) && !android && !ios && !nographviz && (amd64 || arm64) +// +build linux darwin +// +build !android +// +build !ios +// +build !nographviz +// +build amd64 arm64 + +package treestoragebuilder + +import ( + "fmt" + testpb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/testchangepb" + + "github.com/gogo/protobuf/proto" + "strings" + "unicode" + + "github.com/awalterschulze/gographviz" +) + +// To quickly look at visualized string you can use https://dreampuf.github.io/GraphvizOnline + +type EdgeParameters struct { + style string + color string + label string +} + +func (t *TreeStorageBuilder) Graph() (string, error) { + // TODO: check updates on https://github.com/goccy/go-graphviz/issues/52 or make a fix yourself to use better library here + graph := gographviz.NewGraph() + graph.SetName("G") + graph.SetDir(true) + var nodes = make(map[string]struct{}) + + var addNodes = func(r *treeChange) error { + // TODO: revisit function after checking + + style := "solid" + if r.GetAclData() != nil { + style = "filled" + } else if r.changesDataDecrypted != nil { + style = "dashed" + } + + var chSymbs []string + if r.changesDataDecrypted != nil { + res := &testpb.PlainTextChange_Data{} + err := proto.Unmarshal(r.changesDataDecrypted, res) + if err != nil { + return err + } + + for _, chc := range res.Content { + tp := fmt.Sprintf("%T", chc.Value) + tp = strings.Replace(tp, "ChangeContent_Value_", "", 1) + res := "" + for _, ts := range tp { + if unicode.IsUpper(ts) { + res += string(ts) + } + } + chSymbs = append(chSymbs, res) + } + } + if r.GetAclData() != nil { + for _, chc := range r.GetAclData().AclContent { + tp := fmt.Sprintf("%T", chc.Value) + tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1) + res := "" + for _, ts := range tp { + if unicode.IsUpper(ts) { + res += string(ts) + } + } + chSymbs = append(chSymbs, res) + } + } + + shortId := r.id + label := fmt.Sprintf("Id: %s\nChanges: %s\n", + shortId, + strings.Join(chSymbs, ","), + ) + e := graph.AddNode("G", "\""+r.id+"\"", map[string]string{ + "label": "\"" + label + "\"", + "style": "\"" + style + "\"", + }) + if e != nil { + return e + } + nodes[r.id] = struct{}{} + return nil + } + + var createEdge = func(firstId, secondId string, params EdgeParameters) error { + _, exists := nodes[firstId] + if !exists { + return fmt.Errorf("no such node") + } + _, exists = nodes[secondId] + if !exists { + return fmt.Errorf("no previous node") + } + + err := graph.AddEdge("\""+firstId+"\"", "\""+secondId+"\"", true, map[string]string{ + "color": params.color, + "style": params.style, + }) + if err != nil { + return err + } + + return nil + } + + var addLinks = func(t *treeChange) error { + for _, prevId := range t.AclHeadIds { + err := createEdge(t.id, prevId, EdgeParameters{ + style: "dashed", + color: "red", + }) + if err != nil { + return err + } + } + + for _, prevId := range t.TreeHeadIds { + err := createEdge(t.id, prevId, EdgeParameters{ + style: "dashed", + color: "blue", + }) + if err != nil { + return err + } + } + + if t.SnapshotBaseId != "" { + err := createEdge(t.id, t.SnapshotBaseId, EdgeParameters{ + style: "bold", + color: "blue", + }) + if err != nil { + return err + } + } + + return nil + } + + err := t.traverseFromHeads(addNodes) + if err != nil { + return "", err + } + + err = t.traverseFromHeads(addLinks) + if err != nil { + return "", err + } + + return graph.String(), nil +} diff --git a/pkg/acl/tree/treegraph_nix.go b/pkg/acl/tree/treegraph_nix.go index c506c9b3..72dc0c7d 100644 --- a/pkg/acl/tree/treegraph_nix.go +++ b/pkg/acl/tree/treegraph_nix.go @@ -5,18 +5,20 @@ // +build !nographviz // +build amd64 arm64 -package tree +package acltree import ( "bytes" "fmt" - "github.com/goccy/go-graphviz" - "github.com/goccy/go-graphviz/cgraph" "strings" "time" + "unicode" + + "github.com/goccy/go-graphviz" + "github.com/goccy/go-graphviz/cgraph" ) -func (t *Tree) Graph(parser DescriptionParser) (data string, err error) { +func (t *Tree) Graph() (data string, err error) { var order = make(map[string]string) var seq = 0 t.Iterate(t.RootId(), func(c *Change) (isContinue bool) { @@ -44,15 +46,44 @@ func (t *Tree) Graph(parser DescriptionParser) (data string, err error) { if e != nil { return e } - n.SetStyle(cgraph.FilledNodeStyle) + if c.Content.GetAclData() != nil { + n.SetStyle(cgraph.FilledNodeStyle) + } else if c.IsSnapshot { + n.SetStyle(cgraph.DashedNodeStyle) + } nodes[c.Id] = n ord := order[c.Id] if ord == "" { ord = "miss" } - chSymbs, err := parser.ParseChange(c) - if err != nil { - return err + var chSymbs []string + if c.Content.AclData != nil { + for _, chc := range c.Content.AclData.AclContent { + tp := fmt.Sprintf("%T", chc.Value) + tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1) + res := "" + for _, ts := range tp { + if unicode.IsUpper(ts) { + res += string(ts) + } + } + chSymbs = append(chSymbs, res) + } + } + if c.DecryptedDocumentChange != nil { + // TODO: add some parser to provide custom unmarshalling for the document change + //for _, chc := range c.DecryptedDocumentChange.Content { + // tp := fmt.Sprintf("%T", chc.Value) + // tp = strings.Replace(tp, "ChangeContent_Value_", "", 1) + // res := "" + // for _, ts := range tp { + // if unicode.IsUpper(ts) { + // res += string(ts) + // } + // } + // chSymbs = append(chSymbs, res) + //} + chSymbs = append(chSymbs, "DEC") } shortId := c.Id diff --git a/service/document/service.go b/service/document/service.go index 2ae8e239..03799c09 100644 --- a/service/document/service.go +++ b/service/document/service.go @@ -2,16 +2,14 @@ package document import ( "context" - "fmt" "github.com/anytypeio/go-anytype-infrastructure-experiments/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/list" - testchanges "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/proto" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/tree" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/acltree" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/testutils/testchanges/testchangepb" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/account" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/node" - "github.com/anytypeio/go-anytype-infrastructure-experiments/service/storage" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/sync/message" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/treecache" "github.com/anytypeio/go-anytype-infrastructure-experiments/syncproto" @@ -27,14 +25,13 @@ type service struct { messageService message.Service treeCache treecache.Service account account.Service - storage storage.Service // to create new documents we need to know all nodes nodes []*node.Node } type Service interface { - UpdateDocumentTree(ctx context.Context, id, text string) error - CreateDocumentTree(ctx context.Context, aclTreeId string, text string) (id string, err error) + UpdateDocument(ctx context.Context, id, text string) error + CreateDocument(ctx context.Context, text string) (string, error) } func New() app.Component { @@ -45,7 +42,6 @@ func (s *service) Init(ctx context.Context, a *app.App) (err error) { s.account = a.MustComponent(account.CName).(account.Service) s.messageService = a.MustComponent(message.CName).(message.Service) s.treeCache = a.MustComponent(treecache.CName).(treecache.Service) - s.storage = a.MustComponent(storage.CName).(storage.Service) nodesService := a.MustComponent(node.CName).(node.Service) s.nodes = nodesService.Nodes() @@ -58,65 +54,41 @@ func (s *service) Name() (name string) { } func (s *service) Run(ctx context.Context) (err error) { - syncData := s.storage.ImportedACLSyncData() - - // we could have added a timeout or some additional logic, - // but let's just use the ACL id of the latest started node :-) - return s.messageService.SendToSpaceAsync("", syncproto.WrapACLList( - &syncproto.SyncACLList{Records: syncData.Records}, - syncData.Header, - syncData.Id, - )) + return nil } func (s *service) Close(ctx context.Context) (err error) { return nil } -func (s *service) UpdateDocumentTree(ctx context.Context, id, text string) (err error) { +func (s *service) UpdateDocument(ctx context.Context, id, text string) (err error) { var ( ch *aclpb.RawChange - header *aclpb.Header + header *treepb.TreeHeader snapshotPath []string heads []string ) log.With(zap.String("id", id), zap.String("text", text)). Debug("updating document") - err = s.treeCache.Do(ctx, id, func(obj interface{}) error { - docTree, ok := obj.(tree.ObjectTree) - if !ok { - return fmt.Errorf("can't update acl trees with text") - } - - docTree.Lock() - defer docTree.Unlock() - err = s.treeCache.Do(ctx, docTree.Header().AclListId, func(obj interface{}) error { - aclTree := obj.(list.ACLList) - aclTree.RLock() - defer aclTree.RUnlock() - - content := createAppendTextChange(text) - signable := tree.SignableChangeContent{ - Proto: content, - Key: s.account.Account().SignKey, - Identity: s.account.Account().Identity, - IsSnapshot: false, - } - ch, err = docTree.AddContent(ctx, signable) - if err != nil { - return err - } + err = s.treeCache.Do(ctx, id, func(tree acltree.ACLTree) error { + ch, err = tree.AddContent(ctx, func(builder acltree.ChangeBuilder) error { + builder.AddChangeContent( + &testchangepb.PlainTextChange_Data{ + Content: []*testchangepb.PlainTextChange_Content{ + createAppendTextChangeContent(text), + }, + }) return nil }) if err != nil { return err } - id = docTree.ID() - heads = docTree.Heads() - header = docTree.Header() - snapshotPath = docTree.SnapshotPath() + id = tree.ID() + heads = tree.Heads() + header = tree.Header() + snapshotPath = tree.SnapshotPath() return nil }) if err != nil { @@ -128,90 +100,87 @@ func (s *service) UpdateDocumentTree(ctx context.Context, id, text string) (err zap.String("header", header.String())). Debug("document updated in the database") - return s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.SyncHeadUpdate{ + return s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.Sync_HeadUpdate{ Heads: heads, Changes: []*aclpb.RawChange{ch}, + TreeId: id, SnapshotPath: snapshotPath, - }, header, id)) + TreeHeader: header, + })) } -func (s *service) CreateDocumentTree(ctx context.Context, aclListId string, text string) (id string, err error) { +func (s *service) CreateDocument(ctx context.Context, text string) (id string, err error) { acc := s.account.Account() var ( ch *aclpb.RawChange - header *aclpb.Header + header *treepb.TreeHeader snapshotPath []string heads []string ) - err = s.treeCache.Do(ctx, aclListId, func(obj interface{}) error { - t := obj.(list.ACLList) - t.RLock() - defer t.RUnlock() - content := createInitialTextChange(text) - doc, err := tree.CreateNewTreeStorage(acc, t, content, s.storage.CreateTreeStorage) + err = s.treeCache.Create(ctx, func(builder acltree.ChangeBuilder) error { + err := builder.UserAdd(acc.Identity, acc.EncKey.GetPublic(), aclpb.ACLChange_Admin) if err != nil { return err } + // adding all predefined nodes to the document as admins + for _, n := range s.nodes { + err = builder.UserAdd(n.SigningKeyString, n.EncryptionKey, aclpb.ACLChange_Admin) + if err != nil { + return err + } + } - id, err = doc.ID() + builder.AddChangeContent(createInitialChangeContent(text)) + return nil + }, func(tree acltree.ACLTree) error { + id = tree.ID() + heads = tree.Heads() + header = tree.Header() + snapshotPath = tree.SnapshotPath() + ch, err = tree.Storage().GetChange(ctx, heads[0]) if err != nil { return err } - - header, err = doc.Header() - if err != nil { - return err - } - - heads = []string{header.FirstId} - snapshotPath = []string{header.FirstId} - ch, err = doc.GetRawChange(ctx, header.FirstId) - if err != nil { - return err - } - + log.With( + zap.String("id", id), + zap.Strings("heads", heads), + zap.String("header", header.String())). + Debug("document created in the database") return nil }) if err != nil { return "", err } - log.With(zap.String("id", id), zap.String("text", text)). Debug("creating document") - err = s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.SyncHeadUpdate{ + err = s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.Sync_HeadUpdate{ Heads: heads, Changes: []*aclpb.RawChange{ch}, + TreeId: id, SnapshotPath: snapshotPath, - }, header, id)) + TreeHeader: header, + })) if err != nil { return "", err } return id, err } -func createInitialTextChange(text string) proto.Marshaler { - return &testchanges.PlainTextChangeData{ - Content: []*testchanges.PlainTextChangeContent{ +func createInitialChangeContent(text string) proto.Marshaler { + return &testchangepb.PlainTextChange_Data{ + Content: []*testchangepb.PlainTextChange_Content{ createAppendTextChangeContent(text), }, - Snapshot: &testchanges.PlainTextChangeSnapshot{Text: text}, + Snapshot: &testchangepb.PlainTextChange_Snapshot{Text: text}, } } -func createAppendTextChange(text string) proto.Marshaler { - return &testchanges.PlainTextChangeData{ - Content: []*testchanges.PlainTextChangeContent{ - createAppendTextChangeContent(text), - }, - } -} - -func createAppendTextChangeContent(text string) *testchanges.PlainTextChangeContent { - return &testchanges.PlainTextChangeContent{ - Value: &testchanges.PlainTextChangeContentValueOfTextAppend{ - TextAppend: &testchanges.PlainTextChangeTextAppend{ +func createAppendTextChangeContent(text string) *testchangepb.PlainTextChange_Content { + return &testchangepb.PlainTextChange_Content{ + Value: &testchangepb.PlainTextChange_Content_TextAppend{ + TextAppend: &testchangepb.PlainTextChange_TextAppend{ Text: text, }, }, diff --git a/service/net/pool/message.go b/service/net/pool/message.go index 7535a55f..15a76f2e 100644 --- a/service/net/pool/message.go +++ b/service/net/pool/message.go @@ -48,7 +48,7 @@ func (m *Message) ReplyType(tp syncproto.MessageType, data proto.Marshaler) (err func (m *Message) Ack() (err error) { ack := &syncproto.System{ - Ack: &syncproto.SystemAck{}, + Ack: &syncproto.System_Ack{}, } data, err := ack.Marshal() if err != nil { @@ -78,10 +78,10 @@ func (m *Message) Ack() (err error) { return } -func (m *Message) AckError(code syncproto.SystemErrorCode, description string) (err error) { +func (m *Message) AckError(code syncproto.System_Error_Code, description string) (err error) { ack := &syncproto.System{ - Ack: &syncproto.SystemAck{ - Error: &syncproto.SystemError{ + Ack: &syncproto.System_Ack{ + Error: &syncproto.System_Error{ Code: code, Description: description, }, diff --git a/service/space/remotediff/remotediff.go b/service/space/remotediff/remotediff.go index 6ace7a33..0bab5350 100644 --- a/service/space/remotediff/remotediff.go +++ b/service/space/remotediff/remotediff.go @@ -25,9 +25,9 @@ type remote struct { func (r remote) Ranges(ctx context.Context, ranges []ldiff.Range, resBuf []ldiff.RangeResult) (results []ldiff.RangeResult, err error) { results = resBuf[:0] - pbRanges := make([]*spacesync.DiffRangeRequestRange, 0, len(ranges)) + pbRanges := make([]*spacesync.DiffRange_Request_Range, 0, len(ranges)) for _, rg := range ranges { - pbRanges = append(pbRanges, &spacesync.DiffRangeRequestRange{ + pbRanges = append(pbRanges, &spacesync.DiffRange_Request_Range{ From: rg.From, To: rg.To, Limit: uint32(rg.Limit), @@ -35,10 +35,10 @@ func (r remote) Ranges(ctx context.Context, ranges []ldiff.Range, resBuf []ldiff } req := &spacesync.Space{ SpaceId: r.spaceId, - Message: &spacesync.SpaceContent{ - Value: &spacesync.SpaceContentValueOfDiffRange{ + Message: &spacesync.Space_Content{ + Value: &spacesync.Space_Content_DiffRange{ DiffRange: &spacesync.DiffRange{ - Request: &spacesync.DiffRangeRequest{ + Request: &spacesync.DiffRange_Request{ Ranges: pbRanges, }, }, @@ -99,21 +99,21 @@ func HandlerRangeRequest(ctx context.Context, d ldiff.Diff, diffRange *spacesync return } - var rangeResp = &spacesync.DiffRangeResponse{ - Results: make([]*spacesync.DiffRangeResponseResult, len(res)), + var rangeResp = &spacesync.DiffRange_Response{ + Results: make([]*spacesync.DiffRange_Response_Result, len(res)), } for _, rangeRes := range res { - var elements []*spacesync.DiffRangeResponseResultElement + var elements []*spacesync.DiffRange_Response_Result_Element if len(rangeRes.Elements) > 0 { - elements = make([]*spacesync.DiffRangeResponseResultElement, 0, len(rangeRes.Elements)) + elements = make([]*spacesync.DiffRange_Response_Result_Element, 0, len(rangeRes.Elements)) for _, el := range rangeRes.Elements { - elements = append(elements, &spacesync.DiffRangeResponseResultElement{ + elements = append(elements, &spacesync.DiffRange_Response_Result_Element{ Id: el.Id, Head: el.Head, }) } } - rangeResp.Results = append(rangeResp.Results, &spacesync.DiffRangeResponseResult{ + rangeResp.Results = append(rangeResp.Results, &spacesync.DiffRange_Response_Result{ Hash: rangeRes.Hash, Elements: elements, Count: uint32(rangeRes.Count), diff --git a/service/space/service.go b/service/space/service.go index 7b826607..5e61366d 100644 --- a/service/space/service.go +++ b/service/space/service.go @@ -78,10 +78,9 @@ func (s *service) Handle(ctx context.Context, data []byte) (resp proto.Marshaler return } if spaceReq.SpaceId != "" { - var sp Space - sp, err = s.get(ctx, spaceReq.SpaceId) - if err != nil { - return + sp, e := s.get(ctx, spaceReq.SpaceId) + if e != nil { + return nil, e } return sp.Handle(ctx, spaceReq) } diff --git a/service/space/space.go b/service/space/space.go index 511d0632..272073bf 100644 --- a/service/space/space.go +++ b/service/space/space.go @@ -71,7 +71,7 @@ func (s *space) Handle(ctx context.Context, msg *spacesync.Space) (repl *spacesy return nil, er } return &spacesync.Space{SpaceId: s.id, Message: &spacesync.SpaceContent{ - Value: &spacesync.SpaceContentValueOfDiffRange{ + Value: &spacesync.SpaceContent_Value_DiffRange{ DiffRange: resp, }, }}, nil diff --git a/service/space/spacesync/spacesync.pb.go b/service/space/spacesync/spacesync.pb.go index 530c11e3..af6fd478 100644 --- a/service/space/spacesync/spacesync.pb.go +++ b/service/space/spacesync/spacesync.pb.go @@ -23,8 +23,8 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Space struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - Message *SpaceContent `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + Message *Space_Content `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } func (m *Space) Reset() { *m = Space{} } @@ -67,31 +67,32 @@ func (m *Space) GetSpaceId() string { return "" } -func (m *Space) GetMessage() *SpaceContent { +func (m *Space) GetMessage() *Space_Content { if m != nil { return m.Message } return nil } -type SpaceContent struct { +type Space_Content struct { // Types that are valid to be assigned to Value: - // *SpaceContentValueOfDiffRange - Value IsSpaceContentValue `protobuf_oneof:"value"` + // + // *Space_Content_DiffRange + Value isSpace_Content_Value `protobuf_oneof:"value"` } -func (m *SpaceContent) Reset() { *m = SpaceContent{} } -func (m *SpaceContent) String() string { return proto.CompactTextString(m) } -func (*SpaceContent) ProtoMessage() {} -func (*SpaceContent) Descriptor() ([]byte, []int) { +func (m *Space_Content) Reset() { *m = Space_Content{} } +func (m *Space_Content) String() string { return proto.CompactTextString(m) } +func (*Space_Content) ProtoMessage() {} +func (*Space_Content) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{0, 0} } -func (m *SpaceContent) XXX_Unmarshal(b []byte) error { +func (m *Space_Content) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SpaceContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Space_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SpaceContent.Marshal(b, m, deterministic) + return xxx_messageInfo_Space_Content.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -101,54 +102,54 @@ func (m *SpaceContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *SpaceContent) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpaceContent.Merge(m, src) +func (m *Space_Content) XXX_Merge(src proto.Message) { + xxx_messageInfo_Space_Content.Merge(m, src) } -func (m *SpaceContent) XXX_Size() int { +func (m *Space_Content) XXX_Size() int { return m.Size() } -func (m *SpaceContent) XXX_DiscardUnknown() { - xxx_messageInfo_SpaceContent.DiscardUnknown(m) +func (m *Space_Content) XXX_DiscardUnknown() { + xxx_messageInfo_Space_Content.DiscardUnknown(m) } -var xxx_messageInfo_SpaceContent proto.InternalMessageInfo +var xxx_messageInfo_Space_Content proto.InternalMessageInfo -type IsSpaceContentValue interface { - IsSpaceContentValue() +type isSpace_Content_Value interface { + isSpace_Content_Value() MarshalTo([]byte) (int, error) Size() int } -type SpaceContentValueOfDiffRange struct { +type Space_Content_DiffRange struct { DiffRange *DiffRange `protobuf:"bytes,1,opt,name=diffRange,proto3,oneof" json:"diffRange,omitempty"` } -func (*SpaceContentValueOfDiffRange) IsSpaceContentValue() {} +func (*Space_Content_DiffRange) isSpace_Content_Value() {} -func (m *SpaceContent) GetValue() IsSpaceContentValue { +func (m *Space_Content) GetValue() isSpace_Content_Value { if m != nil { return m.Value } return nil } -func (m *SpaceContent) GetDiffRange() *DiffRange { - if x, ok := m.GetValue().(*SpaceContentValueOfDiffRange); ok { +func (m *Space_Content) GetDiffRange() *DiffRange { + if x, ok := m.GetValue().(*Space_Content_DiffRange); ok { return x.DiffRange } return nil } // XXX_OneofWrappers is for the internal use of the proto package. -func (*SpaceContent) XXX_OneofWrappers() []interface{} { +func (*Space_Content) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*SpaceContentValueOfDiffRange)(nil), + (*Space_Content_DiffRange)(nil), } } type DiffRange struct { - Request *DiffRangeRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` - Response *DiffRangeResponse `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` + Request *DiffRange_Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + Response *DiffRange_Response `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` } func (m *DiffRange) Reset() { *m = DiffRange{} } @@ -184,36 +185,36 @@ func (m *DiffRange) XXX_DiscardUnknown() { var xxx_messageInfo_DiffRange proto.InternalMessageInfo -func (m *DiffRange) GetRequest() *DiffRangeRequest { +func (m *DiffRange) GetRequest() *DiffRange_Request { if m != nil { return m.Request } return nil } -func (m *DiffRange) GetResponse() *DiffRangeResponse { +func (m *DiffRange) GetResponse() *DiffRange_Response { if m != nil { return m.Response } return nil } -type DiffRangeRequest struct { - Ranges []*DiffRangeRequestRange `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"` +type DiffRange_Request struct { + Ranges []*DiffRange_Request_Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"` } -func (m *DiffRangeRequest) Reset() { *m = DiffRangeRequest{} } -func (m *DiffRangeRequest) String() string { return proto.CompactTextString(m) } -func (*DiffRangeRequest) ProtoMessage() {} -func (*DiffRangeRequest) Descriptor() ([]byte, []int) { +func (m *DiffRange_Request) Reset() { *m = DiffRange_Request{} } +func (m *DiffRange_Request) String() string { return proto.CompactTextString(m) } +func (*DiffRange_Request) ProtoMessage() {} +func (*DiffRange_Request) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{1, 0} } -func (m *DiffRangeRequest) XXX_Unmarshal(b []byte) error { +func (m *DiffRange_Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DiffRangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DiffRange_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DiffRangeRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_DiffRange_Request.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -223,43 +224,43 @@ func (m *DiffRangeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *DiffRangeRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiffRangeRequest.Merge(m, src) +func (m *DiffRange_Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiffRange_Request.Merge(m, src) } -func (m *DiffRangeRequest) XXX_Size() int { +func (m *DiffRange_Request) XXX_Size() int { return m.Size() } -func (m *DiffRangeRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DiffRangeRequest.DiscardUnknown(m) +func (m *DiffRange_Request) XXX_DiscardUnknown() { + xxx_messageInfo_DiffRange_Request.DiscardUnknown(m) } -var xxx_messageInfo_DiffRangeRequest proto.InternalMessageInfo +var xxx_messageInfo_DiffRange_Request proto.InternalMessageInfo -func (m *DiffRangeRequest) GetRanges() []*DiffRangeRequestRange { +func (m *DiffRange_Request) GetRanges() []*DiffRange_Request_Range { if m != nil { return m.Ranges } return nil } -type DiffRangeRequestRange struct { +type DiffRange_Request_Range struct { From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` } -func (m *DiffRangeRequestRange) Reset() { *m = DiffRangeRequestRange{} } -func (m *DiffRangeRequestRange) String() string { return proto.CompactTextString(m) } -func (*DiffRangeRequestRange) ProtoMessage() {} -func (*DiffRangeRequestRange) Descriptor() ([]byte, []int) { +func (m *DiffRange_Request_Range) Reset() { *m = DiffRange_Request_Range{} } +func (m *DiffRange_Request_Range) String() string { return proto.CompactTextString(m) } +func (*DiffRange_Request_Range) ProtoMessage() {} +func (*DiffRange_Request_Range) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{1, 0, 0} } -func (m *DiffRangeRequestRange) XXX_Unmarshal(b []byte) error { +func (m *DiffRange_Request_Range) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DiffRangeRequestRange) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DiffRange_Request_Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DiffRangeRequestRange.Marshal(b, m, deterministic) + return xxx_messageInfo_DiffRange_Request_Range.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -269,55 +270,55 @@ func (m *DiffRangeRequestRange) XXX_Marshal(b []byte, deterministic bool) ([]byt return b[:n], nil } } -func (m *DiffRangeRequestRange) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiffRangeRequestRange.Merge(m, src) +func (m *DiffRange_Request_Range) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiffRange_Request_Range.Merge(m, src) } -func (m *DiffRangeRequestRange) XXX_Size() int { +func (m *DiffRange_Request_Range) XXX_Size() int { return m.Size() } -func (m *DiffRangeRequestRange) XXX_DiscardUnknown() { - xxx_messageInfo_DiffRangeRequestRange.DiscardUnknown(m) +func (m *DiffRange_Request_Range) XXX_DiscardUnknown() { + xxx_messageInfo_DiffRange_Request_Range.DiscardUnknown(m) } -var xxx_messageInfo_DiffRangeRequestRange proto.InternalMessageInfo +var xxx_messageInfo_DiffRange_Request_Range proto.InternalMessageInfo -func (m *DiffRangeRequestRange) GetFrom() uint64 { +func (m *DiffRange_Request_Range) GetFrom() uint64 { if m != nil { return m.From } return 0 } -func (m *DiffRangeRequestRange) GetTo() uint64 { +func (m *DiffRange_Request_Range) GetTo() uint64 { if m != nil { return m.To } return 0 } -func (m *DiffRangeRequestRange) GetLimit() uint32 { +func (m *DiffRange_Request_Range) GetLimit() uint32 { if m != nil { return m.Limit } return 0 } -type DiffRangeResponse struct { - Results []*DiffRangeResponseResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` +type DiffRange_Response struct { + Results []*DiffRange_Response_Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (m *DiffRangeResponse) Reset() { *m = DiffRangeResponse{} } -func (m *DiffRangeResponse) String() string { return proto.CompactTextString(m) } -func (*DiffRangeResponse) ProtoMessage() {} -func (*DiffRangeResponse) Descriptor() ([]byte, []int) { +func (m *DiffRange_Response) Reset() { *m = DiffRange_Response{} } +func (m *DiffRange_Response) String() string { return proto.CompactTextString(m) } +func (*DiffRange_Response) ProtoMessage() {} +func (*DiffRange_Response) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{1, 1} } -func (m *DiffRangeResponse) XXX_Unmarshal(b []byte) error { +func (m *DiffRange_Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DiffRangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DiffRange_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DiffRangeResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_DiffRange_Response.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -327,43 +328,43 @@ func (m *DiffRangeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *DiffRangeResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiffRangeResponse.Merge(m, src) +func (m *DiffRange_Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiffRange_Response.Merge(m, src) } -func (m *DiffRangeResponse) XXX_Size() int { +func (m *DiffRange_Response) XXX_Size() int { return m.Size() } -func (m *DiffRangeResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DiffRangeResponse.DiscardUnknown(m) +func (m *DiffRange_Response) XXX_DiscardUnknown() { + xxx_messageInfo_DiffRange_Response.DiscardUnknown(m) } -var xxx_messageInfo_DiffRangeResponse proto.InternalMessageInfo +var xxx_messageInfo_DiffRange_Response proto.InternalMessageInfo -func (m *DiffRangeResponse) GetResults() []*DiffRangeResponseResult { +func (m *DiffRange_Response) GetResults() []*DiffRange_Response_Result { if m != nil { return m.Results } return nil } -type DiffRangeResponseResult struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - Elements []*DiffRangeResponseResultElement `protobuf:"bytes,2,rep,name=elements,proto3" json:"elements,omitempty"` - Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` +type DiffRange_Response_Result struct { + Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + Elements []*DiffRange_Response_Result_Element `protobuf:"bytes,2,rep,name=elements,proto3" json:"elements,omitempty"` + Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` } -func (m *DiffRangeResponseResult) Reset() { *m = DiffRangeResponseResult{} } -func (m *DiffRangeResponseResult) String() string { return proto.CompactTextString(m) } -func (*DiffRangeResponseResult) ProtoMessage() {} -func (*DiffRangeResponseResult) Descriptor() ([]byte, []int) { +func (m *DiffRange_Response_Result) Reset() { *m = DiffRange_Response_Result{} } +func (m *DiffRange_Response_Result) String() string { return proto.CompactTextString(m) } +func (*DiffRange_Response_Result) ProtoMessage() {} +func (*DiffRange_Response_Result) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{1, 1, 0} } -func (m *DiffRangeResponseResult) XXX_Unmarshal(b []byte) error { +func (m *DiffRange_Response_Result) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DiffRangeResponseResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DiffRange_Response_Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DiffRangeResponseResult.Marshal(b, m, deterministic) + return xxx_messageInfo_DiffRange_Response_Result.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -373,56 +374,56 @@ func (m *DiffRangeResponseResult) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *DiffRangeResponseResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiffRangeResponseResult.Merge(m, src) +func (m *DiffRange_Response_Result) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiffRange_Response_Result.Merge(m, src) } -func (m *DiffRangeResponseResult) XXX_Size() int { +func (m *DiffRange_Response_Result) XXX_Size() int { return m.Size() } -func (m *DiffRangeResponseResult) XXX_DiscardUnknown() { - xxx_messageInfo_DiffRangeResponseResult.DiscardUnknown(m) +func (m *DiffRange_Response_Result) XXX_DiscardUnknown() { + xxx_messageInfo_DiffRange_Response_Result.DiscardUnknown(m) } -var xxx_messageInfo_DiffRangeResponseResult proto.InternalMessageInfo +var xxx_messageInfo_DiffRange_Response_Result proto.InternalMessageInfo -func (m *DiffRangeResponseResult) GetHash() []byte { +func (m *DiffRange_Response_Result) GetHash() []byte { if m != nil { return m.Hash } return nil } -func (m *DiffRangeResponseResult) GetElements() []*DiffRangeResponseResultElement { +func (m *DiffRange_Response_Result) GetElements() []*DiffRange_Response_Result_Element { if m != nil { return m.Elements } return nil } -func (m *DiffRangeResponseResult) GetCount() uint32 { +func (m *DiffRange_Response_Result) GetCount() uint32 { if m != nil { return m.Count } return 0 } -type DiffRangeResponseResultElement struct { +type DiffRange_Response_Result_Element struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Head string `protobuf:"bytes,2,opt,name=head,proto3" json:"head,omitempty"` } -func (m *DiffRangeResponseResultElement) Reset() { *m = DiffRangeResponseResultElement{} } -func (m *DiffRangeResponseResultElement) String() string { return proto.CompactTextString(m) } -func (*DiffRangeResponseResultElement) ProtoMessage() {} -func (*DiffRangeResponseResultElement) Descriptor() ([]byte, []int) { +func (m *DiffRange_Response_Result_Element) Reset() { *m = DiffRange_Response_Result_Element{} } +func (m *DiffRange_Response_Result_Element) String() string { return proto.CompactTextString(m) } +func (*DiffRange_Response_Result_Element) ProtoMessage() {} +func (*DiffRange_Response_Result_Element) Descriptor() ([]byte, []int) { return fileDescriptor_11d78c2fb7c80384, []int{1, 1, 0, 0} } -func (m *DiffRangeResponseResultElement) XXX_Unmarshal(b []byte) error { +func (m *DiffRange_Response_Result_Element) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *DiffRangeResponseResultElement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DiffRange_Response_Result_Element) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_DiffRangeResponseResultElement.Marshal(b, m, deterministic) + return xxx_messageInfo_DiffRange_Response_Result_Element.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -432,26 +433,26 @@ func (m *DiffRangeResponseResultElement) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *DiffRangeResponseResultElement) XXX_Merge(src proto.Message) { - xxx_messageInfo_DiffRangeResponseResultElement.Merge(m, src) +func (m *DiffRange_Response_Result_Element) XXX_Merge(src proto.Message) { + xxx_messageInfo_DiffRange_Response_Result_Element.Merge(m, src) } -func (m *DiffRangeResponseResultElement) XXX_Size() int { +func (m *DiffRange_Response_Result_Element) XXX_Size() int { return m.Size() } -func (m *DiffRangeResponseResultElement) XXX_DiscardUnknown() { - xxx_messageInfo_DiffRangeResponseResultElement.DiscardUnknown(m) +func (m *DiffRange_Response_Result_Element) XXX_DiscardUnknown() { + xxx_messageInfo_DiffRange_Response_Result_Element.DiscardUnknown(m) } -var xxx_messageInfo_DiffRangeResponseResultElement proto.InternalMessageInfo +var xxx_messageInfo_DiffRange_Response_Result_Element proto.InternalMessageInfo -func (m *DiffRangeResponseResultElement) GetId() string { +func (m *DiffRange_Response_Result_Element) GetId() string { if m != nil { return m.Id } return "" } -func (m *DiffRangeResponseResultElement) GetHead() string { +func (m *DiffRange_Response_Result_Element) GetHead() string { if m != nil { return m.Head } @@ -460,13 +461,13 @@ func (m *DiffRangeResponseResultElement) GetHead() string { func init() { proto.RegisterType((*Space)(nil), "anytype.Space") - proto.RegisterType((*SpaceContent)(nil), "anytype.Space.Content") + proto.RegisterType((*Space_Content)(nil), "anytype.Space.Content") proto.RegisterType((*DiffRange)(nil), "anytype.DiffRange") - proto.RegisterType((*DiffRangeRequest)(nil), "anytype.DiffRange.Request") - proto.RegisterType((*DiffRangeRequestRange)(nil), "anytype.DiffRange.Request.Range") - proto.RegisterType((*DiffRangeResponse)(nil), "anytype.DiffRange.Response") - proto.RegisterType((*DiffRangeResponseResult)(nil), "anytype.DiffRange.Response.Result") - proto.RegisterType((*DiffRangeResponseResultElement)(nil), "anytype.DiffRange.Response.Result.Element") + proto.RegisterType((*DiffRange_Request)(nil), "anytype.DiffRange.Request") + proto.RegisterType((*DiffRange_Request_Range)(nil), "anytype.DiffRange.Request.Range") + proto.RegisterType((*DiffRange_Response)(nil), "anytype.DiffRange.Response") + proto.RegisterType((*DiffRange_Response_Result)(nil), "anytype.DiffRange.Response.Result") + proto.RegisterType((*DiffRange_Response_Result_Element)(nil), "anytype.DiffRange.Response.Result.Element") } func init() { @@ -546,7 +547,7 @@ func (m *Space) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SpaceContent) Marshal() (dAtA []byte, err error) { +func (m *Space_Content) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -556,12 +557,12 @@ func (m *SpaceContent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SpaceContent) MarshalTo(dAtA []byte) (int, error) { +func (m *Space_Content) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SpaceContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Space_Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -578,12 +579,12 @@ func (m *SpaceContent) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SpaceContentValueOfDiffRange) MarshalTo(dAtA []byte) (int, error) { +func (m *Space_Content_DiffRange) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SpaceContentValueOfDiffRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Space_Content_DiffRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.DiffRange != nil { { @@ -646,7 +647,7 @@ func (m *DiffRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DiffRangeRequest) Marshal() (dAtA []byte, err error) { +func (m *DiffRange_Request) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -656,12 +657,12 @@ func (m *DiffRangeRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DiffRangeRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *DiffRange_Request) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DiffRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DiffRange_Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -683,7 +684,7 @@ func (m *DiffRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DiffRangeRequestRange) Marshal() (dAtA []byte, err error) { +func (m *DiffRange_Request_Range) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -693,12 +694,12 @@ func (m *DiffRangeRequestRange) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DiffRangeRequestRange) MarshalTo(dAtA []byte) (int, error) { +func (m *DiffRange_Request_Range) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DiffRangeRequestRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DiffRange_Request_Range) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -721,7 +722,7 @@ func (m *DiffRangeRequestRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DiffRangeResponse) Marshal() (dAtA []byte, err error) { +func (m *DiffRange_Response) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -731,12 +732,12 @@ func (m *DiffRangeResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DiffRangeResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *DiffRange_Response) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DiffRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DiffRange_Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -758,7 +759,7 @@ func (m *DiffRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *DiffRangeResponseResult) Marshal() (dAtA []byte, err error) { +func (m *DiffRange_Response_Result) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -768,12 +769,12 @@ func (m *DiffRangeResponseResult) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DiffRangeResponseResult) MarshalTo(dAtA []byte) (int, error) { +func (m *DiffRange_Response_Result) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DiffRangeResponseResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DiffRange_Response_Result) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -807,7 +808,7 @@ func (m *DiffRangeResponseResult) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *DiffRangeResponseResultElement) Marshal() (dAtA []byte, err error) { +func (m *DiffRange_Response_Result_Element) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -817,12 +818,12 @@ func (m *DiffRangeResponseResultElement) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *DiffRangeResponseResultElement) MarshalTo(dAtA []byte) (int, error) { +func (m *DiffRange_Response_Result_Element) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *DiffRangeResponseResultElement) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DiffRange_Response_Result_Element) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -872,7 +873,7 @@ func (m *Space) Size() (n int) { return n } -func (m *SpaceContent) Size() (n int) { +func (m *Space_Content) Size() (n int) { if m == nil { return 0 } @@ -884,7 +885,7 @@ func (m *SpaceContent) Size() (n int) { return n } -func (m *SpaceContentValueOfDiffRange) Size() (n int) { +func (m *Space_Content_DiffRange) Size() (n int) { if m == nil { return 0 } @@ -913,7 +914,7 @@ func (m *DiffRange) Size() (n int) { return n } -func (m *DiffRangeRequest) Size() (n int) { +func (m *DiffRange_Request) Size() (n int) { if m == nil { return 0 } @@ -928,7 +929,7 @@ func (m *DiffRangeRequest) Size() (n int) { return n } -func (m *DiffRangeRequestRange) Size() (n int) { +func (m *DiffRange_Request_Range) Size() (n int) { if m == nil { return 0 } @@ -946,7 +947,7 @@ func (m *DiffRangeRequestRange) Size() (n int) { return n } -func (m *DiffRangeResponse) Size() (n int) { +func (m *DiffRange_Response) Size() (n int) { if m == nil { return 0 } @@ -961,7 +962,7 @@ func (m *DiffRangeResponse) Size() (n int) { return n } -func (m *DiffRangeResponseResult) Size() (n int) { +func (m *DiffRange_Response_Result) Size() (n int) { if m == nil { return 0 } @@ -983,7 +984,7 @@ func (m *DiffRangeResponseResult) Size() (n int) { return n } -func (m *DiffRangeResponseResultElement) Size() (n int) { +func (m *DiffRange_Response_Result_Element) Size() (n int) { if m == nil { return 0 } @@ -1097,7 +1098,7 @@ func (m *Space) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Message == nil { - m.Message = &SpaceContent{} + m.Message = &Space_Content{} } if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1124,7 +1125,7 @@ func (m *Space) Unmarshal(dAtA []byte) error { } return nil } -func (m *SpaceContent) Unmarshal(dAtA []byte) error { +func (m *Space_Content) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1186,7 +1187,7 @@ func (m *SpaceContent) Unmarshal(dAtA []byte) error { if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &SpaceContentValueOfDiffRange{v} + m.Value = &Space_Content_DiffRange{v} iNdEx = postIndex default: iNdEx = preIndex @@ -1268,7 +1269,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Request == nil { - m.Request = &DiffRangeRequest{} + m.Request = &DiffRange_Request{} } if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1304,7 +1305,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Response == nil { - m.Response = &DiffRangeResponse{} + m.Response = &DiffRange_Response{} } if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1331,7 +1332,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error { } return nil } -func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error { +func (m *DiffRange_Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1389,7 +1390,7 @@ func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Ranges = append(m.Ranges, &DiffRangeRequestRange{}) + m.Ranges = append(m.Ranges, &DiffRange_Request_Range{}) if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1415,7 +1416,7 @@ func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DiffRangeRequestRange) Unmarshal(dAtA []byte) error { +func (m *DiffRange_Request_Range) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1522,7 +1523,7 @@ func (m *DiffRangeRequestRange) Unmarshal(dAtA []byte) error { } return nil } -func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error { +func (m *DiffRange_Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1580,7 +1581,7 @@ func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Results = append(m.Results, &DiffRangeResponseResult{}) + m.Results = append(m.Results, &DiffRange_Response_Result{}) if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1606,7 +1607,7 @@ func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error { +func (m *DiffRange_Response_Result) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1698,7 +1699,7 @@ func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Elements = append(m.Elements, &DiffRangeResponseResultElement{}) + m.Elements = append(m.Elements, &DiffRange_Response_Result_Element{}) if err := m.Elements[len(m.Elements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1743,7 +1744,7 @@ func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error { } return nil } -func (m *DiffRangeResponseResultElement) Unmarshal(dAtA []byte) error { +func (m *DiffRange_Response_Result_Element) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { diff --git a/service/sync/message/service.go b/service/sync/message/service.go index 716fc4b2..3dff9767 100644 --- a/service/sync/message/service.go +++ b/service/sync/message/service.go @@ -57,7 +57,7 @@ func (s *service) Close(ctx context.Context) (err error) { func (s *service) HandleMessage(ctx context.Context, msg *pool.Message) (err error) { defer func() { if err != nil { - msg.AckError(syncproto.SystemError_UNKNOWN, err.Error()) + msg.AckError(syncproto.System_Error_UNKNOWN, err.Error()) } else { msg.Ack() } diff --git a/service/sync/requesthandler/requesthandler.go b/service/sync/requesthandler/requesthandler.go index eeeb0d52..2a960104 100644 --- a/service/sync/requesthandler/requesthandler.go +++ b/service/sync/requesthandler/requesthandler.go @@ -5,8 +5,9 @@ import ( "github.com/anytypeio/go-anytype-infrastructure-experiments/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/app/logger" "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/storage" - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/tree" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/acltree" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage" + "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/account" "github.com/anytypeio/go-anytype-infrastructure-experiments/service/treecache" "github.com/anytypeio/go-anytype-infrastructure-experiments/syncproto" @@ -60,234 +61,212 @@ func (r *requestHandler) HandleSyncMessage(ctx context.Context, senderId string, msg := content.GetMessage() switch { case msg.GetFullSyncRequest() != nil: - return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest(), content.GetTreeHeader(), content.GetTreeId()) + return r.HandleFullSyncRequest(ctx, senderId, msg.GetFullSyncRequest()) case msg.GetFullSyncResponse() != nil: - return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse(), content.GetTreeHeader(), content.GetTreeId()) + return r.HandleFullSyncResponse(ctx, senderId, msg.GetFullSyncResponse()) case msg.GetHeadUpdate() != nil: - return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate(), content.GetTreeHeader(), content.GetTreeId()) - case msg.GetAclList() != nil: - return r.HandleACLList(ctx, senderId, msg.GetAclList(), content.GetTreeHeader(), content.GetTreeId()) + return r.HandleHeadUpdate(ctx, senderId, msg.GetHeadUpdate()) } return nil } -func (r *requestHandler) HandleHeadUpdate( - ctx context.Context, - senderId string, - update *syncproto.SyncHeadUpdate, - header *aclpb.Header, - treeId string) (err error) { - +func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, update *syncproto.Sync_HeadUpdate) (err error) { var ( - fullRequest *syncproto.SyncFullRequest + fullRequest *syncproto.Sync_Full_Request snapshotPath []string - result tree.AddResult + result acltree.AddResult ) - log.With(zap.String("peerId", senderId), zap.String("treeId", treeId)). + log.With(zap.String("peerId", senderId), zap.String("treeId", update.TreeId)). Debug("processing head update") - err = r.treeCache.Do(ctx, treeId, func(obj any) error { - objTree := obj.(tree.ObjectTree) - objTree.Lock() - defer objTree.Unlock() - - if slice.UnsortedEquals(update.Heads, objTree.Heads()) { - return nil - } - - result, err = objTree.AddRawChanges(ctx, update.Changes...) + err = r.treeCache.Do(ctx, update.TreeId, func(tree acltree.ACLTree) error { + // TODO: check if we already have those changes + result, err = tree.AddRawChanges(ctx, update.Changes...) if err != nil { return err } - - // if we couldn't add all the changes - shouldFullSync := len(update.Changes) != len(result.Added) - snapshotPath = objTree.SnapshotPath() + log.With(zap.Strings("update heads", update.Heads), zap.Strings("tree heads", tree.Heads())). + Debug("comparing heads after head update") + shouldFullSync := !slice.UnsortedEquals(update.Heads, tree.Heads()) + snapshotPath = tree.SnapshotPath() if shouldFullSync { - fullRequest, err = r.prepareFullSyncRequest(objTree) + fullRequest, err = r.prepareFullSyncRequest(update.TreeId, update.TreeHeader, update.SnapshotPath, tree) if err != nil { return err } } return nil }) - // if there are no such tree - if err == storage.ErrUnknownTreeId { - fullRequest = &syncproto.SyncFullRequest{} + if err == treestorage.ErrUnknownTreeId { + // TODO: maybe we can optimize this by sending the header and stuff right away, so when the tree is created we are able to add it on first request + fullRequest = &syncproto.Sync_Full_Request{ + TreeId: update.TreeId, + TreeHeader: update.TreeHeader, + } } // if we have incompatible heads, or we haven't seen the tree at all if fullRequest != nil { - return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest, header, treeId)) + return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullRequest(fullRequest)) } // if error or nothing has changed if err != nil || len(result.Added) == 0 { return err } + // otherwise sending heads update message + newUpdate := &syncproto.Sync_HeadUpdate{ + Heads: result.Heads, + Changes: result.Added, + SnapshotPath: snapshotPath, + TreeId: update.TreeId, + TreeHeader: update.TreeHeader, + } + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) +} + +func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId string, request *syncproto.Sync_Full_Request) (err error) { + var ( + fullResponse *syncproto.Sync_Full_Response + snapshotPath []string + result acltree.AddResult + ) + log.With(zap.String("peerId", senderId), zap.String("treeId", request.TreeId)). + Debug("processing full sync request") + + err = r.treeCache.Do(ctx, request.TreeId, func(tree acltree.ACLTree) error { + // TODO: check if we already have those changes + // if we have non-empty request + if len(request.Heads) != 0 { + result, err = tree.AddRawChanges(ctx, request.Changes...) + if err != nil { + return err + } + } + snapshotPath = tree.SnapshotPath() + fullResponse, err = r.prepareFullSyncResponse(request.TreeId, request.SnapshotPath, request.Changes, tree) + if err != nil { + return err + } + return nil + }) + if err != nil { + return err + } + err = r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse)) + // if error or nothing has changed + if err != nil || len(result.Added) == 0 { + return err + } // otherwise sending heads update message - newUpdate := &syncproto.SyncHeadUpdate{ + newUpdate := &syncproto.Sync_HeadUpdate{ Heads: result.Heads, Changes: result.Added, SnapshotPath: snapshotPath, + TreeId: request.TreeId, + TreeHeader: request.TreeHeader, } - return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) } -func (r *requestHandler) HandleFullSyncRequest( - ctx context.Context, - senderId string, - request *syncproto.SyncFullRequest, - header *aclpb.Header, - treeId string) (err error) { - - var fullResponse *syncproto.SyncFullResponse - err = r.treeCache.Do(ctx, treeId, func(obj any) error { - objTree := obj.(tree.ObjectTree) - objTree.Lock() - defer objTree.Unlock() - - fullResponse, err = r.prepareFullSyncResponse(treeId, request.SnapshotPath, request.Heads, objTree) - if err != nil { - return err - } - return nil - }) - - if err != nil { - return err - } - return r.messageService.SendMessageAsync(senderId, syncproto.WrapFullResponse(fullResponse, header, treeId)) -} - -func (r *requestHandler) HandleFullSyncResponse( - ctx context.Context, - senderId string, - response *syncproto.SyncFullResponse, - header *aclpb.Header, - treeId string) (err error) { - +func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.Sync_Full_Response) (err error) { var ( snapshotPath []string - result tree.AddResult + result acltree.AddResult ) + log.With(zap.String("peerId", senderId), zap.String("treeId", response.TreeId)). + Debug("processing full sync response") - err = r.treeCache.Do(ctx, treeId, func(obj interface{}) error { - objTree := obj.(tree.ObjectTree) - objTree.Lock() - defer objTree.Unlock() - - // if we already have the heads for whatever reason - if slice.UnsortedEquals(response.Heads, objTree.Heads()) { - return nil - } - - result, err = objTree.AddRawChanges(ctx, response.Changes...) + err = r.treeCache.Do(ctx, response.TreeId, func(tree acltree.ACLTree) error { + // TODO: check if we already have those changes + result, err = tree.AddRawChanges(ctx, response.Changes...) if err != nil { return err } - snapshotPath = objTree.SnapshotPath() + snapshotPath = tree.SnapshotPath() return nil }) - // if error or nothing has changed - if (err != nil || len(result.Added) == 0) && err != storage.ErrUnknownTreeId { + if (err != nil || len(result.Added) == 0) && err != treestorage.ErrUnknownTreeId { return err } // if we have a new tree - if err == storage.ErrUnknownTreeId { - err = r.createTree(ctx, response, header, treeId) + if err == treestorage.ErrUnknownTreeId { + err = r.createTree(ctx, response) if err != nil { return err } - result = tree.AddResult{ + result = acltree.AddResult{ OldHeads: []string{}, Heads: response.Heads, Added: response.Changes, } } // sending heads update message - newUpdate := &syncproto.SyncHeadUpdate{ + newUpdate := &syncproto.Sync_HeadUpdate{ Heads: result.Heads, Changes: result.Added, SnapshotPath: snapshotPath, + TreeId: response.TreeId, } - return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate, header, treeId)) + return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate)) } -func (r *requestHandler) HandleACLList( - ctx context.Context, - senderId string, - req *syncproto.SyncACLList, - header *aclpb.Header, - id string) (err error) { - - err = r.treeCache.Do(ctx, id, func(obj interface{}) error { - return nil - }) - // do nothing if already added - if err == nil { - return nil +func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.TreeHeader, theirPath []string, tree acltree.ACLTree) (*syncproto.Sync_Full_Request, error) { + ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath) + if err != nil { + return nil, err } - // if not found then add to storage - if err == storage.ErrUnknownTreeId { - return r.createACLList(ctx, req, header, id) - } - return err -} - -func (r *requestHandler) prepareFullSyncRequest(t tree.ObjectTree) (*syncproto.SyncFullRequest, error) { - return &syncproto.SyncFullRequest{ - Heads: t.Heads(), - SnapshotPath: t.SnapshotPath(), + return &syncproto.Sync_Full_Request{ + Heads: tree.Heads(), + Changes: ourChanges, + TreeId: treeId, + SnapshotPath: tree.SnapshotPath(), + TreeHeader: header, }, nil } func (r *requestHandler) prepareFullSyncResponse( treeId string, - theirPath, theirHeads []string, - t tree.ObjectTree) (*syncproto.SyncFullResponse, error) { - ourChanges, err := t.ChangesAfterCommonSnapshot(theirPath, theirHeads) + theirPath []string, + theirChanges []*aclpb.RawChange, + tree acltree.ACLTree) (*syncproto.Sync_Full_Response, error) { + // TODO: we can probably use the common snapshot calculated on the request step from previous peer + ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath) if err != nil { return nil, err } + theirMap := make(map[string]struct{}) + for _, ch := range theirChanges { + theirMap[ch.Id] = struct{}{} + } - return &syncproto.SyncFullResponse{ - Heads: t.Heads(), - Changes: ourChanges, - SnapshotPath: t.SnapshotPath(), + // filtering our changes, so we will not send the same changes back + var final []*aclpb.RawChange + for _, ch := range ourChanges { + if _, exists := theirMap[ch.Id]; !exists { + final = append(final, ch) + } + } + log.With(zap.Int("len(changes)", len(final)), zap.String("id", treeId)). + Debug("preparing changes for tree") + + return &syncproto.Sync_Full_Response{ + Heads: tree.Heads(), + Changes: final, + TreeId: treeId, + SnapshotPath: tree.SnapshotPath(), + TreeHeader: tree.Header(), }, nil } -func (r *requestHandler) createTree( - ctx context.Context, - response *syncproto.SyncFullResponse, - header *aclpb.Header, - treeId string) error { - +func (r *requestHandler) createTree(ctx context.Context, response *syncproto.Sync_Full_Response) error { return r.treeCache.Add( ctx, - treeId, - storage.TreeStorageCreatePayload{ - TreeId: treeId, - Header: header, - Changes: response.Changes, - Heads: response.Heads, - }) -} - -func (r *requestHandler) createACLList( - ctx context.Context, - req *syncproto.SyncACLList, - header *aclpb.Header, - treeId string) error { - - return r.treeCache.Add( - ctx, - treeId, - storage.ACLListStorageCreatePayload{ - ListId: treeId, - Header: header, - Records: req.Records, + response.TreeId, + response.TreeHeader, + response.Changes, + func(tree acltree.ACLTree) error { + return nil }) } diff --git a/syncproto/helpers.go b/syncproto/helpers.go index fbbf11dc..fe19c267 100644 --- a/syncproto/helpers.go +++ b/syncproto/helpers.go @@ -1,45 +1,19 @@ package syncproto -import ( - "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" -) - -func WrapHeadUpdate(update *SyncHeadUpdate, header *aclpb.Header, treeId string) *Sync { - return &Sync{ - Message: &SyncContentValue{ - Value: &SyncContentValueValueOfHeadUpdate{HeadUpdate: update}, - }, - TreeHeader: header, - TreeId: treeId, - } +func WrapHeadUpdate(update *Sync_HeadUpdate) *Sync { + return &Sync{Message: &Sync_ContentValue{ + Value: &Sync_Content_Value_HeadUpdate{HeadUpdate: update}, + }} } -func WrapFullRequest(request *SyncFullRequest, header *aclpb.Header, treeId string) *Sync { - return &Sync{ - Message: &SyncContentValue{ - Value: &SyncContentValueValueOfFullSyncRequest{FullSyncRequest: request}, - }, - TreeHeader: header, - TreeId: treeId, - } +func WrapFullRequest(request *Sync_Full_Request) *Sync { + return &Sync{Message: &Sync_ContentValue{ + Value: &Sync_Content_Value_FullSyncRequest{FullSyncRequest: request}, + }} } -func WrapFullResponse(response *SyncFullResponse, header *aclpb.Header, treeId string) *Sync { - return &Sync{ - Message: &SyncContentValue{ - Value: &SyncContentValueValueOfFullSyncResponse{FullSyncResponse: response}, - }, - TreeHeader: header, - TreeId: treeId, - } -} - -func WrapACLList(aclList *SyncACLList, header *aclpb.Header, id string) *Sync { - return &Sync{ - Message: &SyncContentValue{ - Value: &SyncContentValueValueOfAclList{AclList: aclList}, - }, - TreeHeader: header, - TreeId: id, - } +func WrapFullResponse(response *Sync_Full_Response) *Sync { + return &Sync{Message: &Sync_ContentValue{ + Value: &Sync_Content_Value_FullSyncResponse{FullSyncResponse: response}, + }} } diff --git a/syncproto/sync.pb.go b/syncproto/sync.pb.go index 65da1f85..e8df4661 100644 --- a/syncproto/sync.pb.go +++ b/syncproto/sync.pb.go @@ -6,6 +6,7 @@ package syncproto import ( fmt "fmt" aclpb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges/aclpb" + treepb "github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treestorage/treepb" proto "github.com/gogo/protobuf/proto" io "io" math "math" @@ -26,21 +27,21 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type MessageType int32 const ( - MessageType_MessageTypeSystem MessageType = 0 - MessageType_MessageTypeSubscription MessageType = 1 - MessageType_MessageTypeSync MessageType = 2 + MessageType_MessageTypeSystem MessageType = 0 + MessageType_MessageTypeSpace MessageType = 1 + MessageType_MessageTypeSync MessageType = 2 ) var MessageType_name = map[int32]string{ 0: "MessageTypeSystem", - 1: "MessageTypeSubscription", + 1: "MessageTypeSpace", 2: "MessageTypeSync", } var MessageType_value = map[string]int32{ - "MessageTypeSystem": 0, - "MessageTypeSubscription": 1, - "MessageTypeSync": 2, + "MessageTypeSystem": 0, + "MessageTypeSpace": 1, + "MessageTypeSync": 2, } func (x MessageType) String() string { @@ -51,28 +52,28 @@ func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{0} } -type SystemErrorCode int32 +type System_Error_Code int32 const ( - SystemError_UNKNOWN SystemErrorCode = 0 - SystemError_UNSUPPORTED_PROTOCOL_VERSION SystemErrorCode = 10 + System_Error_UNKNOWN System_Error_Code = 0 + System_Error_UNSUPPORTED_PROTOCOL_VERSION System_Error_Code = 10 ) -var SystemErrorCode_name = map[int32]string{ +var System_Error_Code_name = map[int32]string{ 0: "UNKNOWN", 10: "UNSUPPORTED_PROTOCOL_VERSION", } -var SystemErrorCode_value = map[string]int32{ +var System_Error_Code_value = map[string]int32{ "UNKNOWN": 0, "UNSUPPORTED_PROTOCOL_VERSION": 10, } -func (x SystemErrorCode) String() string { - return proto.EnumName(SystemErrorCode_name, int32(x)) +func (x System_Error_Code) String() string { + return proto.EnumName(System_Error_Code_name, int32(x)) } -func (SystemErrorCode) EnumDescriptor() ([]byte, []int) { +func (System_Error_Code) EnumDescriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{2, 3, 0} } @@ -205,9 +206,9 @@ func (m *Header) GetDebugInfo() string { } type System struct { - Handshake *SystemHandshake `protobuf:"bytes,1,opt,name=handshake,proto3" json:"handshake,omitempty"` - Ping *SystemPing `protobuf:"bytes,2,opt,name=ping,proto3" json:"ping,omitempty"` - Ack *SystemAck `protobuf:"bytes,3,opt,name=ack,proto3" json:"ack,omitempty"` + Handshake *System_Handshake `protobuf:"bytes,1,opt,name=handshake,proto3" json:"handshake,omitempty"` + Ping *System_Ping `protobuf:"bytes,2,opt,name=ping,proto3" json:"ping,omitempty"` + Ack *System_Ack `protobuf:"bytes,3,opt,name=ack,proto3" json:"ack,omitempty"` } func (m *System) Reset() { *m = System{} } @@ -243,43 +244,43 @@ func (m *System) XXX_DiscardUnknown() { var xxx_messageInfo_System proto.InternalMessageInfo -func (m *System) GetHandshake() *SystemHandshake { +func (m *System) GetHandshake() *System_Handshake { if m != nil { return m.Handshake } return nil } -func (m *System) GetPing() *SystemPing { +func (m *System) GetPing() *System_Ping { if m != nil { return m.Ping } return nil } -func (m *System) GetAck() *SystemAck { +func (m *System) GetAck() *System_Ack { if m != nil { return m.Ack } return nil } -type SystemHandshake struct { +type System_Handshake struct { ProtocolVersion string `protobuf:"bytes,1,opt,name=protocolVersion,proto3" json:"protocolVersion,omitempty"` } -func (m *SystemHandshake) Reset() { *m = SystemHandshake{} } -func (m *SystemHandshake) String() string { return proto.CompactTextString(m) } -func (*SystemHandshake) ProtoMessage() {} -func (*SystemHandshake) Descriptor() ([]byte, []int) { +func (m *System_Handshake) Reset() { *m = System_Handshake{} } +func (m *System_Handshake) String() string { return proto.CompactTextString(m) } +func (*System_Handshake) ProtoMessage() {} +func (*System_Handshake) Descriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{2, 0} } -func (m *SystemHandshake) XXX_Unmarshal(b []byte) error { +func (m *System_Handshake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SystemHandshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *System_Handshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SystemHandshake.Marshal(b, m, deterministic) + return xxx_messageInfo_System_Handshake.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -289,41 +290,41 @@ func (m *SystemHandshake) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *SystemHandshake) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemHandshake.Merge(m, src) +func (m *System_Handshake) XXX_Merge(src proto.Message) { + xxx_messageInfo_System_Handshake.Merge(m, src) } -func (m *SystemHandshake) XXX_Size() int { +func (m *System_Handshake) XXX_Size() int { return m.Size() } -func (m *SystemHandshake) XXX_DiscardUnknown() { - xxx_messageInfo_SystemHandshake.DiscardUnknown(m) +func (m *System_Handshake) XXX_DiscardUnknown() { + xxx_messageInfo_System_Handshake.DiscardUnknown(m) } -var xxx_messageInfo_SystemHandshake proto.InternalMessageInfo +var xxx_messageInfo_System_Handshake proto.InternalMessageInfo -func (m *SystemHandshake) GetProtocolVersion() string { +func (m *System_Handshake) GetProtocolVersion() string { if m != nil { return m.ProtocolVersion } return "" } -type SystemPing struct { +type System_Ping struct { UnixTime uint64 `protobuf:"varint,1,opt,name=unixTime,proto3" json:"unixTime,omitempty"` } -func (m *SystemPing) Reset() { *m = SystemPing{} } -func (m *SystemPing) String() string { return proto.CompactTextString(m) } -func (*SystemPing) ProtoMessage() {} -func (*SystemPing) Descriptor() ([]byte, []int) { +func (m *System_Ping) Reset() { *m = System_Ping{} } +func (m *System_Ping) String() string { return proto.CompactTextString(m) } +func (*System_Ping) ProtoMessage() {} +func (*System_Ping) Descriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{2, 1} } -func (m *SystemPing) XXX_Unmarshal(b []byte) error { +func (m *System_Ping) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SystemPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *System_Ping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SystemPing.Marshal(b, m, deterministic) + return xxx_messageInfo_System_Ping.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -333,41 +334,41 @@ func (m *SystemPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *SystemPing) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemPing.Merge(m, src) +func (m *System_Ping) XXX_Merge(src proto.Message) { + xxx_messageInfo_System_Ping.Merge(m, src) } -func (m *SystemPing) XXX_Size() int { +func (m *System_Ping) XXX_Size() int { return m.Size() } -func (m *SystemPing) XXX_DiscardUnknown() { - xxx_messageInfo_SystemPing.DiscardUnknown(m) +func (m *System_Ping) XXX_DiscardUnknown() { + xxx_messageInfo_System_Ping.DiscardUnknown(m) } -var xxx_messageInfo_SystemPing proto.InternalMessageInfo +var xxx_messageInfo_System_Ping proto.InternalMessageInfo -func (m *SystemPing) GetUnixTime() uint64 { +func (m *System_Ping) GetUnixTime() uint64 { if m != nil { return m.UnixTime } return 0 } -type SystemAck struct { - Error *SystemError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` +type System_Ack struct { + Error *System_Error `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` } -func (m *SystemAck) Reset() { *m = SystemAck{} } -func (m *SystemAck) String() string { return proto.CompactTextString(m) } -func (*SystemAck) ProtoMessage() {} -func (*SystemAck) Descriptor() ([]byte, []int) { +func (m *System_Ack) Reset() { *m = System_Ack{} } +func (m *System_Ack) String() string { return proto.CompactTextString(m) } +func (*System_Ack) ProtoMessage() {} +func (*System_Ack) Descriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{2, 2} } -func (m *SystemAck) XXX_Unmarshal(b []byte) error { +func (m *System_Ack) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SystemAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *System_Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SystemAck.Marshal(b, m, deterministic) + return xxx_messageInfo_System_Ack.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -377,42 +378,42 @@ func (m *SystemAck) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *SystemAck) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemAck.Merge(m, src) +func (m *System_Ack) XXX_Merge(src proto.Message) { + xxx_messageInfo_System_Ack.Merge(m, src) } -func (m *SystemAck) XXX_Size() int { +func (m *System_Ack) XXX_Size() int { return m.Size() } -func (m *SystemAck) XXX_DiscardUnknown() { - xxx_messageInfo_SystemAck.DiscardUnknown(m) +func (m *System_Ack) XXX_DiscardUnknown() { + xxx_messageInfo_System_Ack.DiscardUnknown(m) } -var xxx_messageInfo_SystemAck proto.InternalMessageInfo +var xxx_messageInfo_System_Ack proto.InternalMessageInfo -func (m *SystemAck) GetError() *SystemError { +func (m *System_Ack) GetError() *System_Error { if m != nil { return m.Error } return nil } -type SystemError struct { - Code SystemErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=anytype.SystemErrorCode" json:"code,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +type System_Error struct { + Code System_Error_Code `protobuf:"varint,1,opt,name=code,proto3,enum=anytype.System_Error_Code" json:"code,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` } -func (m *SystemError) Reset() { *m = SystemError{} } -func (m *SystemError) String() string { return proto.CompactTextString(m) } -func (*SystemError) ProtoMessage() {} -func (*SystemError) Descriptor() ([]byte, []int) { +func (m *System_Error) Reset() { *m = System_Error{} } +func (m *System_Error) String() string { return proto.CompactTextString(m) } +func (*System_Error) ProtoMessage() {} +func (*System_Error) Descriptor() ([]byte, []int) { return fileDescriptor_4b28dfdd48a89166, []int{2, 3} } -func (m *SystemError) XXX_Unmarshal(b []byte) error { +func (m *System_Error) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SystemError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *System_Error) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SystemError.Marshal(b, m, deterministic) + return xxx_messageInfo_System_Error.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -422,184 +423,42 @@ func (m *SystemError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *SystemError) XXX_Merge(src proto.Message) { - xxx_messageInfo_SystemError.Merge(m, src) +func (m *System_Error) XXX_Merge(src proto.Message) { + xxx_messageInfo_System_Error.Merge(m, src) } -func (m *SystemError) XXX_Size() int { +func (m *System_Error) XXX_Size() int { return m.Size() } -func (m *SystemError) XXX_DiscardUnknown() { - xxx_messageInfo_SystemError.DiscardUnknown(m) +func (m *System_Error) XXX_DiscardUnknown() { + xxx_messageInfo_System_Error.DiscardUnknown(m) } -var xxx_messageInfo_SystemError proto.InternalMessageInfo +var xxx_messageInfo_System_Error proto.InternalMessageInfo -func (m *SystemError) GetCode() SystemErrorCode { +func (m *System_Error) GetCode() System_Error_Code { if m != nil { return m.Code } - return SystemError_UNKNOWN + return System_Error_UNKNOWN } -func (m *SystemError) GetDescription() string { +func (m *System_Error) GetDescription() string { if m != nil { return m.Description } return "" } -type Subscription struct { - SubscribeSpace *SubscriptionSubscribeSpace `protobuf:"bytes,1,opt,name=subscribeSpace,proto3" json:"subscribeSpace,omitempty"` - UnsubscribeSpace *SubscriptionUnsubscribeSpace `protobuf:"bytes,2,opt,name=unsubscribeSpace,proto3" json:"unsubscribeSpace,omitempty"` -} - -func (m *Subscription) Reset() { *m = Subscription{} } -func (m *Subscription) String() string { return proto.CompactTextString(m) } -func (*Subscription) ProtoMessage() {} -func (*Subscription) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3} -} -func (m *Subscription) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Subscription) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Subscription.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Subscription) XXX_Merge(src proto.Message) { - xxx_messageInfo_Subscription.Merge(m, src) -} -func (m *Subscription) XXX_Size() int { - return m.Size() -} -func (m *Subscription) XXX_DiscardUnknown() { - xxx_messageInfo_Subscription.DiscardUnknown(m) -} - -var xxx_messageInfo_Subscription proto.InternalMessageInfo - -func (m *Subscription) GetSubscribeSpace() *SubscriptionSubscribeSpace { - if m != nil { - return m.SubscribeSpace - } - return nil -} - -func (m *Subscription) GetUnsubscribeSpace() *SubscriptionUnsubscribeSpace { - if m != nil { - return m.UnsubscribeSpace - } - return nil -} - -type SubscriptionSubscribeSpace struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` -} - -func (m *SubscriptionSubscribeSpace) Reset() { *m = SubscriptionSubscribeSpace{} } -func (m *SubscriptionSubscribeSpace) String() string { return proto.CompactTextString(m) } -func (*SubscriptionSubscribeSpace) ProtoMessage() {} -func (*SubscriptionSubscribeSpace) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 0} -} -func (m *SubscriptionSubscribeSpace) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscriptionSubscribeSpace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscriptionSubscribeSpace.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscriptionSubscribeSpace) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscriptionSubscribeSpace.Merge(m, src) -} -func (m *SubscriptionSubscribeSpace) XXX_Size() int { - return m.Size() -} -func (m *SubscriptionSubscribeSpace) XXX_DiscardUnknown() { - xxx_messageInfo_SubscriptionSubscribeSpace.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscriptionSubscribeSpace proto.InternalMessageInfo - -func (m *SubscriptionSubscribeSpace) GetSpaceId() string { - if m != nil { - return m.SpaceId - } - return "" -} - -type SubscriptionUnsubscribeSpace struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` -} - -func (m *SubscriptionUnsubscribeSpace) Reset() { *m = SubscriptionUnsubscribeSpace{} } -func (m *SubscriptionUnsubscribeSpace) String() string { return proto.CompactTextString(m) } -func (*SubscriptionUnsubscribeSpace) ProtoMessage() {} -func (*SubscriptionUnsubscribeSpace) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{3, 1} -} -func (m *SubscriptionUnsubscribeSpace) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SubscriptionUnsubscribeSpace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SubscriptionUnsubscribeSpace.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SubscriptionUnsubscribeSpace) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubscriptionUnsubscribeSpace.Merge(m, src) -} -func (m *SubscriptionUnsubscribeSpace) XXX_Size() int { - return m.Size() -} -func (m *SubscriptionUnsubscribeSpace) XXX_DiscardUnknown() { - xxx_messageInfo_SubscriptionUnsubscribeSpace.DiscardUnknown(m) -} - -var xxx_messageInfo_SubscriptionUnsubscribeSpace proto.InternalMessageInfo - -func (m *SubscriptionUnsubscribeSpace) GetSpaceId() string { - if m != nil { - return m.SpaceId - } - return "" -} - type Sync struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - Message *SyncContentValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - TreeHeader *aclpb.Header `protobuf:"bytes,3,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` - TreeId string `protobuf:"bytes,4,opt,name=treeId,proto3" json:"treeId,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + Message *Sync_ContentValue `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } func (m *Sync) Reset() { *m = Sync{} } func (m *Sync) String() string { return proto.CompactTextString(m) } func (*Sync) ProtoMessage() {} func (*Sync) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4} + return fileDescriptor_4b28dfdd48a89166, []int{3} } func (m *Sync) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -635,48 +494,33 @@ func (m *Sync) GetSpaceId() string { return "" } -func (m *Sync) GetMessage() *SyncContentValue { +func (m *Sync) GetMessage() *Sync_ContentValue { if m != nil { return m.Message } return nil } -func (m *Sync) GetTreeHeader() *aclpb.Header { - if m != nil { - return m.TreeHeader - } - return nil -} - -func (m *Sync) GetTreeId() string { - if m != nil { - return m.TreeId - } - return "" -} - -type SyncContentValue struct { +type Sync_ContentValue struct { // Types that are valid to be assigned to Value: - // *SyncContentValueValueOfHeadUpdate - // *SyncContentValueValueOfFullSyncRequest - // *SyncContentValueValueOfFullSyncResponse - // *SyncContentValueValueOfAclList - Value IsSyncContentValueValue `protobuf_oneof:"value"` + // *Sync_Content_Value_HeadUpdate + // *Sync_Content_Value_FullSyncRequest + // *Sync_Content_Value_FullSyncResponse + Value isSync_Content_Value_Value `protobuf_oneof:"value"` } -func (m *SyncContentValue) Reset() { *m = SyncContentValue{} } -func (m *SyncContentValue) String() string { return proto.CompactTextString(m) } -func (*SyncContentValue) ProtoMessage() {} -func (*SyncContentValue) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 0} +func (m *Sync_ContentValue) Reset() { *m = Sync_ContentValue{} } +func (m *Sync_ContentValue) String() string { return proto.CompactTextString(m) } +func (*Sync_ContentValue) ProtoMessage() {} +func (*Sync_ContentValue) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 0} } -func (m *SyncContentValue) XXX_Unmarshal(b []byte) error { +func (m *Sync_ContentValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SyncContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Sync_ContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SyncContentValue.Marshal(b, m, deterministic) + return xxx_messageInfo_Sync_ContentValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -686,149 +530,95 @@ func (m *SyncContentValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *SyncContentValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncContentValue.Merge(m, src) +func (m *Sync_ContentValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sync_ContentValue.Merge(m, src) } -func (m *SyncContentValue) XXX_Size() int { +func (m *Sync_ContentValue) XXX_Size() int { return m.Size() } -func (m *SyncContentValue) XXX_DiscardUnknown() { - xxx_messageInfo_SyncContentValue.DiscardUnknown(m) +func (m *Sync_ContentValue) XXX_DiscardUnknown() { + xxx_messageInfo_Sync_ContentValue.DiscardUnknown(m) } -var xxx_messageInfo_SyncContentValue proto.InternalMessageInfo +var xxx_messageInfo_Sync_ContentValue proto.InternalMessageInfo -type IsSyncContentValueValue interface { - IsSyncContentValueValue() +type isSync_Content_Value_Value interface { + isSync_Content_Value_Value() MarshalTo([]byte) (int, error) Size() int } -type SyncContentValueValueOfHeadUpdate struct { - HeadUpdate *SyncHeadUpdate `protobuf:"bytes,1,opt,name=headUpdate,proto3,oneof" json:"headUpdate,omitempty"` +type Sync_Content_Value_HeadUpdate struct { + HeadUpdate *Sync_HeadUpdate `protobuf:"bytes,1,opt,name=headUpdate,proto3,oneof" json:"headUpdate,omitempty"` } -type SyncContentValueValueOfFullSyncRequest struct { - FullSyncRequest *SyncFullRequest `protobuf:"bytes,2,opt,name=fullSyncRequest,proto3,oneof" json:"fullSyncRequest,omitempty"` +type Sync_Content_Value_FullSyncRequest struct { + FullSyncRequest *Sync_Full_Request `protobuf:"bytes,2,opt,name=fullSyncRequest,proto3,oneof" json:"fullSyncRequest,omitempty"` } -type SyncContentValueValueOfFullSyncResponse struct { - FullSyncResponse *SyncFullResponse `protobuf:"bytes,3,opt,name=fullSyncResponse,proto3,oneof" json:"fullSyncResponse,omitempty"` -} -type SyncContentValueValueOfAclList struct { - AclList *SyncACLList `protobuf:"bytes,4,opt,name=aclList,proto3,oneof" json:"aclList,omitempty"` +type Sync_Content_Value_FullSyncResponse struct { + FullSyncResponse *Sync_Full_Response `protobuf:"bytes,3,opt,name=fullSyncResponse,proto3,oneof" json:"fullSyncResponse,omitempty"` } -func (*SyncContentValueValueOfHeadUpdate) IsSyncContentValueValue() {} -func (*SyncContentValueValueOfFullSyncRequest) IsSyncContentValueValue() {} -func (*SyncContentValueValueOfFullSyncResponse) IsSyncContentValueValue() {} -func (*SyncContentValueValueOfAclList) IsSyncContentValueValue() {} +func (*Sync_Content_Value_HeadUpdate) isSync_Content_Value_Value() {} +func (*Sync_Content_Value_FullSyncRequest) isSync_Content_Value_Value() {} +func (*Sync_Content_Value_FullSyncResponse) isSync_Content_Value_Value() {} -func (m *SyncContentValue) GetValue() IsSyncContentValueValue { +func (m *Sync_ContentValue) GetValue() isSync_Content_Value_Value { if m != nil { return m.Value } return nil } -func (m *SyncContentValue) GetHeadUpdate() *SyncHeadUpdate { - if x, ok := m.GetValue().(*SyncContentValueValueOfHeadUpdate); ok { +func (m *Sync_ContentValue) GetHeadUpdate() *Sync_HeadUpdate { + if x, ok := m.GetValue().(*Sync_Content_Value_HeadUpdate); ok { return x.HeadUpdate } return nil } -func (m *SyncContentValue) GetFullSyncRequest() *SyncFullRequest { - if x, ok := m.GetValue().(*SyncContentValueValueOfFullSyncRequest); ok { +func (m *Sync_ContentValue) GetFullSyncRequest() *Sync_Full_Request { + if x, ok := m.GetValue().(*Sync_Content_Value_FullSyncRequest); ok { return x.FullSyncRequest } return nil } -func (m *SyncContentValue) GetFullSyncResponse() *SyncFullResponse { - if x, ok := m.GetValue().(*SyncContentValueValueOfFullSyncResponse); ok { +func (m *Sync_ContentValue) GetFullSyncResponse() *Sync_Full_Response { + if x, ok := m.GetValue().(*Sync_Content_Value_FullSyncResponse); ok { return x.FullSyncResponse } return nil } -func (m *SyncContentValue) GetAclList() *SyncACLList { - if x, ok := m.GetValue().(*SyncContentValueValueOfAclList); ok { - return x.AclList - } - return nil -} - // XXX_OneofWrappers is for the internal use of the proto package. -func (*SyncContentValue) XXX_OneofWrappers() []interface{} { +func (*Sync_ContentValue) XXX_OneofWrappers() []interface{} { return []interface{}{ - (*SyncContentValueValueOfHeadUpdate)(nil), - (*SyncContentValueValueOfFullSyncRequest)(nil), - (*SyncContentValueValueOfFullSyncResponse)(nil), - (*SyncContentValueValueOfAclList)(nil), + (*Sync_Content_Value_HeadUpdate)(nil), + (*Sync_Content_Value_FullSyncRequest)(nil), + (*Sync_Content_Value_FullSyncResponse)(nil), } } -type SyncACLList struct { - Records []*aclpb.RawRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` -} - -func (m *SyncACLList) Reset() { *m = SyncACLList{} } -func (m *SyncACLList) String() string { return proto.CompactTextString(m) } -func (*SyncACLList) ProtoMessage() {} -func (*SyncACLList) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 1} -} -func (m *SyncACLList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SyncACLList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SyncACLList.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SyncACLList) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncACLList.Merge(m, src) -} -func (m *SyncACLList) XXX_Size() int { - return m.Size() -} -func (m *SyncACLList) XXX_DiscardUnknown() { - xxx_messageInfo_SyncACLList.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncACLList proto.InternalMessageInfo - -func (m *SyncACLList) GetRecords() []*aclpb.RawRecord { - if m != nil { - return m.Records - } - return nil -} - -type SyncHeadUpdate struct { +type Sync_HeadUpdate struct { Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` + TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` + SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` + TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` } -func (m *SyncHeadUpdate) Reset() { *m = SyncHeadUpdate{} } -func (m *SyncHeadUpdate) String() string { return proto.CompactTextString(m) } -func (*SyncHeadUpdate) ProtoMessage() {} -func (*SyncHeadUpdate) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 2} +func (m *Sync_HeadUpdate) Reset() { *m = Sync_HeadUpdate{} } +func (m *Sync_HeadUpdate) String() string { return proto.CompactTextString(m) } +func (*Sync_HeadUpdate) ProtoMessage() {} +func (*Sync_HeadUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 1} } -func (m *SyncHeadUpdate) XXX_Unmarshal(b []byte) error { +func (m *Sync_HeadUpdate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SyncHeadUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Sync_HeadUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SyncHeadUpdate.Marshal(b, m, deterministic) + return xxx_messageInfo_Sync_HeadUpdate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -838,54 +628,68 @@ func (m *SyncHeadUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *SyncHeadUpdate) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncHeadUpdate.Merge(m, src) +func (m *Sync_HeadUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sync_HeadUpdate.Merge(m, src) } -func (m *SyncHeadUpdate) XXX_Size() int { +func (m *Sync_HeadUpdate) XXX_Size() int { return m.Size() } -func (m *SyncHeadUpdate) XXX_DiscardUnknown() { - xxx_messageInfo_SyncHeadUpdate.DiscardUnknown(m) +func (m *Sync_HeadUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_Sync_HeadUpdate.DiscardUnknown(m) } -var xxx_messageInfo_SyncHeadUpdate proto.InternalMessageInfo +var xxx_messageInfo_Sync_HeadUpdate proto.InternalMessageInfo -func (m *SyncHeadUpdate) GetHeads() []string { +func (m *Sync_HeadUpdate) GetHeads() []string { if m != nil { return m.Heads } return nil } -func (m *SyncHeadUpdate) GetChanges() []*aclpb.RawChange { +func (m *Sync_HeadUpdate) GetChanges() []*aclpb.RawChange { if m != nil { return m.Changes } return nil } -func (m *SyncHeadUpdate) GetSnapshotPath() []string { +func (m *Sync_HeadUpdate) GetTreeId() string { + if m != nil { + return m.TreeId + } + return "" +} + +func (m *Sync_HeadUpdate) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath } return nil } -type SyncFull struct { +func (m *Sync_HeadUpdate) GetTreeHeader() *treepb.TreeHeader { + if m != nil { + return m.TreeHeader + } + return nil } -func (m *SyncFull) Reset() { *m = SyncFull{} } -func (m *SyncFull) String() string { return proto.CompactTextString(m) } -func (*SyncFull) ProtoMessage() {} -func (*SyncFull) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 3} +type Sync_Full struct { } -func (m *SyncFull) XXX_Unmarshal(b []byte) error { + +func (m *Sync_Full) Reset() { *m = Sync_Full{} } +func (m *Sync_Full) String() string { return proto.CompactTextString(m) } +func (*Sync_Full) ProtoMessage() {} +func (*Sync_Full) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 2} +} +func (m *Sync_Full) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SyncFull) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Sync_Full) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SyncFull.Marshal(b, m, deterministic) + return xxx_messageInfo_Sync_Full.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -895,37 +699,39 @@ func (m *SyncFull) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *SyncFull) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncFull.Merge(m, src) +func (m *Sync_Full) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sync_Full.Merge(m, src) } -func (m *SyncFull) XXX_Size() int { +func (m *Sync_Full) XXX_Size() int { return m.Size() } -func (m *SyncFull) XXX_DiscardUnknown() { - xxx_messageInfo_SyncFull.DiscardUnknown(m) +func (m *Sync_Full) XXX_DiscardUnknown() { + xxx_messageInfo_Sync_Full.DiscardUnknown(m) } -var xxx_messageInfo_SyncFull proto.InternalMessageInfo +var xxx_messageInfo_Sync_Full proto.InternalMessageInfo // here with send the request with all changes we have (we already know sender's snapshot path) -type SyncFullRequest struct { +type Sync_Full_Request struct { Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` + TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` + SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` + TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` } -func (m *SyncFullRequest) Reset() { *m = SyncFullRequest{} } -func (m *SyncFullRequest) String() string { return proto.CompactTextString(m) } -func (*SyncFullRequest) ProtoMessage() {} -func (*SyncFullRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 3, 0} +func (m *Sync_Full_Request) Reset() { *m = Sync_Full_Request{} } +func (m *Sync_Full_Request) String() string { return proto.CompactTextString(m) } +func (*Sync_Full_Request) ProtoMessage() {} +func (*Sync_Full_Request) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 2, 0} } -func (m *SyncFullRequest) XXX_Unmarshal(b []byte) error { +func (m *Sync_Full_Request) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SyncFullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Sync_Full_Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SyncFullRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_Sync_Full_Request.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -935,57 +741,73 @@ func (m *SyncFullRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *SyncFullRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncFullRequest.Merge(m, src) +func (m *Sync_Full_Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sync_Full_Request.Merge(m, src) } -func (m *SyncFullRequest) XXX_Size() int { +func (m *Sync_Full_Request) XXX_Size() int { return m.Size() } -func (m *SyncFullRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SyncFullRequest.DiscardUnknown(m) +func (m *Sync_Full_Request) XXX_DiscardUnknown() { + xxx_messageInfo_Sync_Full_Request.DiscardUnknown(m) } -var xxx_messageInfo_SyncFullRequest proto.InternalMessageInfo +var xxx_messageInfo_Sync_Full_Request proto.InternalMessageInfo -func (m *SyncFullRequest) GetHeads() []string { +func (m *Sync_Full_Request) GetHeads() []string { if m != nil { return m.Heads } return nil } -func (m *SyncFullRequest) GetChanges() []*aclpb.RawChange { +func (m *Sync_Full_Request) GetChanges() []*aclpb.RawChange { if m != nil { return m.Changes } return nil } -func (m *SyncFullRequest) GetSnapshotPath() []string { +func (m *Sync_Full_Request) GetTreeId() string { + if m != nil { + return m.TreeId + } + return "" +} + +func (m *Sync_Full_Request) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath } return nil } -type SyncFullResponse struct { - Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` - Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` - SnapshotPath []string `protobuf:"bytes,3,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` +func (m *Sync_Full_Request) GetTreeHeader() *treepb.TreeHeader { + if m != nil { + return m.TreeHeader + } + return nil } -func (m *SyncFullResponse) Reset() { *m = SyncFullResponse{} } -func (m *SyncFullResponse) String() string { return proto.CompactTextString(m) } -func (*SyncFullResponse) ProtoMessage() {} -func (*SyncFullResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4b28dfdd48a89166, []int{4, 3, 1} +type Sync_Full_Response struct { + Heads []string `protobuf:"bytes,1,rep,name=heads,proto3" json:"heads,omitempty"` + Changes []*aclpb.RawChange `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"` + TreeId string `protobuf:"bytes,3,opt,name=treeId,proto3" json:"treeId,omitempty"` + SnapshotPath []string `protobuf:"bytes,4,rep,name=snapshotPath,proto3" json:"snapshotPath,omitempty"` + TreeHeader *treepb.TreeHeader `protobuf:"bytes,5,opt,name=treeHeader,proto3" json:"treeHeader,omitempty"` } -func (m *SyncFullResponse) XXX_Unmarshal(b []byte) error { + +func (m *Sync_Full_Response) Reset() { *m = Sync_Full_Response{} } +func (m *Sync_Full_Response) String() string { return proto.CompactTextString(m) } +func (*Sync_Full_Response) ProtoMessage() {} +func (*Sync_Full_Response) Descriptor() ([]byte, []int) { + return fileDescriptor_4b28dfdd48a89166, []int{3, 2, 1} +} +func (m *Sync_Full_Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SyncFullResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Sync_Full_Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SyncFullResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_Sync_Full_Response.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -995,121 +817,125 @@ func (m *SyncFullResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *SyncFullResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncFullResponse.Merge(m, src) +func (m *Sync_Full_Response) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sync_Full_Response.Merge(m, src) } -func (m *SyncFullResponse) XXX_Size() int { +func (m *Sync_Full_Response) XXX_Size() int { return m.Size() } -func (m *SyncFullResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SyncFullResponse.DiscardUnknown(m) +func (m *Sync_Full_Response) XXX_DiscardUnknown() { + xxx_messageInfo_Sync_Full_Response.DiscardUnknown(m) } -var xxx_messageInfo_SyncFullResponse proto.InternalMessageInfo +var xxx_messageInfo_Sync_Full_Response proto.InternalMessageInfo -func (m *SyncFullResponse) GetHeads() []string { +func (m *Sync_Full_Response) GetHeads() []string { if m != nil { return m.Heads } return nil } -func (m *SyncFullResponse) GetChanges() []*aclpb.RawChange { +func (m *Sync_Full_Response) GetChanges() []*aclpb.RawChange { if m != nil { return m.Changes } return nil } -func (m *SyncFullResponse) GetSnapshotPath() []string { +func (m *Sync_Full_Response) GetTreeId() string { + if m != nil { + return m.TreeId + } + return "" +} + +func (m *Sync_Full_Response) GetSnapshotPath() []string { if m != nil { return m.SnapshotPath } return nil } +func (m *Sync_Full_Response) GetTreeHeader() *treepb.TreeHeader { + if m != nil { + return m.TreeHeader + } + return nil +} + func init() { proto.RegisterEnum("anytype.MessageType", MessageType_name, MessageType_value) - proto.RegisterEnum("anytype.SystemErrorCode", SystemErrorCode_name, SystemErrorCode_value) + proto.RegisterEnum("anytype.System_Error_Code", System_Error_Code_name, System_Error_Code_value) proto.RegisterType((*Message)(nil), "anytype.Message") proto.RegisterType((*Header)(nil), "anytype.Header") proto.RegisterType((*System)(nil), "anytype.System") - proto.RegisterType((*SystemHandshake)(nil), "anytype.System.Handshake") - proto.RegisterType((*SystemPing)(nil), "anytype.System.Ping") - proto.RegisterType((*SystemAck)(nil), "anytype.System.Ack") - proto.RegisterType((*SystemError)(nil), "anytype.System.Error") - proto.RegisterType((*Subscription)(nil), "anytype.Subscription") - proto.RegisterType((*SubscriptionSubscribeSpace)(nil), "anytype.Subscription.SubscribeSpace") - proto.RegisterType((*SubscriptionUnsubscribeSpace)(nil), "anytype.Subscription.UnsubscribeSpace") + proto.RegisterType((*System_Handshake)(nil), "anytype.System.Handshake") + proto.RegisterType((*System_Ping)(nil), "anytype.System.Ping") + proto.RegisterType((*System_Ack)(nil), "anytype.System.Ack") + proto.RegisterType((*System_Error)(nil), "anytype.System.Error") proto.RegisterType((*Sync)(nil), "anytype.Sync") - proto.RegisterType((*SyncContentValue)(nil), "anytype.Sync.ContentValue") - proto.RegisterType((*SyncACLList)(nil), "anytype.Sync.ACLList") - proto.RegisterType((*SyncHeadUpdate)(nil), "anytype.Sync.HeadUpdate") - proto.RegisterType((*SyncFull)(nil), "anytype.Sync.Full") - proto.RegisterType((*SyncFullRequest)(nil), "anytype.Sync.Full.Request") - proto.RegisterType((*SyncFullResponse)(nil), "anytype.Sync.Full.Response") + proto.RegisterType((*Sync_ContentValue)(nil), "anytype.Sync.ContentValue") + proto.RegisterType((*Sync_HeadUpdate)(nil), "anytype.Sync.HeadUpdate") + proto.RegisterType((*Sync_Full)(nil), "anytype.Sync.Full") + proto.RegisterType((*Sync_Full_Request)(nil), "anytype.Sync.Full.Request") + proto.RegisterType((*Sync_Full_Response)(nil), "anytype.Sync.Full.Response") } func init() { proto.RegisterFile("syncproto/proto/sync.proto", fileDescriptor_4b28dfdd48a89166) } var fileDescriptor_4b28dfdd48a89166 = []byte{ - // 882 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x8f, 0xda, 0x46, - 0x14, 0xb6, 0xc1, 0xe0, 0xf0, 0x40, 0x2c, 0x9d, 0x24, 0xad, 0xeb, 0x44, 0x08, 0xa1, 0xb4, 0x45, - 0x49, 0xe5, 0x6d, 0x49, 0xa3, 0x4a, 0xbd, 0x6d, 0xe8, 0xae, 0x40, 0xdd, 0x02, 0x1a, 0x96, 0xad, - 0xd4, 0x4b, 0x34, 0x8c, 0x27, 0x80, 0xf0, 0x8e, 0x5d, 0x8f, 0x69, 0xcb, 0x5f, 0xe8, 0x29, 0xd7, - 0x5e, 0xfb, 0x1b, 0xfa, 0x1b, 0xaa, 0x1e, 0x73, 0xec, 0xb1, 0xda, 0x55, 0xff, 0x47, 0x35, 0x33, - 0x36, 0x18, 0xb2, 0xb9, 0xee, 0x61, 0x17, 0xbf, 0xf7, 0xbe, 0xef, 0x9b, 0xef, 0xbd, 0xf1, 0x8c, - 0xc1, 0x15, 0x1b, 0x4e, 0xa3, 0x38, 0x4c, 0xc2, 0x63, 0xfd, 0x5f, 0xc6, 0x9e, 0x7a, 0x44, 0x36, - 0xe1, 0x9b, 0x64, 0x13, 0x31, 0xf7, 0x8b, 0x68, 0x35, 0x3f, 0x26, 0x34, 0x90, 0x7f, 0x74, 0x41, - 0xf8, 0x9c, 0x09, 0xf9, 0x18, 0xcd, 0x34, 0x47, 0xe4, 0xf2, 0x9a, 0xda, 0x3e, 0x03, 0xfb, 0x7b, - 0x26, 0x04, 0x99, 0x33, 0xf4, 0x19, 0x94, 0x17, 0x8c, 0xf8, 0x2c, 0x76, 0xcc, 0x96, 0xd9, 0xa9, - 0x76, 0x8f, 0xbc, 0x54, 0xd6, 0xeb, 0xab, 0x34, 0x4e, 0xcb, 0x08, 0x81, 0xe5, 0x93, 0x84, 0x38, - 0x85, 0x96, 0xd9, 0xa9, 0x61, 0xf5, 0xdc, 0xfe, 0xc3, 0x84, 0xb2, 0x86, 0x21, 0x07, 0xec, 0x24, - 0x26, 0x94, 0x0d, 0x7c, 0x25, 0x54, 0xc3, 0x59, 0x88, 0x1e, 0x43, 0x25, 0x66, 0x3f, 0xad, 0x99, - 0x48, 0x06, 0xbe, 0x62, 0x5b, 0x78, 0x97, 0x90, 0xbc, 0x98, 0x45, 0xc1, 0x66, 0xe0, 0x3b, 0x45, - 0x55, 0xcb, 0x42, 0xd4, 0x01, 0x4b, 0xfa, 0x70, 0xac, 0x96, 0xd9, 0xa9, 0x77, 0x1f, 0x6c, 0x7d, - 0xa5, 0xce, 0x2f, 0x36, 0x11, 0xc3, 0x0a, 0x21, 0x57, 0xf0, 0xd9, 0x6c, 0x3d, 0x1f, 0xf0, 0xd7, - 0xa1, 0x53, 0x6a, 0x99, 0x9d, 0x0a, 0xde, 0x25, 0xda, 0x7f, 0x16, 0xa1, 0x3c, 0xd9, 0x88, 0x84, - 0x5d, 0xa1, 0xaf, 0xa1, 0xb2, 0x20, 0xdc, 0x17, 0x0b, 0xb2, 0x62, 0x69, 0xbf, 0x1f, 0x6f, 0x75, - 0x35, 0xc6, 0xeb, 0x67, 0x00, 0xbc, 0xc3, 0x4a, 0x2f, 0xd1, 0x92, 0xcf, 0x95, 0xfd, 0x6a, 0xce, - 0x4b, 0xca, 0x19, 0x2f, 0xf9, 0x1c, 0x2b, 0x04, 0xfa, 0x04, 0x8a, 0x84, 0xae, 0x54, 0x2f, 0xd5, - 0xee, 0xfd, 0x43, 0xe0, 0x09, 0x5d, 0x61, 0x59, 0x77, 0x5f, 0x40, 0xa5, 0x9f, 0x53, 0x3f, 0x52, - 0xfb, 0x42, 0xc3, 0xe0, 0x92, 0xc5, 0x62, 0x19, 0x72, 0x65, 0xae, 0x82, 0x0f, 0xd3, 0x6e, 0x1b, - 0x2c, 0xb9, 0x16, 0x72, 0xe1, 0xde, 0x9a, 0x2f, 0x7f, 0xbd, 0x58, 0x5e, 0xe9, 0x3e, 0x2c, 0xbc, - 0x8d, 0xdd, 0x2e, 0x14, 0x4f, 0xe8, 0x0a, 0x3d, 0x83, 0x12, 0x8b, 0xe3, 0x30, 0x4e, 0x3d, 0x3f, - 0x3c, 0xb4, 0x72, 0x2a, 0x8b, 0x58, 0x63, 0xdc, 0x37, 0x26, 0x94, 0x54, 0x02, 0x79, 0x60, 0xd1, - 0xd0, 0xd7, 0xaa, 0xf5, 0xae, 0x7b, 0x2b, 0xcb, 0xeb, 0x85, 0x3e, 0xc3, 0x0a, 0x87, 0x5a, 0x50, - 0xf5, 0x99, 0xa0, 0xf1, 0x32, 0x4a, 0xa4, 0xef, 0x82, 0xf2, 0x9d, 0x4f, 0xb5, 0x5f, 0x80, 0x25, - 0xf1, 0xa8, 0x0a, 0xf6, 0x74, 0xf8, 0xdd, 0x70, 0xf4, 0xc3, 0xb0, 0x61, 0xa0, 0x16, 0x3c, 0x9e, - 0x0e, 0x27, 0xd3, 0xf1, 0x78, 0x84, 0x2f, 0x4e, 0xbf, 0x7d, 0x35, 0xc6, 0xa3, 0x8b, 0x51, 0x6f, - 0x74, 0xfe, 0xea, 0xf2, 0x14, 0x4f, 0x06, 0xa3, 0x61, 0x03, 0xda, 0xbf, 0x15, 0xa0, 0x36, 0x59, - 0xcf, 0xb6, 0x3a, 0xe8, 0x1c, 0xea, 0x42, 0xc7, 0x33, 0x36, 0x89, 0x08, 0xcd, 0x76, 0xf0, 0xc9, - 0xce, 0x63, 0x0e, 0x9e, 0x05, 0x29, 0x16, 0x1f, 0x70, 0x11, 0x86, 0xc6, 0x9a, 0x1f, 0xe8, 0xe9, - 0x49, 0x7d, 0x7a, 0xbb, 0xde, 0xf4, 0x00, 0x8d, 0xdf, 0xe1, 0xbb, 0x4f, 0xa1, 0xbe, 0xbf, 0xaa, - 0x7c, 0xbb, 0x45, 0xb4, 0x3b, 0x15, 0x15, 0x9c, 0x85, 0xee, 0xe7, 0xd0, 0x38, 0x54, 0x7c, 0x3f, - 0xba, 0xfd, 0x57, 0x19, 0xac, 0xc9, 0x86, 0xd3, 0xf7, 0x43, 0xd0, 0x57, 0x60, 0x5f, 0xe9, 0x93, - 0x91, 0xf6, 0x91, 0xdf, 0x3b, 0x4e, 0xbd, 0x5e, 0xc8, 0x13, 0xc6, 0x93, 0x4b, 0x12, 0xac, 0x19, - 0xce, 0xa0, 0xe8, 0x19, 0x40, 0x12, 0x33, 0xa6, 0x0f, 0x71, 0xfa, 0xd6, 0x56, 0x3d, 0x42, 0x83, - 0xec, 0xf8, 0xe7, 0xca, 0xe8, 0x43, 0x28, 0xcb, 0x68, 0xe0, 0xab, 0x33, 0x59, 0xc1, 0x69, 0xe4, - 0xfe, 0x5e, 0x80, 0x5a, 0x5e, 0x1e, 0x7d, 0x03, 0x20, 0x6f, 0x8d, 0x69, 0xe4, 0x93, 0x24, 0xdb, - 0x26, 0x67, 0xdf, 0x4e, 0x7f, 0x5b, 0xef, 0x1b, 0x38, 0x87, 0x46, 0x67, 0x70, 0xf4, 0x7a, 0x1d, - 0x04, 0x12, 0x84, 0xf5, 0x2d, 0x71, 0x7b, 0x3f, 0x67, 0xeb, 0x20, 0xf0, 0x52, 0x44, 0xdf, 0xc0, - 0x87, 0x24, 0x34, 0x80, 0xc6, 0x2e, 0x25, 0xa2, 0x90, 0x0b, 0x96, 0xf6, 0xf7, 0xe8, 0x56, 0x21, - 0x0d, 0xe9, 0x1b, 0xf8, 0x1d, 0x1a, 0xfa, 0x12, 0x6c, 0x42, 0x83, 0xf3, 0xa5, 0x48, 0x54, 0xe3, - 0xfb, 0x87, 0x89, 0x53, 0xef, 0xa4, 0x77, 0x2e, 0x8b, 0x7d, 0x03, 0x67, 0xb8, 0x97, 0x36, 0x94, - 0x7e, 0x96, 0xa3, 0x70, 0x9f, 0x83, 0x9d, 0x96, 0x51, 0x47, 0x5e, 0x75, 0x34, 0x8c, 0x7d, 0xe1, - 0x98, 0xad, 0x62, 0xa7, 0xda, 0xad, 0xab, 0x41, 0x63, 0xf2, 0x0b, 0x56, 0x69, 0x9c, 0x95, 0xdd, - 0x08, 0x60, 0x37, 0x1f, 0xf4, 0x00, 0x4a, 0x72, 0x3e, 0x9a, 0x55, 0xc1, 0x3a, 0x90, 0x6a, 0xe9, - 0xa5, 0xee, 0x14, 0xf6, 0xd5, 0x7a, 0x2a, 0x8d, 0xb3, 0x32, 0x6a, 0x43, 0x4d, 0x70, 0x12, 0x89, - 0x45, 0x98, 0x8c, 0x49, 0xb2, 0x70, 0x8a, 0x4a, 0x66, 0x2f, 0xe7, 0xfe, 0x67, 0x82, 0x25, 0x07, - 0xe1, 0x5e, 0x81, 0x9d, 0x4d, 0xf0, 0x2e, 0xd6, 0xe5, 0x70, 0x6f, 0x3b, 0xe6, 0x3b, 0x58, 0xef, - 0xe9, 0x25, 0x54, 0x73, 0xdf, 0x0f, 0xf4, 0x10, 0x3e, 0xc8, 0x85, 0xfa, 0x8e, 0x6b, 0x18, 0xe8, - 0x11, 0x7c, 0x94, 0x4f, 0xe7, 0xae, 0x81, 0x86, 0x89, 0xee, 0xc3, 0xd1, 0x1e, 0x87, 0xd3, 0x46, - 0xe1, 0xe5, 0x93, 0xbf, 0xaf, 0x9b, 0xe6, 0xdb, 0xeb, 0xa6, 0xf9, 0xef, 0x75, 0xd3, 0x7c, 0x73, - 0xd3, 0x34, 0xde, 0xde, 0x34, 0x8d, 0x7f, 0x6e, 0x9a, 0xc6, 0x8f, 0x70, 0xbc, 0xfd, 0x86, 0xcf, - 0xca, 0xea, 0xe7, 0xf9, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x8e, 0x29, 0x21, 0xd7, 0x07, - 0x00, 0x00, + // 799 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x55, 0xd1, 0x6e, 0xe3, 0x44, + 0x14, 0xf5, 0x24, 0x4e, 0xbc, 0xbe, 0xae, 0x5a, 0x33, 0xdb, 0x45, 0xc6, 0xac, 0x22, 0x2b, 0x02, + 0x61, 0x01, 0x72, 0x57, 0x81, 0x15, 0x12, 0x6f, 0xbb, 0xa1, 0x55, 0x22, 0x20, 0x89, 0x26, 0x49, + 0x91, 0x78, 0x59, 0x4d, 0xed, 0xd9, 0x24, 0x8a, 0x3b, 0x36, 0x1e, 0x07, 0xc8, 0x5f, 0xec, 0x37, + 0xf0, 0x0d, 0x48, 0x20, 0xbe, 0x80, 0xc7, 0x7d, 0xe4, 0x11, 0xb5, 0x12, 0x1f, 0x01, 0x2f, 0x68, + 0xc6, 0x76, 0xe2, 0x66, 0xfb, 0x03, 0xfb, 0xd0, 0x66, 0xee, 0xb9, 0xe7, 0x5c, 0x9f, 0x1b, 0xdf, + 0xb9, 0x01, 0x57, 0x6c, 0x79, 0x98, 0x66, 0x49, 0x9e, 0x9c, 0x15, 0xff, 0x65, 0x1c, 0xa8, 0x23, + 0x36, 0x28, 0xdf, 0xe6, 0xdb, 0x94, 0xb9, 0x4f, 0xd2, 0xf5, 0xe2, 0x8c, 0x86, 0xb1, 0xfc, 0x0b, + 0x97, 0x94, 0x2f, 0x98, 0x90, 0xc7, 0xf4, 0xaa, 0xd0, 0x88, 0x1a, 0x5e, 0x48, 0xdd, 0x4f, 0x2b, + 0x45, 0x9e, 0x31, 0x26, 0xf2, 0x24, 0xa3, 0x0b, 0xa6, 0xce, 0x7b, 0x8d, 0x8c, 0x0a, 0x76, 0xf7, + 0x02, 0x8c, 0x6f, 0x99, 0x10, 0x74, 0xc1, 0xf0, 0x47, 0xd0, 0x5e, 0x32, 0x1a, 0xb1, 0xcc, 0x41, + 0x1e, 0xf2, 0xad, 0xde, 0x49, 0x50, 0x9a, 0x08, 0x06, 0x0a, 0x26, 0x65, 0x1a, 0x63, 0xd0, 0x23, + 0x9a, 0x53, 0xa7, 0xe1, 0x21, 0xff, 0x88, 0xa8, 0x73, 0xf7, 0x17, 0x04, 0xed, 0x82, 0x86, 0x1d, + 0x30, 0xf2, 0x8c, 0x86, 0x6c, 0x18, 0xa9, 0x42, 0x47, 0xa4, 0x0a, 0xf1, 0x63, 0x30, 0x33, 0xf6, + 0xc3, 0x86, 0x89, 0x7c, 0x18, 0x29, 0xb5, 0x4e, 0xf6, 0x80, 0xd4, 0x65, 0x2c, 0x8d, 0xb7, 0xc3, + 0xc8, 0x69, 0xaa, 0x5c, 0x15, 0x62, 0x1f, 0x74, 0xe9, 0xc3, 0xd1, 0x3d, 0xe4, 0x1f, 0xf7, 0x4e, + 0x77, 0xbe, 0x4a, 0xe7, 0xb3, 0x6d, 0xca, 0x88, 0x62, 0xc8, 0x27, 0x44, 0xec, 0x6a, 0xb3, 0x18, + 0xf2, 0x97, 0x89, 0xd3, 0xf2, 0x90, 0x6f, 0x92, 0x3d, 0xd0, 0xfd, 0xb5, 0x09, 0xed, 0xe9, 0x56, + 0xe4, 0xec, 0x1a, 0x7f, 0x01, 0xe6, 0x92, 0xf2, 0x48, 0x2c, 0xe9, 0x9a, 0x95, 0xfd, 0xbe, 0xb7, + 0xab, 0x5b, 0x70, 0x82, 0x41, 0x45, 0x20, 0x7b, 0xae, 0xf4, 0x92, 0xae, 0xf8, 0x42, 0xd9, 0xb7, + 0x6a, 0x5e, 0x4a, 0xcd, 0x64, 0xc5, 0x17, 0x44, 0x31, 0xf0, 0x87, 0xd0, 0xa4, 0xe1, 0x5a, 0xf5, + 0x62, 0xf5, 0x1e, 0x1e, 0x12, 0x9f, 0x85, 0x6b, 0x22, 0xf3, 0xee, 0x53, 0x30, 0x07, 0xb5, 0xea, + 0x27, 0xea, 0xbd, 0x84, 0x49, 0x7c, 0xc9, 0x32, 0xb1, 0x4a, 0xb8, 0x32, 0x67, 0x92, 0x43, 0xd8, + 0xed, 0x82, 0x2e, 0x9f, 0x85, 0x5d, 0x78, 0xb0, 0xe1, 0xab, 0x9f, 0x67, 0xab, 0xeb, 0xa2, 0x0f, + 0x9d, 0xec, 0x62, 0xb7, 0x07, 0xcd, 0x67, 0xe1, 0x1a, 0x7f, 0x02, 0x2d, 0x96, 0x65, 0x49, 0x56, + 0x7a, 0x7e, 0x74, 0x68, 0xe5, 0x5c, 0x26, 0x49, 0xc1, 0x71, 0x5f, 0x21, 0x68, 0x29, 0x00, 0x07, + 0xa0, 0x87, 0x49, 0x54, 0x54, 0x3d, 0xee, 0xb9, 0xf7, 0xaa, 0x82, 0x7e, 0x12, 0x31, 0xa2, 0x78, + 0xd8, 0x03, 0x2b, 0x62, 0x22, 0xcc, 0x56, 0x69, 0x2e, 0x7d, 0x37, 0x94, 0xef, 0x3a, 0xd4, 0x7d, + 0x0a, 0xba, 0xe4, 0x63, 0x0b, 0x8c, 0xf9, 0xe8, 0xeb, 0xd1, 0xf8, 0xbb, 0x91, 0xad, 0x61, 0x0f, + 0x1e, 0xcf, 0x47, 0xd3, 0xf9, 0x64, 0x32, 0x26, 0xb3, 0xf3, 0xaf, 0x5e, 0x4c, 0xc8, 0x78, 0x36, + 0xee, 0x8f, 0xbf, 0x79, 0x71, 0x79, 0x4e, 0xa6, 0xc3, 0xf1, 0xc8, 0x86, 0xee, 0xbf, 0x6d, 0xd0, + 0xa7, 0x5b, 0x1e, 0xca, 0x09, 0x11, 0xe9, 0x7e, 0xb2, 0x4c, 0x52, 0x85, 0xf8, 0x73, 0x30, 0xae, + 0x8b, 0x61, 0x28, 0x9b, 0xac, 0xdb, 0xe5, 0x61, 0xd0, 0x4f, 0x78, 0xce, 0x78, 0x7e, 0x49, 0xe3, + 0x0d, 0x23, 0x15, 0xd5, 0xfd, 0x07, 0xc1, 0x51, 0x3d, 0x83, 0xbf, 0x04, 0x90, 0x33, 0x3e, 0x4f, + 0x23, 0x9a, 0x57, 0x63, 0xe1, 0xdc, 0xad, 0x34, 0xd8, 0xe5, 0x07, 0x1a, 0xa9, 0xb1, 0xf1, 0x05, + 0x9c, 0xbc, 0xdc, 0xc4, 0xb1, 0x24, 0x91, 0x62, 0xa6, 0xef, 0xb7, 0x72, 0xb1, 0x89, 0xe3, 0xa0, + 0x64, 0x0c, 0x34, 0x72, 0x28, 0xc2, 0x43, 0xb0, 0xf7, 0x90, 0x48, 0x13, 0x2e, 0x58, 0x39, 0x43, + 0xef, 0xdf, 0x5b, 0xa8, 0xa0, 0x0c, 0x34, 0xf2, 0x86, 0xec, 0xb9, 0x01, 0xad, 0x1f, 0x65, 0x5f, + 0xee, 0x1f, 0x08, 0x60, 0x6f, 0x1c, 0x9f, 0x42, 0x4b, 0x1a, 0x17, 0x0e, 0xf2, 0x9a, 0xbe, 0x49, + 0x8a, 0x00, 0xfb, 0x60, 0x94, 0x9b, 0xc4, 0x69, 0x78, 0x4d, 0xdf, 0xea, 0x1d, 0x07, 0x34, 0x8c, + 0x03, 0x42, 0x7f, 0xea, 0x2b, 0x98, 0x54, 0x69, 0xfc, 0x2e, 0xb4, 0xe5, 0x0a, 0x29, 0x2f, 0xaa, + 0x49, 0xca, 0x08, 0x77, 0xe1, 0x48, 0x70, 0x9a, 0x8a, 0x65, 0x92, 0x4f, 0x68, 0xbe, 0x74, 0x74, + 0x55, 0xfe, 0x0e, 0x86, 0x9f, 0x00, 0x48, 0x76, 0xb1, 0x2b, 0xd4, 0x15, 0xb5, 0x7a, 0x76, 0xa0, + 0x36, 0xd2, 0x6c, 0x87, 0x93, 0x1a, 0xc7, 0xfd, 0xaf, 0x01, 0xba, 0xec, 0xd5, 0xfd, 0x0d, 0x81, + 0x51, 0x7d, 0x4b, 0x6f, 0x57, 0x0b, 0xbf, 0x23, 0x78, 0x50, 0xbd, 0x95, 0xb7, 0xcb, 0xfa, 0xc7, + 0x63, 0xb0, 0x6a, 0x6b, 0x16, 0x3f, 0x82, 0x77, 0x6a, 0x61, 0xb1, 0x0a, 0x6c, 0x0d, 0x9f, 0x82, + 0x5d, 0x87, 0xe5, 0xad, 0xb4, 0x11, 0x7e, 0x08, 0x27, 0x77, 0xc8, 0x3c, 0xb4, 0x1b, 0xcf, 0x3f, + 0xf8, 0xf3, 0xa6, 0x83, 0x5e, 0xdf, 0x74, 0xd0, 0xdf, 0x37, 0x1d, 0xf4, 0xea, 0xb6, 0xa3, 0xbd, + 0xbe, 0xed, 0x68, 0x7f, 0xdd, 0x76, 0xb4, 0xef, 0xe1, 0x6c, 0xf7, 0x8b, 0x78, 0xd5, 0x56, 0x1f, + 0x9f, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x71, 0xf4, 0xb0, 0xb9, 0x25, 0x07, 0x00, 0x00, } func (m *Message) Marshal() (dAtA []byte, err error) { @@ -1265,7 +1091,7 @@ func (m *System) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SystemHandshake) Marshal() (dAtA []byte, err error) { +func (m *System_Handshake) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1275,12 +1101,12 @@ func (m *SystemHandshake) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SystemHandshake) MarshalTo(dAtA []byte) (int, error) { +func (m *System_Handshake) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SystemHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *System_Handshake) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1295,7 +1121,7 @@ func (m *SystemHandshake) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SystemPing) Marshal() (dAtA []byte, err error) { +func (m *System_Ping) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1305,12 +1131,12 @@ func (m *SystemPing) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SystemPing) MarshalTo(dAtA []byte) (int, error) { +func (m *System_Ping) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SystemPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *System_Ping) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1323,7 +1149,7 @@ func (m *SystemPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SystemAck) Marshal() (dAtA []byte, err error) { +func (m *System_Ack) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1333,12 +1159,12 @@ func (m *SystemAck) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SystemAck) MarshalTo(dAtA []byte) (int, error) { +func (m *System_Ack) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SystemAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *System_Ack) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1358,7 +1184,7 @@ func (m *SystemAck) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SystemError) Marshal() (dAtA []byte, err error) { +func (m *System_Error) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1368,12 +1194,12 @@ func (m *SystemError) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SystemError) MarshalTo(dAtA []byte) (int, error) { +func (m *System_Error) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SystemError) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *System_Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1393,113 +1219,6 @@ func (m *SystemError) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Subscription) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Subscription) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Subscription) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.UnsubscribeSpace != nil { - { - size, err := m.UnsubscribeSpace.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.SubscribeSpace != nil { - { - size, err := m.SubscribeSpace.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SubscriptionSubscribeSpace) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscriptionSubscribeSpace) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscriptionSubscribeSpace) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SpaceId) > 0 { - i -= len(m.SpaceId) - copy(dAtA[i:], m.SpaceId) - i = encodeVarintSync(dAtA, i, uint64(len(m.SpaceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SubscriptionUnsubscribeSpace) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SubscriptionUnsubscribeSpace) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SubscriptionUnsubscribeSpace) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.SpaceId) > 0 { - i -= len(m.SpaceId) - copy(dAtA[i:], m.SpaceId) - i = encodeVarintSync(dAtA, i, uint64(len(m.SpaceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - func (m *Sync) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1520,25 +1239,6 @@ func (m *Sync) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.TreeId) > 0 { - i -= len(m.TreeId) - copy(dAtA[i:], m.TreeId) - i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) - i-- - dAtA[i] = 0x22 - } - if m.TreeHeader != nil { - { - size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } if m.Message != nil { { size, err := m.Message.MarshalToSizedBuffer(dAtA[:i]) @@ -1561,7 +1261,7 @@ func (m *Sync) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncContentValue) Marshal() (dAtA []byte, err error) { +func (m *Sync_ContentValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1571,12 +1271,12 @@ func (m *SyncContentValue) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SyncContentValue) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_ContentValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_ContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1593,12 +1293,12 @@ func (m *SyncContentValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncContentValueValueOfHeadUpdate) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_HeadUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncContentValueValueOfHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_HeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.HeadUpdate != nil { { @@ -1614,12 +1314,12 @@ func (m *SyncContentValueValueOfHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (i } return len(dAtA) - i, nil } -func (m *SyncContentValueValueOfFullSyncRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_FullSyncRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncContentValueValueOfFullSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_FullSyncRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.FullSyncRequest != nil { { @@ -1635,12 +1335,12 @@ func (m *SyncContentValueValueOfFullSyncRequest) MarshalToSizedBuffer(dAtA []byt } return len(dAtA) - i, nil } -func (m *SyncContentValueValueOfFullSyncResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_FullSyncResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncContentValueValueOfFullSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Content_Value_FullSyncResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.FullSyncResponse != nil { { @@ -1656,16 +1356,29 @@ func (m *SyncContentValueValueOfFullSyncResponse) MarshalToSizedBuffer(dAtA []by } return len(dAtA) - i, nil } -func (m *SyncContentValueValueOfAclList) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_HeadUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sync_HeadUpdate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncContentValueValueOfAclList) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_HeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.AclList != nil { + _ = i + var l int + _ = l + if m.TreeHeader != nil { { - size, err := m.AclList.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1673,76 +1386,24 @@ func (m *SyncContentValueValueOfAclList) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintSync(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x2a } - return len(dAtA) - i, nil -} -func (m *SyncACLList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SyncACLList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyncACLList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Records) > 0 { - for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSync(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *SyncHeadUpdate) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SyncHeadUpdate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyncHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(m.TreeId) > 0 { + i -= len(m.TreeId) + copy(dAtA[i:], m.TreeId) + i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) + i-- + dAtA[i] = 0x1a + } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1769,7 +1430,7 @@ func (m *SyncHeadUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncFull) Marshal() (dAtA []byte, err error) { +func (m *Sync_Full) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1779,12 +1440,12 @@ func (m *SyncFull) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SyncFull) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Full) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncFull) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Full) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1792,7 +1453,7 @@ func (m *SyncFull) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncFullRequest) Marshal() (dAtA []byte, err error) { +func (m *Sync_Full_Request) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1802,25 +1463,44 @@ func (m *SyncFullRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SyncFullRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Full_Request) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncFullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Full_Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.TreeHeader != nil { + { + size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(m.TreeId) > 0 { + i -= len(m.TreeId) + copy(dAtA[i:], m.TreeId) + i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) + i-- + dAtA[i] = 0x1a + } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1847,7 +1527,7 @@ func (m *SyncFullRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncFullResponse) Marshal() (dAtA []byte, err error) { +func (m *Sync_Full_Response) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1857,25 +1537,44 @@ func (m *SyncFullResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *SyncFullResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *Sync_Full_Response) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SyncFullResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Sync_Full_Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if m.TreeHeader != nil { + { + size, err := m.TreeHeader.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSync(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.SnapshotPath) > 0 { for iNdEx := len(m.SnapshotPath) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SnapshotPath[iNdEx]) copy(dAtA[i:], m.SnapshotPath[iNdEx]) i = encodeVarintSync(dAtA, i, uint64(len(m.SnapshotPath[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } } + if len(m.TreeId) > 0 { + i -= len(m.TreeId) + copy(dAtA[i:], m.TreeId) + i = encodeVarintSync(dAtA, i, uint64(len(m.TreeId))) + i-- + dAtA[i] = 0x1a + } if len(m.Changes) > 0 { for iNdEx := len(m.Changes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1977,7 +1676,7 @@ func (m *System) Size() (n int) { return n } -func (m *SystemHandshake) Size() (n int) { +func (m *System_Handshake) Size() (n int) { if m == nil { return 0 } @@ -1990,7 +1689,7 @@ func (m *SystemHandshake) Size() (n int) { return n } -func (m *SystemPing) Size() (n int) { +func (m *System_Ping) Size() (n int) { if m == nil { return 0 } @@ -2002,7 +1701,7 @@ func (m *SystemPing) Size() (n int) { return n } -func (m *SystemAck) Size() (n int) { +func (m *System_Ack) Size() (n int) { if m == nil { return 0 } @@ -2015,7 +1714,7 @@ func (m *SystemAck) Size() (n int) { return n } -func (m *SystemError) Size() (n int) { +func (m *System_Error) Size() (n int) { if m == nil { return 0 } @@ -2031,49 +1730,6 @@ func (m *SystemError) Size() (n int) { return n } -func (m *Subscription) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SubscribeSpace != nil { - l = m.SubscribeSpace.Size() - n += 1 + l + sovSync(uint64(l)) - } - if m.UnsubscribeSpace != nil { - l = m.UnsubscribeSpace.Size() - n += 1 + l + sovSync(uint64(l)) - } - return n -} - -func (m *SubscriptionSubscribeSpace) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SpaceId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } - return n -} - -func (m *SubscriptionUnsubscribeSpace) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SpaceId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } - return n -} - func (m *Sync) Size() (n int) { if m == nil { return 0 @@ -2088,18 +1744,10 @@ func (m *Sync) Size() (n int) { l = m.Message.Size() n += 1 + l + sovSync(uint64(l)) } - if m.TreeHeader != nil { - l = m.TreeHeader.Size() - n += 1 + l + sovSync(uint64(l)) - } - l = len(m.TreeId) - if l > 0 { - n += 1 + l + sovSync(uint64(l)) - } return n } -func (m *SyncContentValue) Size() (n int) { +func (m *Sync_ContentValue) Size() (n int) { if m == nil { return 0 } @@ -2111,7 +1759,7 @@ func (m *SyncContentValue) Size() (n int) { return n } -func (m *SyncContentValueValueOfHeadUpdate) Size() (n int) { +func (m *Sync_Content_Value_HeadUpdate) Size() (n int) { if m == nil { return 0 } @@ -2123,7 +1771,7 @@ func (m *SyncContentValueValueOfHeadUpdate) Size() (n int) { } return n } -func (m *SyncContentValueValueOfFullSyncRequest) Size() (n int) { +func (m *Sync_Content_Value_FullSyncRequest) Size() (n int) { if m == nil { return 0 } @@ -2135,7 +1783,7 @@ func (m *SyncContentValueValueOfFullSyncRequest) Size() (n int) { } return n } -func (m *SyncContentValueValueOfFullSyncResponse) Size() (n int) { +func (m *Sync_Content_Value_FullSyncResponse) Size() (n int) { if m == nil { return 0 } @@ -2147,34 +1795,51 @@ func (m *SyncContentValueValueOfFullSyncResponse) Size() (n int) { } return n } -func (m *SyncContentValueValueOfAclList) Size() (n int) { +func (m *Sync_HeadUpdate) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.AclList != nil { - l = m.AclList.Size() + if len(m.Heads) > 0 { + for _, s := range m.Heads { + l = len(s) + n += 1 + l + sovSync(uint64(l)) + } + } + if len(m.Changes) > 0 { + for _, e := range m.Changes { + l = e.Size() + n += 1 + l + sovSync(uint64(l)) + } + } + l = len(m.TreeId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } + if len(m.SnapshotPath) > 0 { + for _, s := range m.SnapshotPath { + l = len(s) + n += 1 + l + sovSync(uint64(l)) + } + } + if m.TreeHeader != nil { + l = m.TreeHeader.Size() n += 1 + l + sovSync(uint64(l)) } return n } -func (m *SyncACLList) Size() (n int) { + +func (m *Sync_Full) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Records) > 0 { - for _, e := range m.Records { - l = e.Size() - n += 1 + l + sovSync(uint64(l)) - } - } return n } -func (m *SyncHeadUpdate) Size() (n int) { +func (m *Sync_Full_Request) Size() (n int) { if m == nil { return 0 } @@ -2192,25 +1857,24 @@ func (m *SyncHeadUpdate) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } + l = len(m.TreeId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) + } if len(m.SnapshotPath) > 0 { for _, s := range m.SnapshotPath { l = len(s) n += 1 + l + sovSync(uint64(l)) } } - return n -} - -func (m *SyncFull) Size() (n int) { - if m == nil { - return 0 + if m.TreeHeader != nil { + l = m.TreeHeader.Size() + n += 1 + l + sovSync(uint64(l)) } - var l int - _ = l return n } -func (m *SyncFullRequest) Size() (n int) { +func (m *Sync_Full_Response) Size() (n int) { if m == nil { return 0 } @@ -2228,32 +1892,9 @@ func (m *SyncFullRequest) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } - if len(m.SnapshotPath) > 0 { - for _, s := range m.SnapshotPath { - l = len(s) - n += 1 + l + sovSync(uint64(l)) - } - } - return n -} - -func (m *SyncFullResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Heads) > 0 { - for _, s := range m.Heads { - l = len(s) - n += 1 + l + sovSync(uint64(l)) - } - } - if len(m.Changes) > 0 { - for _, e := range m.Changes { - l = e.Size() - n += 1 + l + sovSync(uint64(l)) - } + l = len(m.TreeId) + if l > 0 { + n += 1 + l + sovSync(uint64(l)) } if len(m.SnapshotPath) > 0 { for _, s := range m.SnapshotPath { @@ -2261,6 +1902,10 @@ func (m *SyncFullResponse) Size() (n int) { n += 1 + l + sovSync(uint64(l)) } } + if m.TreeHeader != nil { + l = m.TreeHeader.Size() + n += 1 + l + sovSync(uint64(l)) + } return n } @@ -2622,7 +2267,7 @@ func (m *System) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Handshake == nil { - m.Handshake = &SystemHandshake{} + m.Handshake = &System_Handshake{} } if err := m.Handshake.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2658,7 +2303,7 @@ func (m *System) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Ping == nil { - m.Ping = &SystemPing{} + m.Ping = &System_Ping{} } if err := m.Ping.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2694,7 +2339,7 @@ func (m *System) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Ack == nil { - m.Ack = &SystemAck{} + m.Ack = &System_Ack{} } if err := m.Ack.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2721,7 +2366,7 @@ func (m *System) Unmarshal(dAtA []byte) error { } return nil } -func (m *SystemHandshake) Unmarshal(dAtA []byte) error { +func (m *System_Handshake) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2803,7 +2448,7 @@ func (m *SystemHandshake) Unmarshal(dAtA []byte) error { } return nil } -func (m *SystemPing) Unmarshal(dAtA []byte) error { +func (m *System_Ping) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2872,7 +2517,7 @@ func (m *SystemPing) Unmarshal(dAtA []byte) error { } return nil } -func (m *SystemAck) Unmarshal(dAtA []byte) error { +func (m *System_Ack) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2931,7 +2576,7 @@ func (m *SystemAck) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Error == nil { - m.Error = &SystemError{} + m.Error = &System_Error{} } if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2958,7 +2603,7 @@ func (m *SystemAck) Unmarshal(dAtA []byte) error { } return nil } -func (m *SystemError) Unmarshal(dAtA []byte) error { +func (m *System_Error) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3001,7 +2646,7 @@ func (m *SystemError) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Code |= SystemErrorCode(b&0x7F) << shift + m.Code |= System_Error_Code(b&0x7F) << shift if b < 0x80 { break } @@ -3059,292 +2704,6 @@ func (m *SystemError) Unmarshal(dAtA []byte) error { } return nil } -func (m *Subscription) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Subscription: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Subscription: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SubscribeSpace", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SubscribeSpace == nil { - m.SubscribeSpace = &SubscriptionSubscribeSpace{} - } - if err := m.SubscribeSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnsubscribeSpace", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.UnsubscribeSpace == nil { - m.UnsubscribeSpace = &SubscriptionUnsubscribeSpace{} - } - if err := m.UnsubscribeSpace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSync(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSync - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SubscriptionSubscribeSpace) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SubscribeSpace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SubscribeSpace: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpaceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSync(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSync - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SubscriptionUnsubscribeSpace) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UnsubscribeSpace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnsubscribeSpace: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpaceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSync(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSync - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Sync) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3436,80 +2795,12 @@ func (m *Sync) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Message == nil { - m.Message = &SyncContentValue{} + m.Message = &Sync_ContentValue{} } if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TreeHeader == nil { - m.TreeHeader = &aclpb.Header{} - } - if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TreeId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -3531,7 +2822,7 @@ func (m *Sync) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncContentValue) Unmarshal(dAtA []byte) error { +func (m *Sync_ContentValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3589,11 +2880,11 @@ func (m *SyncContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SyncHeadUpdate{} + v := &Sync_HeadUpdate{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &SyncContentValueValueOfHeadUpdate{v} + m.Value = &Sync_Content_Value_HeadUpdate{v} iNdEx = postIndex case 2: if wireType != 2 { @@ -3624,11 +2915,11 @@ func (m *SyncContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SyncFullRequest{} + v := &Sync_Full_Request{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &SyncContentValueValueOfFullSyncRequest{v} + m.Value = &Sync_Content_Value_FullSyncRequest{v} iNdEx = postIndex case 3: if wireType != 2 { @@ -3659,46 +2950,11 @@ func (m *SyncContentValue) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - v := &SyncFullResponse{} + v := &Sync_Full_Response{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } - m.Value = &SyncContentValueValueOfFullSyncResponse{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AclList", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SyncACLList{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &SyncContentValueValueOfAclList{v} + m.Value = &Sync_Content_Value_FullSyncResponse{v} iNdEx = postIndex default: iNdEx = preIndex @@ -3721,91 +2977,7 @@ func (m *SyncContentValue) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncACLList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ACLList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ACLList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSync - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSync - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSync - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Records = append(m.Records, &aclpb.RawRecord{}) - if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSync(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSync - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { +func (m *Sync_HeadUpdate) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3901,6 +3073,38 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TreeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -3932,6 +3136,42 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TreeHeader == nil { + m.TreeHeader = &treepb.TreeHeader{} + } + if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -3953,7 +3193,7 @@ func (m *SyncHeadUpdate) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncFull) Unmarshal(dAtA []byte) error { +func (m *Sync_Full) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4003,7 +3243,7 @@ func (m *SyncFull) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { +func (m *Sync_Full_Request) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4099,6 +3339,38 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TreeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -4130,6 +3402,42 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TreeHeader == nil { + m.TreeHeader = &treepb.TreeHeader{} + } + if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:]) @@ -4151,7 +3459,7 @@ func (m *SyncFullRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncFullResponse) Unmarshal(dAtA []byte) error { +func (m *Sync_Full_Response) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4247,6 +3555,38 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TreeId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SnapshotPath", wireType) } @@ -4278,6 +3618,42 @@ func (m *SyncFullResponse) Unmarshal(dAtA []byte) error { } m.SnapshotPath = append(m.SnapshotPath, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TreeHeader", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSync + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSync + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSync + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TreeHeader == nil { + m.TreeHeader = &treepb.TreeHeader{} + } + if err := m.TreeHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSync(dAtA[iNdEx:])