change proto generator to std gogo
This commit is contained in:
parent
2e1c2cbc6e
commit
357e889dad
2
go.mod
2
go.mod
@ -32,6 +32,7 @@ require (
|
|||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
|
||||||
github.com/fogleman/gg v1.3.0 // indirect
|
github.com/fogleman/gg v1.3.0 // indirect
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
|
||||||
|
github.com/golang/protobuf v1.5.2 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
|
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
|
||||||
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
|
||||||
github.com/libp2p/go-openssl v0.0.7 // indirect
|
github.com/libp2p/go-openssl v0.0.7 // indirect
|
||||||
@ -52,6 +53,7 @@ require (
|
|||||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||||
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect
|
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect
|
||||||
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
|
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect
|
||||||
|
google.golang.org/protobuf v1.28.1 // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||||
lukechampine.com/blake3 v1.1.6 // indirect
|
lukechampine.com/blake3 v1.1.6 // indirect
|
||||||
|
|||||||
8
go.sum
8
go.sum
@ -32,6 +32,10 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
|||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
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 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
|
||||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
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/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/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c=
|
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/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 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw=
|
||||||
@ -178,6 +182,10 @@ 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-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-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-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
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 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-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 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -20,8 +20,8 @@ var ErrUserAlreadyExists = errors.New("user already exists")
|
|||||||
type ACLState struct {
|
type ACLState struct {
|
||||||
currentReadKeyHash uint64
|
currentReadKeyHash uint64
|
||||||
userReadKeys map[uint64]*symmetric.Key
|
userReadKeys map[uint64]*symmetric.Key
|
||||||
userStates map[string]*aclpb.ACLChangeUserState
|
userStates map[string]*aclpb.ACLChange_UserState
|
||||||
userInvites map[string]*aclpb.ACLChangeUserInvite
|
userInvites map[string]*aclpb.ACLChange_UserInvite
|
||||||
signingPubKeyDecoder signingkey.PubKeyDecoder
|
signingPubKeyDecoder signingkey.PubKeyDecoder
|
||||||
encryptionKey encryptionkey.PrivKey
|
encryptionKey encryptionkey.PrivKey
|
||||||
identity string
|
identity string
|
||||||
@ -35,8 +35,8 @@ func newACLState(
|
|||||||
identity: identity,
|
identity: identity,
|
||||||
encryptionKey: encryptionKey,
|
encryptionKey: encryptionKey,
|
||||||
userReadKeys: make(map[uint64]*symmetric.Key),
|
userReadKeys: make(map[uint64]*symmetric.Key),
|
||||||
userStates: make(map[string]*aclpb.ACLChangeUserState),
|
userStates: make(map[string]*aclpb.ACLChange_UserState),
|
||||||
userInvites: make(map[string]*aclpb.ACLChangeUserInvite),
|
userInvites: make(map[string]*aclpb.ACLChange_UserInvite),
|
||||||
signingPubKeyDecoder: signingPubKeyDecoder,
|
signingPubKeyDecoder: signingPubKeyDecoder,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -50,8 +50,8 @@ func newACLStateFromSnapshotChange(
|
|||||||
identity: identity,
|
identity: identity,
|
||||||
encryptionKey: encryptionKey,
|
encryptionKey: encryptionKey,
|
||||||
userReadKeys: make(map[uint64]*symmetric.Key),
|
userReadKeys: make(map[uint64]*symmetric.Key),
|
||||||
userStates: make(map[string]*aclpb.ACLChangeUserState),
|
userStates: make(map[string]*aclpb.ACLChange_UserState),
|
||||||
userInvites: make(map[string]*aclpb.ACLChangeUserInvite),
|
userInvites: make(map[string]*aclpb.ACLChange_UserInvite),
|
||||||
signingPubKeyDecoder: signingPubKeyDecoder,
|
signingPubKeyDecoder: signingPubKeyDecoder,
|
||||||
}
|
}
|
||||||
err := st.recreateFromSnapshotChange(snapshotChange)
|
err := st.recreateFromSnapshotChange(snapshotChange)
|
||||||
@ -90,13 +90,13 @@ func (st *ACLState) recreateFromSnapshotChange(snapshotChange *aclpb.ACLChange)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *ACLState) makeSnapshot() *aclpb.ACLChangeACLSnapshot {
|
func (st *ACLState) makeSnapshot() *aclpb.ACLChange_ACLSnapshot {
|
||||||
var userStates []*aclpb.ACLChangeUserState
|
var userStates []*aclpb.ACLChange_UserState
|
||||||
for _, st := range st.userStates {
|
for _, st := range st.userStates {
|
||||||
userStates = append(userStates, st)
|
userStates = append(userStates, st)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &aclpb.ACLChangeACLSnapshot{AclState: &aclpb.ACLChangeACLState{
|
return &aclpb.ACLChange_ACLSnapshot{AclState: &aclpb.ACLChange_ACLState{
|
||||||
ReadKeyHashes: nil,
|
ReadKeyHashes: nil,
|
||||||
UserStates: userStates, // TODO: make states and invites in same format
|
UserStates: userStates, // TODO: make states and invites in same format
|
||||||
Invites: st.userInvites,
|
Invites: st.userInvites,
|
||||||
@ -138,7 +138,7 @@ func (st *ACLState) applyChange(change *aclpb.ACLChange) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove changeId, because it is not needed
|
// TODO: remove changeId, because it is not needed
|
||||||
func (st *ACLState) applyChangeContent(ch *aclpb.ACLChangeACLContentValue) error {
|
func (st *ACLState) applyChangeContent(ch *aclpb.ACLChange_ACLContentValue) error {
|
||||||
switch {
|
switch {
|
||||||
case ch.GetUserPermissionChange() != nil:
|
case ch.GetUserPermissionChange() != nil:
|
||||||
return st.applyUserPermissionChange(ch.GetUserPermissionChange())
|
return st.applyUserPermissionChange(ch.GetUserPermissionChange())
|
||||||
@ -157,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 {
|
if _, exists := st.userStates[ch.Identity]; !exists {
|
||||||
return ErrNoSuchUser
|
return ErrNoSuchUser
|
||||||
}
|
}
|
||||||
@ -166,12 +166,12 @@ func (st *ACLState) applyUserPermissionChange(ch *aclpb.ACLChangeUserPermissionC
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *ACLState) applyUserInvite(ch *aclpb.ACLChangeUserInvite) error {
|
func (st *ACLState) applyUserInvite(ch *aclpb.ACLChange_UserInvite) error {
|
||||||
st.userInvites[ch.InviteId] = ch
|
st.userInvites[ch.InviteId] = ch
|
||||||
return nil
|
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]
|
invite, exists := st.userInvites[ch.UserInviteId]
|
||||||
if !exists {
|
if !exists {
|
||||||
return fmt.Errorf("no such invite with id %s", ch.UserInviteId)
|
return fmt.Errorf("no such invite with id %s", ch.UserInviteId)
|
||||||
@ -214,7 +214,7 @@ func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// adding user to the list
|
// adding user to the list
|
||||||
userState := &aclpb.ACLChangeUserState{
|
userState := &aclpb.ACLChange_UserState{
|
||||||
Identity: ch.Identity,
|
Identity: ch.Identity,
|
||||||
EncryptionKey: ch.EncryptionKey,
|
EncryptionKey: ch.EncryptionKey,
|
||||||
EncryptedReadKeys: ch.EncryptedReadKeys,
|
EncryptedReadKeys: ch.EncryptedReadKeys,
|
||||||
@ -225,12 +225,12 @@ func (st *ACLState) applyUserJoin(ch *aclpb.ACLChangeUserJoin) error {
|
|||||||
return nil
|
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 {
|
if _, exists := st.userStates[ch.Identity]; exists {
|
||||||
return ErrUserAlreadyExists
|
return ErrUserAlreadyExists
|
||||||
}
|
}
|
||||||
|
|
||||||
st.userStates[ch.Identity] = &aclpb.ACLChangeUserState{
|
st.userStates[ch.Identity] = &aclpb.ACLChange_UserState{
|
||||||
Identity: ch.Identity,
|
Identity: ch.Identity,
|
||||||
EncryptionKey: ch.EncryptionKey,
|
EncryptionKey: ch.EncryptionKey,
|
||||||
Permissions: ch.Permissions,
|
Permissions: ch.Permissions,
|
||||||
@ -251,7 +251,7 @@ func (st *ACLState) applyUserAdd(ch *aclpb.ACLChangeUserAdd) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *ACLState) applyUserRemove(ch *aclpb.ACLChangeUserRemove) error {
|
func (st *ACLState) applyUserRemove(ch *aclpb.ACLChange_UserRemove) error {
|
||||||
if ch.Identity == st.identity {
|
if ch.Identity == st.identity {
|
||||||
return ErrDocumentForbidden
|
return ErrDocumentForbidden
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ func (st *ACLState) applyUserRemove(ch *aclpb.ACLChangeUserRemove) error {
|
|||||||
return nil
|
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 {
|
if _, exists := st.userStates[ch.Identity]; !exists {
|
||||||
return ErrNoSuchUser
|
return ErrNoSuchUser
|
||||||
}
|
}
|
||||||
@ -309,7 +309,7 @@ func (st *ACLState) decryptReadKeyAndHash(msg []byte) (*symmetric.Key, uint64, e
|
|||||||
return key, hasher.Sum64(), nil
|
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]
|
state, exists := st.userStates[identity]
|
||||||
if !exists {
|
if !exists {
|
||||||
return false
|
return false
|
||||||
@ -329,7 +329,7 @@ func (st *ACLState) isUserAdd(ch *aclpb.ACLChange) bool {
|
|||||||
return ch.AclData.GetAclContent() != nil && userAdd != nil && userAdd.GetIdentity() == ch.Identity
|
return ch.AclData.GetAclContent() != nil && userAdd != nil && userAdd.GetIdentity() == ch.Identity
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *ACLState) getPermissionDecreasedUsers(ch *aclpb.ACLChange) (identities []*aclpb.ACLChangeUserPermissionChange) {
|
func (st *ACLState) getPermissionDecreasedUsers(ch *aclpb.ACLChange) (identities []*aclpb.ACLChange_UserPermissionChange) {
|
||||||
// this should be called after general checks are completed
|
// this should be called after general checks are completed
|
||||||
if ch.GetAclData().GetAclContent() == nil {
|
if ch.GetAclData().GetAclContent() == nil {
|
||||||
return nil
|
return nil
|
||||||
@ -343,7 +343,7 @@ func (st *ACLState) getPermissionDecreasedUsers(ch *aclpb.ACLChange) (identities
|
|||||||
currentState := st.userStates[content.Identity]
|
currentState := st.userStates[content.Identity]
|
||||||
// the comparison works in different direction :-)
|
// the comparison works in different direction :-)
|
||||||
if content.Permissions > currentState.Permissions {
|
if content.Permissions > currentState.Permissions {
|
||||||
identities = append(identities, &aclpb.ACLChangeUserPermissionChange{
|
identities = append(identities, &aclpb.ACLChange_UserPermissionChange{
|
||||||
Identity: content.Identity,
|
Identity: content.Identity,
|
||||||
Permissions: content.Permissions,
|
Permissions: content.Permissions,
|
||||||
})
|
})
|
||||||
@ -351,7 +351,7 @@ func (st *ACLState) getPermissionDecreasedUsers(ch *aclpb.ACLChange) (identities
|
|||||||
}
|
}
|
||||||
if c.GetUserRemove() != nil {
|
if c.GetUserRemove() != nil {
|
||||||
content := c.GetUserRemove()
|
content := c.GetUserRemove()
|
||||||
identities = append(identities, &aclpb.ACLChangeUserPermissionChange{
|
identities = append(identities, &aclpb.ACLChange_UserPermissionChange{
|
||||||
Identity: content.Identity,
|
Identity: content.Identity,
|
||||||
Permissions: aclpb.ACLChange_Removed,
|
Permissions: aclpb.ACLChange_Removed,
|
||||||
})
|
})
|
||||||
@ -405,7 +405,7 @@ func (st *ACLState) equal(other *ACLState) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (st *ACLState) GetUserStates() map[string]*aclpb.ACLChangeUserState {
|
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
|
// TODO: we should provide better API that would not allow to change this map from the outside
|
||||||
return st.userStates
|
return st.userStates
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ type aclStateBuilder struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type decreasedPermissionsParameters struct {
|
type decreasedPermissionsParameters struct {
|
||||||
users []*aclpb.ACLChangeUserPermissionChange
|
users []*aclpb.ACLChange_UserPermissionChange
|
||||||
startChange string
|
startChange string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
type ChangeContent struct {
|
type ChangeContent struct {
|
||||||
ChangesData proto.Marshaler
|
ChangesData proto.Marshaler
|
||||||
ACLData *aclpb.ACLChangeACLData
|
ACLData *aclpb.ACLChange_ACLData
|
||||||
Id string // TODO: this is just for testing, because id should be created automatically from content
|
Id string // TODO: this is just for testing, because id should be created automatically from content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ import (
|
|||||||
type MarshalledChange = []byte
|
type MarshalledChange = []byte
|
||||||
|
|
||||||
type ACLChangeBuilder interface {
|
type ACLChangeBuilder interface {
|
||||||
UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChangeUserPermissions) error
|
UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChange_UserPermissions) error
|
||||||
AddId(id string) // TODO: this is only for testing
|
AddId(id string) // TODO: this is only for testing
|
||||||
SetMakeSnapshot(bool) // TODO: who should decide this? probably ACLTree so we can delete it
|
SetMakeSnapshot(bool) // TODO: who should decide this? probably ACLTree so we can delete it
|
||||||
}
|
}
|
||||||
@ -29,7 +29,7 @@ type changeBuilder struct {
|
|||||||
tree *Tree
|
tree *Tree
|
||||||
acc *account.AccountData
|
acc *account.AccountData
|
||||||
|
|
||||||
aclData *aclpb.ACLChangeACLData
|
aclData *aclpb.ACLChange_ACLData
|
||||||
changeContent proto.Marshaler
|
changeContent proto.Marshaler
|
||||||
id string
|
id string
|
||||||
makeSnapshot bool
|
makeSnapshot bool
|
||||||
@ -46,7 +46,7 @@ func (c *changeBuilder) Init(state *ACLState, tree *Tree, acc *account.AccountDa
|
|||||||
c.tree = tree
|
c.tree = tree
|
||||||
c.acc = acc
|
c.acc = acc
|
||||||
|
|
||||||
c.aclData = &aclpb.ACLChangeACLData{}
|
c.aclData = &aclpb.ACLChange_ACLData{}
|
||||||
// setting read key for further encryption etc
|
// setting read key for further encryption etc
|
||||||
if state.currentReadKeyHash == 0 {
|
if state.currentReadKeyHash == 0 {
|
||||||
c.readKey, _ = symmetric.NewRandom()
|
c.readKey, _ = symmetric.NewRandom()
|
||||||
@ -68,7 +68,7 @@ func (c *changeBuilder) SetMakeSnapshot(b bool) {
|
|||||||
c.makeSnapshot = b
|
c.makeSnapshot = b
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *changeBuilder) UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChangeUserPermissions) error {
|
func (c *changeBuilder) UserAdd(identity string, encryptionKey encryptionkey.PubKey, permissions aclpb.ACLChange_UserPermissions) error {
|
||||||
var allKeys []*symmetric.Key
|
var allKeys []*symmetric.Key
|
||||||
if c.aclState.currentReadKeyHash != 0 {
|
if c.aclState.currentReadKeyHash != 0 {
|
||||||
for _, key := range c.aclState.userReadKeys {
|
for _, key := range c.aclState.userReadKeys {
|
||||||
@ -91,9 +91,9 @@ func (c *changeBuilder) UserAdd(identity string, encryptionKey encryptionkey.Pub
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
ch := &aclpb.ACLChangeACLContentValue{
|
ch := &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserAdd{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserAdd{
|
||||||
UserAdd: &aclpb.ACLChangeUserAdd{
|
UserAdd: &aclpb.ACLChange_UserAdd{
|
||||||
Identity: identity,
|
Identity: identity,
|
||||||
EncryptionKey: rawKey,
|
EncryptionKey: rawKey,
|
||||||
EncryptedReadKeys: encryptedKeys,
|
EncryptedReadKeys: encryptedKeys,
|
||||||
|
|||||||
@ -60,7 +60,7 @@ func (t *Tree) Graph() (data string, err error) {
|
|||||||
if c.Content.AclData != nil {
|
if c.Content.AclData != nil {
|
||||||
for _, chc := range c.Content.AclData.AclContent {
|
for _, chc := range c.Content.AclData.AclContent {
|
||||||
tp := fmt.Sprintf("%T", chc.Value)
|
tp := fmt.Sprintf("%T", chc.Value)
|
||||||
tp = strings.Replace(tp, "ACLChangeACLContentValueValueOf", "", 1)
|
tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1)
|
||||||
res := ""
|
res := ""
|
||||||
for _, ts := range tp {
|
for _, ts := range tp {
|
||||||
if unicode.IsUpper(ts) {
|
if unicode.IsUpper(ts) {
|
||||||
@ -74,7 +74,7 @@ func (t *Tree) Graph() (data string, err error) {
|
|||||||
// TODO: add some parser to provide custom unmarshalling for the document change
|
// TODO: add some parser to provide custom unmarshalling for the document change
|
||||||
//for _, chc := range c.DecryptedDocumentChange.Content {
|
//for _, chc := range c.DecryptedDocumentChange.Content {
|
||||||
// tp := fmt.Sprintf("%T", chc.Value)
|
// tp := fmt.Sprintf("%T", chc.Value)
|
||||||
// tp = strings.Replace(tp, "ChangeContentValueOf", "", 1)
|
// tp = strings.Replace(tp, "ChangeContent_Value_", "", 1)
|
||||||
// res := ""
|
// res := ""
|
||||||
// for _, ts := range tp {
|
// for _, ts := range tp {
|
||||||
// if unicode.IsUpper(ts) {
|
// if unicode.IsUpper(ts) {
|
||||||
|
|||||||
@ -34,8 +34,8 @@ func (p *plainTextDocument) Text() string {
|
|||||||
func (p *plainTextDocument) AddText(ctx context.Context, text string) error {
|
func (p *plainTextDocument) AddText(ctx context.Context, text string) error {
|
||||||
_, err := p.aclTree.AddContent(ctx, func(builder acltree.ChangeBuilder) error {
|
_, err := p.aclTree.AddContent(ctx, func(builder acltree.ChangeBuilder) error {
|
||||||
builder.AddChangeContent(
|
builder.AddChangeContent(
|
||||||
&testchangepb.PlainTextChangeData{
|
&testchangepb.PlainTextChange_Data{
|
||||||
Content: []*testchangepb.PlainTextChangeContent{
|
Content: []*testchangepb.PlainTextChange_Content{
|
||||||
createAppendTextChangeContent(text),
|
createAppendTextChangeContent(text),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -150,18 +150,18 @@ func NewPlainTextDocument(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createInitialChangeContent(text string) proto.Marshaler {
|
func createInitialChangeContent(text string) proto.Marshaler {
|
||||||
return &testchangepb.PlainTextChangeData{
|
return &testchangepb.PlainTextChange_Data{
|
||||||
Content: []*testchangepb.PlainTextChangeContent{
|
Content: []*testchangepb.PlainTextChange_Content{
|
||||||
createAppendTextChangeContent(text),
|
createAppendTextChangeContent(text),
|
||||||
},
|
},
|
||||||
Snapshot: &testchangepb.PlainTextChangeSnapshot{Text: text},
|
Snapshot: &testchangepb.PlainTextChange_Snapshot{Text: text},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createAppendTextChangeContent(text string) *testchangepb.PlainTextChangeContent {
|
func createAppendTextChangeContent(text string) *testchangepb.PlainTextChange_Content {
|
||||||
return &testchangepb.PlainTextChangeContent{
|
return &testchangepb.PlainTextChange_Content{
|
||||||
Value: &testchangepb.PlainTextChangeContentValueOfTextAppend{
|
Value: &testchangepb.PlainTextChange_Content_TextAppend{
|
||||||
TextAppend: &testchangepb.PlainTextChangeTextAppend{
|
TextAppend: &testchangepb.PlainTextChange_TextAppend{
|
||||||
Text: text,
|
Text: text,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -20,7 +20,7 @@ func NewDocumentState(text string, id string) *DocumentState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BuildDocumentStateFromChange(change []byte, id string) (*DocumentState, error) {
|
func BuildDocumentStateFromChange(change []byte, id string) (*DocumentState, error) {
|
||||||
var changesData testchangepb.PlainTextChangeData
|
var changesData testchangepb.PlainTextChange_Data
|
||||||
err := proto.Unmarshal(change, &changesData)
|
err := proto.Unmarshal(change, &changesData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -33,7 +33,7 @@ func BuildDocumentStateFromChange(change []byte, id string) (*DocumentState, err
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *DocumentState) ApplyChange(change []byte, id string) (*DocumentState, error) {
|
func (p *DocumentState) ApplyChange(change []byte, id string) (*DocumentState, error) {
|
||||||
var changesData testchangepb.PlainTextChangeData
|
var changesData testchangepb.PlainTextChange_Data
|
||||||
err := proto.Unmarshal(change, &changesData)
|
err := proto.Unmarshal(change, &changesData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -49,7 +49,7 @@ func (p *DocumentState) ApplyChange(change []byte, id string) (*DocumentState, e
|
|||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *DocumentState) applyChange(ch *testchangepb.PlainTextChangeContent) error {
|
func (p *DocumentState) applyChange(ch *testchangepb.PlainTextChange_Content) error {
|
||||||
switch {
|
switch {
|
||||||
case ch.GetTextAppend() != nil:
|
case ch.GetTextAppend() != nil:
|
||||||
text := ch.GetTextAppend().GetText()
|
text := ch.GetTextAppend().GetText()
|
||||||
|
|||||||
@ -58,24 +58,25 @@ func (m *PlainTextChange) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_PlainTextChange proto.InternalMessageInfo
|
var xxx_messageInfo_PlainTextChange proto.InternalMessageInfo
|
||||||
|
|
||||||
type PlainTextChangeContent struct {
|
type PlainTextChange_Content struct {
|
||||||
// Types that are valid to be assigned to Value:
|
// 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 *PlainTextChange_Content) Reset() { *m = PlainTextChange_Content{} }
|
||||||
func (m *PlainTextChangeContent) String() string { return proto.CompactTextString(m) }
|
func (m *PlainTextChange_Content) String() string { return proto.CompactTextString(m) }
|
||||||
func (*PlainTextChangeContent) ProtoMessage() {}
|
func (*PlainTextChange_Content) ProtoMessage() {}
|
||||||
func (*PlainTextChangeContent) Descriptor() ([]byte, []int) {
|
func (*PlainTextChange_Content) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_c07268f9f08f2beb, []int{0, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_PlainTextChangeContent.Marshal(b, m, deterministic)
|
return xxx_messageInfo_PlainTextChange_Content.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -85,67 +86,67 @@ func (m *PlainTextChangeContent) XXX_Marshal(b []byte, deterministic bool) ([]by
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeContent) XXX_Merge(src proto.Message) {
|
func (m *PlainTextChange_Content) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_PlainTextChangeContent.Merge(m, src)
|
xxx_messageInfo_PlainTextChange_Content.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeContent) XXX_Size() int {
|
func (m *PlainTextChange_Content) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeContent) XXX_DiscardUnknown() {
|
func (m *PlainTextChange_Content) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_PlainTextChangeContent.DiscardUnknown(m)
|
xxx_messageInfo_PlainTextChange_Content.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_PlainTextChangeContent proto.InternalMessageInfo
|
var xxx_messageInfo_PlainTextChange_Content proto.InternalMessageInfo
|
||||||
|
|
||||||
type IsPlainTextChangeContentValue interface {
|
type isPlainTextChange_Content_Value interface {
|
||||||
IsPlainTextChangeContentValue()
|
isPlainTextChange_Content_Value()
|
||||||
MarshalTo([]byte) (int, error)
|
MarshalTo([]byte) (int, error)
|
||||||
Size() int
|
Size() int
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlainTextChangeContentValueOfTextAppend struct {
|
type PlainTextChange_Content_TextAppend struct {
|
||||||
TextAppend *PlainTextChangeTextAppend `protobuf:"bytes,1,opt,name=textAppend,proto3,oneof" json:"textAppend,omitempty"`
|
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 {
|
if m != nil {
|
||||||
return m.Value
|
return m.Value
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeContent) GetTextAppend() *PlainTextChangeTextAppend {
|
func (m *PlainTextChange_Content) GetTextAppend() *PlainTextChange_TextAppend {
|
||||||
if x, ok := m.GetValue().(*PlainTextChangeContentValueOfTextAppend); ok {
|
if x, ok := m.GetValue().(*PlainTextChange_Content_TextAppend); ok {
|
||||||
return x.TextAppend
|
return x.TextAppend
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||||
func (*PlainTextChangeContent) XXX_OneofWrappers() []interface{} {
|
func (*PlainTextChange_Content) XXX_OneofWrappers() []interface{} {
|
||||||
return []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"`
|
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeTextAppend) Reset() { *m = PlainTextChangeTextAppend{} }
|
func (m *PlainTextChange_TextAppend) Reset() { *m = PlainTextChange_TextAppend{} }
|
||||||
func (m *PlainTextChangeTextAppend) String() string { return proto.CompactTextString(m) }
|
func (m *PlainTextChange_TextAppend) String() string { return proto.CompactTextString(m) }
|
||||||
func (*PlainTextChangeTextAppend) ProtoMessage() {}
|
func (*PlainTextChange_TextAppend) ProtoMessage() {}
|
||||||
func (*PlainTextChangeTextAppend) Descriptor() ([]byte, []int) {
|
func (*PlainTextChange_TextAppend) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_c07268f9f08f2beb, []int{0, 1}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_PlainTextChangeTextAppend.Marshal(b, m, deterministic)
|
return xxx_messageInfo_PlainTextChange_TextAppend.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -155,41 +156,41 @@ func (m *PlainTextChangeTextAppend) XXX_Marshal(b []byte, deterministic bool) ([
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeTextAppend) XXX_Merge(src proto.Message) {
|
func (m *PlainTextChange_TextAppend) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_PlainTextChangeTextAppend.Merge(m, src)
|
xxx_messageInfo_PlainTextChange_TextAppend.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeTextAppend) XXX_Size() int {
|
func (m *PlainTextChange_TextAppend) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeTextAppend) XXX_DiscardUnknown() {
|
func (m *PlainTextChange_TextAppend) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_PlainTextChangeTextAppend.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Text
|
return m.Text
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlainTextChangeSnapshot struct {
|
type PlainTextChange_Snapshot struct {
|
||||||
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeSnapshot) Reset() { *m = PlainTextChangeSnapshot{} }
|
func (m *PlainTextChange_Snapshot) Reset() { *m = PlainTextChange_Snapshot{} }
|
||||||
func (m *PlainTextChangeSnapshot) String() string { return proto.CompactTextString(m) }
|
func (m *PlainTextChange_Snapshot) String() string { return proto.CompactTextString(m) }
|
||||||
func (*PlainTextChangeSnapshot) ProtoMessage() {}
|
func (*PlainTextChange_Snapshot) ProtoMessage() {}
|
||||||
func (*PlainTextChangeSnapshot) Descriptor() ([]byte, []int) {
|
func (*PlainTextChange_Snapshot) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_c07268f9f08f2beb, []int{0, 2}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_PlainTextChangeSnapshot.Marshal(b, m, deterministic)
|
return xxx_messageInfo_PlainTextChange_Snapshot.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -199,42 +200,42 @@ func (m *PlainTextChangeSnapshot) XXX_Marshal(b []byte, deterministic bool) ([]b
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeSnapshot) XXX_Merge(src proto.Message) {
|
func (m *PlainTextChange_Snapshot) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_PlainTextChangeSnapshot.Merge(m, src)
|
xxx_messageInfo_PlainTextChange_Snapshot.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeSnapshot) XXX_Size() int {
|
func (m *PlainTextChange_Snapshot) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeSnapshot) XXX_DiscardUnknown() {
|
func (m *PlainTextChange_Snapshot) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_PlainTextChangeSnapshot.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Text
|
return m.Text
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlainTextChangeData struct {
|
type PlainTextChange_Data struct {
|
||||||
Content []*PlainTextChangeContent `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"`
|
Content []*PlainTextChange_Content `protobuf:"bytes,1,rep,name=content,proto3" json:"content,omitempty"`
|
||||||
Snapshot *PlainTextChangeSnapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
|
Snapshot *PlainTextChange_Snapshot `protobuf:"bytes,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeData) Reset() { *m = PlainTextChangeData{} }
|
func (m *PlainTextChange_Data) Reset() { *m = PlainTextChange_Data{} }
|
||||||
func (m *PlainTextChangeData) String() string { return proto.CompactTextString(m) }
|
func (m *PlainTextChange_Data) String() string { return proto.CompactTextString(m) }
|
||||||
func (*PlainTextChangeData) ProtoMessage() {}
|
func (*PlainTextChange_Data) ProtoMessage() {}
|
||||||
func (*PlainTextChangeData) Descriptor() ([]byte, []int) {
|
func (*PlainTextChange_Data) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_c07268f9f08f2beb, []int{0, 3}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_PlainTextChangeData.Marshal(b, m, deterministic)
|
return xxx_messageInfo_PlainTextChange_Data.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -244,26 +245,26 @@ func (m *PlainTextChangeData) XXX_Marshal(b []byte, deterministic bool) ([]byte,
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeData) XXX_Merge(src proto.Message) {
|
func (m *PlainTextChange_Data) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_PlainTextChangeData.Merge(m, src)
|
xxx_messageInfo_PlainTextChange_Data.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeData) XXX_Size() int {
|
func (m *PlainTextChange_Data) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeData) XXX_DiscardUnknown() {
|
func (m *PlainTextChange_Data) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_PlainTextChangeData.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Content
|
return m.Content
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeData) GetSnapshot() *PlainTextChangeSnapshot {
|
func (m *PlainTextChange_Data) GetSnapshot() *PlainTextChange_Snapshot {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Snapshot
|
return m.Snapshot
|
||||||
}
|
}
|
||||||
@ -272,10 +273,10 @@ func (m *PlainTextChangeData) GetSnapshot() *PlainTextChangeSnapshot {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*PlainTextChange)(nil), "anytype.PlainTextChange")
|
proto.RegisterType((*PlainTextChange)(nil), "anytype.PlainTextChange")
|
||||||
proto.RegisterType((*PlainTextChangeContent)(nil), "anytype.PlainTextChange.Content")
|
proto.RegisterType((*PlainTextChange_Content)(nil), "anytype.PlainTextChange.Content")
|
||||||
proto.RegisterType((*PlainTextChangeTextAppend)(nil), "anytype.PlainTextChange.TextAppend")
|
proto.RegisterType((*PlainTextChange_TextAppend)(nil), "anytype.PlainTextChange.TextAppend")
|
||||||
proto.RegisterType((*PlainTextChangeSnapshot)(nil), "anytype.PlainTextChange.Snapshot")
|
proto.RegisterType((*PlainTextChange_Snapshot)(nil), "anytype.PlainTextChange.Snapshot")
|
||||||
proto.RegisterType((*PlainTextChangeData)(nil), "anytype.PlainTextChange.Data")
|
proto.RegisterType((*PlainTextChange_Data)(nil), "anytype.PlainTextChange.Data")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -327,7 +328,7 @@ func (m *PlainTextChange) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -337,12 +338,12 @@ func (m *PlainTextChangeContent) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeContent) MarshalTo(dAtA []byte) (int, error) {
|
func (m *PlainTextChange_Content) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -359,12 +360,12 @@ func (m *PlainTextChangeContent) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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)
|
i := len(dAtA)
|
||||||
if m.TextAppend != nil {
|
if m.TextAppend != nil {
|
||||||
{
|
{
|
||||||
@ -380,7 +381,7 @@ func (m *PlainTextChangeContentValueOfTextAppend) MarshalToSizedBuffer(dAtA []by
|
|||||||
}
|
}
|
||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -390,12 +391,12 @@ func (m *PlainTextChangeTextAppend) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeTextAppend) MarshalTo(dAtA []byte) (int, error) {
|
func (m *PlainTextChange_TextAppend) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -410,7 +411,7 @@ func (m *PlainTextChangeTextAppend) MarshalToSizedBuffer(dAtA []byte) (int, erro
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -420,12 +421,12 @@ func (m *PlainTextChangeSnapshot) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeSnapshot) MarshalTo(dAtA []byte) (int, error) {
|
func (m *PlainTextChange_Snapshot) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -440,7 +441,7 @@ func (m *PlainTextChangeSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -450,12 +451,12 @@ func (m *PlainTextChangeData) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeData) MarshalTo(dAtA []byte) (int, error) {
|
func (m *PlainTextChange_Data) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -509,7 +510,7 @@ func (m *PlainTextChange) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeContent) Size() (n int) {
|
func (m *PlainTextChange_Content) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -521,7 +522,7 @@ func (m *PlainTextChangeContent) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeContentValueOfTextAppend) Size() (n int) {
|
func (m *PlainTextChange_Content_TextAppend) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -533,7 +534,7 @@ func (m *PlainTextChangeContentValueOfTextAppend) Size() (n int) {
|
|||||||
}
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeTextAppend) Size() (n int) {
|
func (m *PlainTextChange_TextAppend) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -546,7 +547,7 @@ func (m *PlainTextChangeTextAppend) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeSnapshot) Size() (n int) {
|
func (m *PlainTextChange_Snapshot) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -559,7 +560,7 @@ func (m *PlainTextChangeSnapshot) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *PlainTextChangeData) Size() (n int) {
|
func (m *PlainTextChange_Data) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -634,7 +635,7 @@ func (m *PlainTextChange) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error {
|
func (m *PlainTextChange_Content) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -692,11 +693,11 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
v := &PlainTextChangeTextAppend{}
|
v := &PlainTextChange_TextAppend{}
|
||||||
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
m.Value = &PlainTextChangeContentValueOfTextAppend{v}
|
m.Value = &PlainTextChange_Content_TextAppend{v}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
@ -719,7 +720,7 @@ func (m *PlainTextChangeContent) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error {
|
func (m *PlainTextChange_TextAppend) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -801,7 +802,7 @@ func (m *PlainTextChangeTextAppend) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error {
|
func (m *PlainTextChange_Snapshot) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -883,7 +884,7 @@ func (m *PlainTextChangeSnapshot) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error {
|
func (m *PlainTextChange_Data) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -941,7 +942,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
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 {
|
if err := m.Content[len(m.Content)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -976,7 +977,7 @@ func (m *PlainTextChangeData) Unmarshal(dAtA []byte) error {
|
|||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Snapshot == nil {
|
if m.Snapshot == nil {
|
||||||
m.Snapshot = &PlainTextChangeSnapshot{}
|
m.Snapshot = &PlainTextChange_Snapshot{}
|
||||||
}
|
}
|
||||||
if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -239,12 +239,12 @@ func (t *TreeStorageBuilder) parseChange(ch *Change) *treeChange {
|
|||||||
aclChange := &aclpb.ACLChange{}
|
aclChange := &aclpb.ACLChange{}
|
||||||
aclChange.Identity = t.keychain.GetIdentity(ch.Identity)
|
aclChange.Identity = t.keychain.GetIdentity(ch.Identity)
|
||||||
if len(ch.AclChanges) > 0 || ch.AclSnapshot != nil {
|
if len(ch.AclChanges) > 0 || ch.AclSnapshot != nil {
|
||||||
aclChange.AclData = &aclpb.ACLChangeACLData{}
|
aclChange.AclData = &aclpb.ACLChange_ACLData{}
|
||||||
if ch.AclSnapshot != nil {
|
if ch.AclSnapshot != nil {
|
||||||
aclChange.AclData.AclSnapshot = t.parseACLSnapshot(ch.AclSnapshot)
|
aclChange.AclData.AclSnapshot = t.parseACLSnapshot(ch.AclSnapshot)
|
||||||
}
|
}
|
||||||
if ch.AclChanges != nil {
|
if ch.AclChanges != nil {
|
||||||
var aclChangeContents []*aclpb.ACLChangeACLContentValue
|
var aclChangeContents []*aclpb.ACLChange_ACLContentValue
|
||||||
for _, ch := range ch.AclChanges {
|
for _, ch := range ch.AclChanges {
|
||||||
aclChangeContent := t.parseACLChange(ch)
|
aclChangeContent := t.parseACLChange(ch)
|
||||||
aclChangeContents = append(aclChangeContents, aclChangeContent)
|
aclChangeContents = append(aclChangeContents, aclChangeContent)
|
||||||
@ -253,12 +253,12 @@ func (t *TreeStorageBuilder) parseChange(ch *Change) *treeChange {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(ch.Changes) > 0 || ch.Snapshot != nil {
|
if len(ch.Changes) > 0 || ch.Snapshot != nil {
|
||||||
changesData := &testpb.PlainTextChangeData{}
|
changesData := &testpb.PlainTextChange_Data{}
|
||||||
if ch.Snapshot != nil {
|
if ch.Snapshot != nil {
|
||||||
changesData.Snapshot = t.parseChangeSnapshot(ch.Snapshot)
|
changesData.Snapshot = t.parseChangeSnapshot(ch.Snapshot)
|
||||||
}
|
}
|
||||||
if len(ch.Changes) > 0 {
|
if len(ch.Changes) > 0 {
|
||||||
var changeContents []*testpb.PlainTextChangeContent
|
var changeContents []*testpb.PlainTextChange_Content
|
||||||
for _, ch := range ch.Changes {
|
for _, ch := range ch.Changes {
|
||||||
aclChangeContent := t.parseDocumentChange(ch)
|
aclChangeContent := t.parseDocumentChange(ch)
|
||||||
changeContents = append(changeContents, aclChangeContent)
|
changeContents = append(changeContents, aclChangeContent)
|
||||||
@ -283,16 +283,16 @@ func (t *TreeStorageBuilder) parseTreeId(description *TreeDescription) string {
|
|||||||
return description.Author + ".tree.id"
|
return description.Author + ".tree.id"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TreeStorageBuilder) parseChangeSnapshot(s *PlainTextSnapshot) *testpb.PlainTextChangeSnapshot {
|
func (t *TreeStorageBuilder) parseChangeSnapshot(s *PlainTextSnapshot) *testpb.PlainTextChange_Snapshot {
|
||||||
return &testpb.PlainTextChangeSnapshot{
|
return &testpb.PlainTextChange_Snapshot{
|
||||||
Text: s.Text,
|
Text: s.Text,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TreeStorageBuilder) parseACLSnapshot(s *ACLSnapshot) *aclpb.ACLChangeACLSnapshot {
|
func (t *TreeStorageBuilder) parseACLSnapshot(s *ACLSnapshot) *aclpb.ACLChange_ACLSnapshot {
|
||||||
newState := &aclpb.ACLChangeACLState{}
|
newState := &aclpb.ACLChange_ACLState{}
|
||||||
for _, state := range s.UserStates {
|
for _, state := range s.UserStates {
|
||||||
aclUserState := &aclpb.ACLChangeUserState{}
|
aclUserState := &aclpb.ACLChange_UserState{}
|
||||||
aclUserState.Identity = t.keychain.GetIdentity(state.Identity)
|
aclUserState.Identity = t.keychain.GetIdentity(state.Identity)
|
||||||
|
|
||||||
encKey := t.keychain.
|
encKey := t.keychain.
|
||||||
@ -304,17 +304,17 @@ func (t *TreeStorageBuilder) parseACLSnapshot(s *ACLSnapshot) *aclpb.ACLChangeAC
|
|||||||
aclUserState.Permissions = t.convertPermission(state.Permissions)
|
aclUserState.Permissions = t.convertPermission(state.Permissions)
|
||||||
newState.UserStates = append(newState.UserStates, aclUserState)
|
newState.UserStates = append(newState.UserStates, aclUserState)
|
||||||
}
|
}
|
||||||
return &aclpb.ACLChangeACLSnapshot{
|
return &aclpb.ACLChange_ACLSnapshot{
|
||||||
AclState: newState,
|
AclState: newState,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TreeStorageBuilder) parseDocumentChange(ch *PlainTextChange) (convCh *testpb.PlainTextChangeContent) {
|
func (t *TreeStorageBuilder) parseDocumentChange(ch *PlainTextChange) (convCh *testpb.PlainTextChange_Content) {
|
||||||
switch {
|
switch {
|
||||||
case ch.TextAppend != nil:
|
case ch.TextAppend != nil:
|
||||||
convCh = &testpb.PlainTextChangeContent{
|
convCh = &testpb.PlainTextChange_Content{
|
||||||
Value: &testpb.PlainTextChangeContentValueOfTextAppend{
|
Value: &testpb.PlainTextChange_Content_TextAppend{
|
||||||
TextAppend: &testpb.PlainTextChangeTextAppend{
|
TextAppend: &testpb.PlainTextChange_TextAppend{
|
||||||
Text: ch.TextAppend.Text,
|
Text: ch.TextAppend.Text,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -327,7 +327,7 @@ func (t *TreeStorageBuilder) parseDocumentChange(ch *PlainTextChange) (convCh *t
|
|||||||
return convCh
|
return convCh
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLChangeACLContentValue) {
|
func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLChange_ACLContentValue) {
|
||||||
switch {
|
switch {
|
||||||
case ch.UserAdd != nil:
|
case ch.UserAdd != nil:
|
||||||
add := ch.UserAdd
|
add := ch.UserAdd
|
||||||
@ -336,9 +336,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
GetKey(add.EncryptionKey).(encryptionkey.PrivKey)
|
GetKey(add.EncryptionKey).(encryptionkey.PrivKey)
|
||||||
rawKey, _ := encKey.GetPublic().Raw()
|
rawKey, _ := encKey.GetPublic().Raw()
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserAdd{
|
Value: &aclpb.ACLChange_ACLContent_Value_UserAdd{
|
||||||
UserAdd: &aclpb.ACLChangeUserAdd{
|
UserAdd: &aclpb.ACLChange_UserAdd{
|
||||||
Identity: t.keychain.GetIdentity(add.Identity),
|
Identity: t.keychain.GetIdentity(add.Identity),
|
||||||
EncryptionKey: rawKey,
|
EncryptionKey: rawKey,
|
||||||
EncryptedReadKeys: t.encryptReadKeys(add.EncryptedReadKeys, encKey),
|
EncryptedReadKeys: t.encryptReadKeys(add.EncryptedReadKeys, encKey),
|
||||||
@ -360,9 +360,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserJoin{
|
Value: &aclpb.ACLChange_ACLContentValueValueOfUserJoin{
|
||||||
UserJoin: &aclpb.ACLChangeUserJoin{
|
UserJoin: &aclpb.ACLChange_UserJoin{
|
||||||
Identity: t.keychain.GetIdentity(join.Identity),
|
Identity: t.keychain.GetIdentity(join.Identity),
|
||||||
EncryptionKey: rawKey,
|
EncryptionKey: rawKey,
|
||||||
AcceptSignature: signature,
|
AcceptSignature: signature,
|
||||||
@ -378,9 +378,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
GetKey(invite.EncryptionKey).(encryptionkey.PrivKey)
|
GetKey(invite.EncryptionKey).(encryptionkey.PrivKey)
|
||||||
rawEncKey, _ := encKey.GetPublic().Raw()
|
rawEncKey, _ := encKey.GetPublic().Raw()
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserInvite{
|
Value: &aclpb.ACLChange_ACLContentValueValueOfUserInvite{
|
||||||
UserInvite: &aclpb.ACLChangeUserInvite{
|
UserInvite: &aclpb.ACLChange_UserInvite{
|
||||||
AcceptPublicKey: rawAcceptKey,
|
AcceptPublicKey: rawAcceptKey,
|
||||||
EncryptPublicKey: rawEncKey,
|
EncryptPublicKey: rawEncKey,
|
||||||
EncryptedReadKeys: t.encryptReadKeys(invite.EncryptedReadKeys, encKey),
|
EncryptedReadKeys: t.encryptReadKeys(invite.EncryptedReadKeys, encKey),
|
||||||
@ -392,9 +392,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
case ch.UserConfirm != nil:
|
case ch.UserConfirm != nil:
|
||||||
confirm := ch.UserConfirm
|
confirm := ch.UserConfirm
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserConfirm{
|
Value: &aclpb.ACLChange_ACLContentValueValueOfUserConfirm{
|
||||||
UserConfirm: &aclpb.ACLChangeUserConfirm{
|
UserConfirm: &aclpb.ACLChange_UserConfirm{
|
||||||
Identity: t.keychain.GetIdentity(confirm.Identity),
|
Identity: t.keychain.GetIdentity(confirm.Identity),
|
||||||
UserAddId: confirm.UserAddId,
|
UserAddId: confirm.UserAddId,
|
||||||
},
|
},
|
||||||
@ -403,9 +403,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
case ch.UserPermissionChange != nil:
|
case ch.UserPermissionChange != nil:
|
||||||
permissionChange := ch.UserPermissionChange
|
permissionChange := ch.UserPermissionChange
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserPermissionChange{
|
Value: &aclpb.ACLChange_ACLContentValueValueOfUserPermissionChange{
|
||||||
UserPermissionChange: &aclpb.ACLChangeUserPermissionChange{
|
UserPermissionChange: &aclpb.ACLChange_UserPermissionChange{
|
||||||
Identity: t.keychain.GetIdentity(permissionChange.Identity),
|
Identity: t.keychain.GetIdentity(permissionChange.Identity),
|
||||||
Permissions: t.convertPermission(permissionChange.Permission),
|
Permissions: t.convertPermission(permissionChange.Permission),
|
||||||
},
|
},
|
||||||
@ -432,9 +432,9 @@ func (t *TreeStorageBuilder) parseACLChange(ch *ACLChange) (convCh *aclpb.ACLCha
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
convCh = &aclpb.ACLChangeACLContentValue{
|
convCh = &aclpb.ACLChange_ACLContentValue{
|
||||||
Value: &aclpb.ACLChangeACLContentValueValueOfUserRemove{
|
Value: &aclpb.ACLChange_ACLContentValueValueOfUserRemove{
|
||||||
UserRemove: &aclpb.ACLChangeUserRemove{
|
UserRemove: &aclpb.ACLChange_UserRemove{
|
||||||
Identity: t.keychain.GetIdentity(remove.RemovedIdentity),
|
Identity: t.keychain.GetIdentity(remove.RemovedIdentity),
|
||||||
ReadKeyReplaces: replaces,
|
ReadKeyReplaces: replaces,
|
||||||
},
|
},
|
||||||
@ -461,7 +461,7 @@ func (t *TreeStorageBuilder) encryptReadKeys(keys []string, encKey encryptionkey
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TreeStorageBuilder) convertPermission(perm string) aclpb.ACLChangeUserPermissions {
|
func (t *TreeStorageBuilder) convertPermission(perm string) aclpb.ACLChange_UserPermissions {
|
||||||
switch perm {
|
switch perm {
|
||||||
case "admin":
|
case "admin":
|
||||||
return aclpb.ACLChange_Admin
|
return aclpb.ACLChange_Admin
|
||||||
|
|||||||
@ -45,7 +45,7 @@ func (t *TreeStorageBuilder) Graph() (string, error) {
|
|||||||
|
|
||||||
var chSymbs []string
|
var chSymbs []string
|
||||||
if r.changesDataDecrypted != nil {
|
if r.changesDataDecrypted != nil {
|
||||||
res := &testpb.PlainTextChangeData{}
|
res := &testpb.PlainTextChange_Data{}
|
||||||
err := proto.Unmarshal(r.changesDataDecrypted, res)
|
err := proto.Unmarshal(r.changesDataDecrypted, res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -53,7 +53,7 @@ func (t *TreeStorageBuilder) Graph() (string, error) {
|
|||||||
|
|
||||||
for _, chc := range res.Content {
|
for _, chc := range res.Content {
|
||||||
tp := fmt.Sprintf("%T", chc.Value)
|
tp := fmt.Sprintf("%T", chc.Value)
|
||||||
tp = strings.Replace(tp, "ChangeContentValueOf", "", 1)
|
tp = strings.Replace(tp, "ChangeContent_Value_", "", 1)
|
||||||
res := ""
|
res := ""
|
||||||
for _, ts := range tp {
|
for _, ts := range tp {
|
||||||
if unicode.IsUpper(ts) {
|
if unicode.IsUpper(ts) {
|
||||||
@ -66,7 +66,7 @@ func (t *TreeStorageBuilder) Graph() (string, error) {
|
|||||||
if r.GetAclData() != nil {
|
if r.GetAclData() != nil {
|
||||||
for _, chc := range r.GetAclData().AclContent {
|
for _, chc := range r.GetAclData().AclContent {
|
||||||
tp := fmt.Sprintf("%T", chc.Value)
|
tp := fmt.Sprintf("%T", chc.Value)
|
||||||
tp = strings.Replace(tp, "ACLChangeACLContentValueValueOf", "", 1)
|
tp = strings.Replace(tp, "ACLChange_ACLContentValueValueOf", "", 1)
|
||||||
res := ""
|
res := ""
|
||||||
for _, ts := range tp {
|
for _, ts := range tp {
|
||||||
if unicode.IsUpper(ts) {
|
if unicode.IsUpper(ts) {
|
||||||
|
|||||||
@ -48,7 +48,7 @@ func (m *Message) ReplyType(tp syncproto.MessageType, data proto.Marshaler) (err
|
|||||||
|
|
||||||
func (m *Message) Ack() (err error) {
|
func (m *Message) Ack() (err error) {
|
||||||
ack := &syncproto.System{
|
ack := &syncproto.System{
|
||||||
Ack: &syncproto.SystemAck{},
|
Ack: &syncproto.System_Ack{},
|
||||||
}
|
}
|
||||||
data, err := ack.Marshal()
|
data, err := ack.Marshal()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -78,10 +78,10 @@ func (m *Message) Ack() (err error) {
|
|||||||
return
|
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.System{
|
||||||
Ack: &syncproto.SystemAck{
|
Ack: &syncproto.System_Ack{
|
||||||
Error: &syncproto.SystemError{
|
Error: &syncproto.System_Error{
|
||||||
Code: code,
|
Code: code,
|
||||||
Description: description,
|
Description: description,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -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) {
|
func (r remote) Ranges(ctx context.Context, ranges []ldiff.Range, resBuf []ldiff.RangeResult) (results []ldiff.RangeResult, err error) {
|
||||||
results = resBuf[:0]
|
results = resBuf[:0]
|
||||||
pbRanges := make([]*spacesync.DiffRangeRequestRange, 0, len(ranges))
|
pbRanges := make([]*spacesync.DiffRange_Request_Range, 0, len(ranges))
|
||||||
for _, rg := range ranges {
|
for _, rg := range ranges {
|
||||||
pbRanges = append(pbRanges, &spacesync.DiffRangeRequestRange{
|
pbRanges = append(pbRanges, &spacesync.DiffRange_Request_Range{
|
||||||
From: rg.From,
|
From: rg.From,
|
||||||
To: rg.To,
|
To: rg.To,
|
||||||
Limit: uint32(rg.Limit),
|
Limit: uint32(rg.Limit),
|
||||||
@ -35,10 +35,10 @@ func (r remote) Ranges(ctx context.Context, ranges []ldiff.Range, resBuf []ldiff
|
|||||||
}
|
}
|
||||||
req := &spacesync.Space{
|
req := &spacesync.Space{
|
||||||
SpaceId: r.spaceId,
|
SpaceId: r.spaceId,
|
||||||
Message: &spacesync.SpaceContent{
|
Message: &spacesync.Space_Content{
|
||||||
Value: &spacesync.SpaceContentValueOfDiffRange{
|
Value: &spacesync.Space_Content_DiffRange{
|
||||||
DiffRange: &spacesync.DiffRange{
|
DiffRange: &spacesync.DiffRange{
|
||||||
Request: &spacesync.DiffRangeRequest{
|
Request: &spacesync.DiffRange_Request{
|
||||||
Ranges: pbRanges,
|
Ranges: pbRanges,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -99,21 +99,21 @@ func HandlerRangeRequest(ctx context.Context, d ldiff.Diff, diffRange *spacesync
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var rangeResp = &spacesync.DiffRangeResponse{
|
var rangeResp = &spacesync.DiffRange_Response{
|
||||||
Results: make([]*spacesync.DiffRangeResponseResult, len(res)),
|
Results: make([]*spacesync.DiffRange_Response_Result, len(res)),
|
||||||
}
|
}
|
||||||
for _, rangeRes := range res {
|
for _, rangeRes := range res {
|
||||||
var elements []*spacesync.DiffRangeResponseResultElement
|
var elements []*spacesync.DiffRange_Response_Result_Element
|
||||||
if len(rangeRes.Elements) > 0 {
|
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 {
|
for _, el := range rangeRes.Elements {
|
||||||
elements = append(elements, &spacesync.DiffRangeResponseResultElement{
|
elements = append(elements, &spacesync.DiffRange_Response_Result_Element{
|
||||||
Id: el.Id,
|
Id: el.Id,
|
||||||
Head: el.Head,
|
Head: el.Head,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rangeResp.Results = append(rangeResp.Results, &spacesync.DiffRangeResponseResult{
|
rangeResp.Results = append(rangeResp.Results, &spacesync.DiffRange_Response_Result{
|
||||||
Hash: rangeRes.Hash,
|
Hash: rangeRes.Hash,
|
||||||
Elements: elements,
|
Elements: elements,
|
||||||
Count: uint32(rangeRes.Count),
|
Count: uint32(rangeRes.Count),
|
||||||
|
|||||||
@ -78,9 +78,9 @@ func (s *service) Handle(ctx context.Context, data []byte) (resp proto.Marshaler
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if spaceReq.SpaceId != "" {
|
if spaceReq.SpaceId != "" {
|
||||||
sp, err := s.get(ctx, spaceReq.SpaceId)
|
sp, e := s.get(ctx, spaceReq.SpaceId)
|
||||||
if err != nil {
|
if e != nil {
|
||||||
return
|
return nil, e
|
||||||
}
|
}
|
||||||
return sp.Handle(ctx, spaceReq)
|
return sp.Handle(ctx, spaceReq)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ func (s *space) Handle(ctx context.Context, msg *spacesync.Space) (repl *spacesy
|
|||||||
return nil, er
|
return nil, er
|
||||||
}
|
}
|
||||||
return &spacesync.Space{SpaceId: s.id, Message: &spacesync.SpaceContent{
|
return &spacesync.Space{SpaceId: s.id, Message: &spacesync.SpaceContent{
|
||||||
Value: &spacesync.SpaceContentValueOfDiffRange{
|
Value: &spacesync.SpaceContent_Value_DiffRange{
|
||||||
DiffRange: resp,
|
DiffRange: resp,
|
||||||
},
|
},
|
||||||
}}, nil
|
}}, nil
|
||||||
|
|||||||
@ -24,7 +24,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
|
|
||||||
type Space struct {
|
type Space struct {
|
||||||
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
|
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
|
||||||
Message *SpaceContent `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
Message *Space_Content `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Space) Reset() { *m = Space{} }
|
func (m *Space) Reset() { *m = Space{} }
|
||||||
@ -67,31 +67,32 @@ func (m *Space) GetSpaceId() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Space) GetMessage() *SpaceContent {
|
func (m *Space) GetMessage() *Space_Content {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Message
|
return m.Message
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type SpaceContent struct {
|
type Space_Content struct {
|
||||||
// Types that are valid to be assigned to Value:
|
// 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 *Space_Content) Reset() { *m = Space_Content{} }
|
||||||
func (m *SpaceContent) String() string { return proto.CompactTextString(m) }
|
func (m *Space_Content) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SpaceContent) ProtoMessage() {}
|
func (*Space_Content) ProtoMessage() {}
|
||||||
func (*SpaceContent) Descriptor() ([]byte, []int) {
|
func (*Space_Content) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{0, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_SpaceContent.Marshal(b, m, deterministic)
|
return xxx_messageInfo_Space_Content.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(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
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *SpaceContent) XXX_Merge(src proto.Message) {
|
func (m *Space_Content) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_SpaceContent.Merge(m, src)
|
xxx_messageInfo_Space_Content.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *SpaceContent) XXX_Size() int {
|
func (m *Space_Content) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *SpaceContent) XXX_DiscardUnknown() {
|
func (m *Space_Content) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_SpaceContent.DiscardUnknown(m)
|
xxx_messageInfo_Space_Content.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_SpaceContent proto.InternalMessageInfo
|
var xxx_messageInfo_Space_Content proto.InternalMessageInfo
|
||||||
|
|
||||||
type IsSpaceContentValue interface {
|
type isSpace_Content_Value interface {
|
||||||
IsSpaceContentValue()
|
isSpace_Content_Value()
|
||||||
MarshalTo([]byte) (int, error)
|
MarshalTo([]byte) (int, error)
|
||||||
Size() int
|
Size() int
|
||||||
}
|
}
|
||||||
|
|
||||||
type SpaceContentValueOfDiffRange struct {
|
type Space_Content_DiffRange struct {
|
||||||
DiffRange *DiffRange `protobuf:"bytes,1,opt,name=diffRange,proto3,oneof" json:"diffRange,omitempty"`
|
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 {
|
if m != nil {
|
||||||
return m.Value
|
return m.Value
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceContent) GetDiffRange() *DiffRange {
|
func (m *Space_Content) GetDiffRange() *DiffRange {
|
||||||
if x, ok := m.GetValue().(*SpaceContentValueOfDiffRange); ok {
|
if x, ok := m.GetValue().(*Space_Content_DiffRange); ok {
|
||||||
return x.DiffRange
|
return x.DiffRange
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// XXX_OneofWrappers is for the internal use of the proto package.
|
// XXX_OneofWrappers is for the internal use of the proto package.
|
||||||
func (*SpaceContent) XXX_OneofWrappers() []interface{} {
|
func (*Space_Content) XXX_OneofWrappers() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
(*SpaceContentValueOfDiffRange)(nil),
|
(*Space_Content_DiffRange)(nil),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRange struct {
|
type DiffRange struct {
|
||||||
Request *DiffRangeRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
|
Request *DiffRange_Request `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
|
||||||
Response *DiffRangeResponse `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
|
Response *DiffRange_Response `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRange) Reset() { *m = DiffRange{} }
|
func (m *DiffRange) Reset() { *m = DiffRange{} }
|
||||||
@ -184,36 +185,36 @@ func (m *DiffRange) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_DiffRange proto.InternalMessageInfo
|
var xxx_messageInfo_DiffRange proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *DiffRange) GetRequest() *DiffRangeRequest {
|
func (m *DiffRange) GetRequest() *DiffRange_Request {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Request
|
return m.Request
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRange) GetResponse() *DiffRangeResponse {
|
func (m *DiffRange) GetResponse() *DiffRange_Response {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Response
|
return m.Response
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRangeRequest struct {
|
type DiffRange_Request struct {
|
||||||
Ranges []*DiffRangeRequestRange `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
Ranges []*DiffRange_Request_Range `protobuf:"bytes,1,rep,name=ranges,proto3" json:"ranges,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequest) Reset() { *m = DiffRangeRequest{} }
|
func (m *DiffRange_Request) Reset() { *m = DiffRange_Request{} }
|
||||||
func (m *DiffRangeRequest) String() string { return proto.CompactTextString(m) }
|
func (m *DiffRange_Request) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DiffRangeRequest) ProtoMessage() {}
|
func (*DiffRange_Request) ProtoMessage() {}
|
||||||
func (*DiffRangeRequest) Descriptor() ([]byte, []int) {
|
func (*DiffRange_Request) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{1, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_DiffRangeRequest.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DiffRange_Request.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(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
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequest) XXX_Merge(src proto.Message) {
|
func (m *DiffRange_Request) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DiffRangeRequest.Merge(m, src)
|
xxx_messageInfo_DiffRange_Request.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequest) XXX_Size() int {
|
func (m *DiffRange_Request) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequest) XXX_DiscardUnknown() {
|
func (m *DiffRange_Request) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_DiffRangeRequest.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Ranges
|
return m.Ranges
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRangeRequestRange struct {
|
type DiffRange_Request_Range struct {
|
||||||
From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
|
From uint64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
|
||||||
To uint64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,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"`
|
Limit uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequestRange) Reset() { *m = DiffRangeRequestRange{} }
|
func (m *DiffRange_Request_Range) Reset() { *m = DiffRange_Request_Range{} }
|
||||||
func (m *DiffRangeRequestRange) String() string { return proto.CompactTextString(m) }
|
func (m *DiffRange_Request_Range) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DiffRangeRequestRange) ProtoMessage() {}
|
func (*DiffRange_Request_Range) ProtoMessage() {}
|
||||||
func (*DiffRangeRequestRange) Descriptor() ([]byte, []int) {
|
func (*DiffRange_Request_Range) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{1, 0, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_DiffRangeRequestRange.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DiffRange_Request_Range.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -269,55 +270,55 @@ func (m *DiffRangeRequestRange) XXX_Marshal(b []byte, deterministic bool) ([]byt
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequestRange) XXX_Merge(src proto.Message) {
|
func (m *DiffRange_Request_Range) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DiffRangeRequestRange.Merge(m, src)
|
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()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequestRange) XXX_DiscardUnknown() {
|
func (m *DiffRange_Request_Range) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_DiffRangeRequestRange.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.From
|
return m.From
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequestRange) GetTo() uint64 {
|
func (m *DiffRange_Request_Range) GetTo() uint64 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.To
|
return m.To
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequestRange) GetLimit() uint32 {
|
func (m *DiffRange_Request_Range) GetLimit() uint32 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Limit
|
return m.Limit
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRangeResponse struct {
|
type DiffRange_Response struct {
|
||||||
Results []*DiffRangeResponseResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
|
Results []*DiffRange_Response_Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponse) Reset() { *m = DiffRangeResponse{} }
|
func (m *DiffRange_Response) Reset() { *m = DiffRange_Response{} }
|
||||||
func (m *DiffRangeResponse) String() string { return proto.CompactTextString(m) }
|
func (m *DiffRange_Response) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DiffRangeResponse) ProtoMessage() {}
|
func (*DiffRange_Response) ProtoMessage() {}
|
||||||
func (*DiffRangeResponse) Descriptor() ([]byte, []int) {
|
func (*DiffRange_Response) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{1, 1}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_DiffRangeResponse.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DiffRange_Response.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(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
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponse) XXX_Merge(src proto.Message) {
|
func (m *DiffRange_Response) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DiffRangeResponse.Merge(m, src)
|
xxx_messageInfo_DiffRange_Response.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponse) XXX_Size() int {
|
func (m *DiffRange_Response) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponse) XXX_DiscardUnknown() {
|
func (m *DiffRange_Response) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_DiffRangeResponse.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Results
|
return m.Results
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRangeResponseResult struct {
|
type DiffRange_Response_Result struct {
|
||||||
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
||||||
Elements []*DiffRangeResponseResultElement `protobuf:"bytes,2,rep,name=elements,proto3" json:"elements,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"`
|
Count uint32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResult) Reset() { *m = DiffRangeResponseResult{} }
|
func (m *DiffRange_Response_Result) Reset() { *m = DiffRange_Response_Result{} }
|
||||||
func (m *DiffRangeResponseResult) String() string { return proto.CompactTextString(m) }
|
func (m *DiffRange_Response_Result) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DiffRangeResponseResult) ProtoMessage() {}
|
func (*DiffRange_Response_Result) ProtoMessage() {}
|
||||||
func (*DiffRangeResponseResult) Descriptor() ([]byte, []int) {
|
func (*DiffRange_Response_Result) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{1, 1, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_DiffRangeResponseResult.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DiffRange_Response_Result.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -373,56 +374,56 @@ func (m *DiffRangeResponseResult) XXX_Marshal(b []byte, deterministic bool) ([]b
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResult) XXX_Merge(src proto.Message) {
|
func (m *DiffRange_Response_Result) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DiffRangeResponseResult.Merge(m, src)
|
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()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResult) XXX_DiscardUnknown() {
|
func (m *DiffRange_Response_Result) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_DiffRangeResponseResult.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Hash
|
return m.Hash
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResult) GetElements() []*DiffRangeResponseResultElement {
|
func (m *DiffRange_Response_Result) GetElements() []*DiffRange_Response_Result_Element {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Elements
|
return m.Elements
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResult) GetCount() uint32 {
|
func (m *DiffRange_Response_Result) GetCount() uint32 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Count
|
return m.Count
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
type DiffRangeResponseResultElement struct {
|
type DiffRange_Response_Result_Element struct {
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Head string `protobuf:"bytes,2,opt,name=head,proto3" json:"head,omitempty"`
|
Head string `protobuf:"bytes,2,opt,name=head,proto3" json:"head,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResultElement) Reset() { *m = DiffRangeResponseResultElement{} }
|
func (m *DiffRange_Response_Result_Element) Reset() { *m = DiffRange_Response_Result_Element{} }
|
||||||
func (m *DiffRangeResponseResultElement) String() string { return proto.CompactTextString(m) }
|
func (m *DiffRange_Response_Result_Element) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DiffRangeResponseResultElement) ProtoMessage() {}
|
func (*DiffRange_Response_Result_Element) ProtoMessage() {}
|
||||||
func (*DiffRangeResponseResultElement) Descriptor() ([]byte, []int) {
|
func (*DiffRange_Response_Result_Element) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_11d78c2fb7c80384, []int{1, 1, 0, 0}
|
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)
|
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 {
|
if deterministic {
|
||||||
return xxx_messageInfo_DiffRangeResponseResultElement.Marshal(b, m, deterministic)
|
return xxx_messageInfo_DiffRange_Response_Result_Element.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -432,26 +433,26 @@ func (m *DiffRangeResponseResultElement) XXX_Marshal(b []byte, deterministic boo
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResultElement) XXX_Merge(src proto.Message) {
|
func (m *DiffRange_Response_Result_Element) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_DiffRangeResponseResultElement.Merge(m, src)
|
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()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResultElement) XXX_DiscardUnknown() {
|
func (m *DiffRange_Response_Result_Element) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_DiffRangeResponseResultElement.DiscardUnknown(m)
|
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 {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResultElement) GetHead() string {
|
func (m *DiffRange_Response_Result_Element) GetHead() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Head
|
return m.Head
|
||||||
}
|
}
|
||||||
@ -460,13 +461,13 @@ func (m *DiffRangeResponseResultElement) GetHead() string {
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Space)(nil), "anytype.Space")
|
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((*DiffRange)(nil), "anytype.DiffRange")
|
||||||
proto.RegisterType((*DiffRangeRequest)(nil), "anytype.DiffRange.Request")
|
proto.RegisterType((*DiffRange_Request)(nil), "anytype.DiffRange.Request")
|
||||||
proto.RegisterType((*DiffRangeRequestRange)(nil), "anytype.DiffRange.Request.Range")
|
proto.RegisterType((*DiffRange_Request_Range)(nil), "anytype.DiffRange.Request.Range")
|
||||||
proto.RegisterType((*DiffRangeResponse)(nil), "anytype.DiffRange.Response")
|
proto.RegisterType((*DiffRange_Response)(nil), "anytype.DiffRange.Response")
|
||||||
proto.RegisterType((*DiffRangeResponseResult)(nil), "anytype.DiffRange.Response.Result")
|
proto.RegisterType((*DiffRange_Response_Result)(nil), "anytype.DiffRange.Response.Result")
|
||||||
proto.RegisterType((*DiffRangeResponseResultElement)(nil), "anytype.DiffRange.Response.Result.Element")
|
proto.RegisterType((*DiffRange_Response_Result_Element)(nil), "anytype.DiffRange.Response.Result.Element")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -546,7 +547,7 @@ func (m *Space) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -556,12 +557,12 @@ func (m *SpaceContent) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceContent) MarshalTo(dAtA []byte) (int, error) {
|
func (m *Space_Content) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -578,12 +579,12 @@ func (m *SpaceContent) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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)
|
i := len(dAtA)
|
||||||
if m.DiffRange != nil {
|
if m.DiffRange != nil {
|
||||||
{
|
{
|
||||||
@ -646,7 +647,7 @@ func (m *DiffRange) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -656,12 +657,12 @@ func (m *DiffRangeRequest) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequest) MarshalTo(dAtA []byte) (int, error) {
|
func (m *DiffRange_Request) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -683,7 +684,7 @@ func (m *DiffRangeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -693,12 +694,12 @@ func (m *DiffRangeRequestRange) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
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()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -721,7 +722,7 @@ func (m *DiffRangeRequestRange) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -731,12 +732,12 @@ func (m *DiffRangeResponse) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponse) MarshalTo(dAtA []byte) (int, error) {
|
func (m *DiffRange_Response) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -758,7 +759,7 @@ func (m *DiffRangeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -768,12 +769,12 @@ func (m *DiffRangeResponseResult) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
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()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -807,7 +808,7 @@ func (m *DiffRangeResponseResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
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()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -817,12 +818,12 @@ func (m *DiffRangeResponseResultElement) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
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()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -872,7 +873,7 @@ func (m *Space) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceContent) Size() (n int) {
|
func (m *Space_Content) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -884,7 +885,7 @@ func (m *SpaceContent) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpaceContentValueOfDiffRange) Size() (n int) {
|
func (m *Space_Content_DiffRange) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -913,7 +914,7 @@ func (m *DiffRange) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequest) Size() (n int) {
|
func (m *DiffRange_Request) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -928,7 +929,7 @@ func (m *DiffRangeRequest) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeRequestRange) Size() (n int) {
|
func (m *DiffRange_Request_Range) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -946,7 +947,7 @@ func (m *DiffRangeRequestRange) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponse) Size() (n int) {
|
func (m *DiffRange_Response) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -961,7 +962,7 @@ func (m *DiffRangeResponse) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResult) Size() (n int) {
|
func (m *DiffRange_Response_Result) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -983,7 +984,7 @@ func (m *DiffRangeResponseResult) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DiffRangeResponseResultElement) Size() (n int) {
|
func (m *DiffRange_Response_Result_Element) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1097,7 +1098,7 @@ func (m *Space) Unmarshal(dAtA []byte) error {
|
|||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Message == nil {
|
if m.Message == nil {
|
||||||
m.Message = &SpaceContent{}
|
m.Message = &Space_Content{}
|
||||||
}
|
}
|
||||||
if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -1124,7 +1125,7 @@ func (m *Space) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *SpaceContent) Unmarshal(dAtA []byte) error {
|
func (m *Space_Content) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1186,7 +1187,7 @@ func (m *SpaceContent) Unmarshal(dAtA []byte) error {
|
|||||||
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
m.Value = &SpaceContentValueOfDiffRange{v}
|
m.Value = &Space_Content_DiffRange{v}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
@ -1268,7 +1269,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error {
|
|||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Request == nil {
|
if m.Request == nil {
|
||||||
m.Request = &DiffRangeRequest{}
|
m.Request = &DiffRange_Request{}
|
||||||
}
|
}
|
||||||
if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -1304,7 +1305,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error {
|
|||||||
return io.ErrUnexpectedEOF
|
return io.ErrUnexpectedEOF
|
||||||
}
|
}
|
||||||
if m.Response == nil {
|
if m.Response == nil {
|
||||||
m.Response = &DiffRangeResponse{}
|
m.Response = &DiffRange_Response{}
|
||||||
}
|
}
|
||||||
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -1331,7 +1332,7 @@ func (m *DiffRange) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error {
|
func (m *DiffRange_Request) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1389,7 +1390,7 @@ func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
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 {
|
if err := m.Ranges[len(m.Ranges)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1415,7 +1416,7 @@ func (m *DiffRangeRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *DiffRangeRequestRange) Unmarshal(dAtA []byte) error {
|
func (m *DiffRange_Request_Range) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1522,7 +1523,7 @@ func (m *DiffRangeRequestRange) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error {
|
func (m *DiffRange_Response) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1580,7 +1581,7 @@ func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
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 {
|
if err := m.Results[len(m.Results)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1606,7 +1607,7 @@ func (m *DiffRangeResponse) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error {
|
func (m *DiffRange_Response_Result) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1698,7 +1699,7 @@ func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error {
|
|||||||
if postIndex > l {
|
if postIndex > l {
|
||||||
return io.ErrUnexpectedEOF
|
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 {
|
if err := m.Elements[len(m.Elements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -1743,7 +1744,7 @@ func (m *DiffRangeResponseResult) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *DiffRangeResponseResultElement) Unmarshal(dAtA []byte) error {
|
func (m *DiffRange_Response_Result_Element) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
|
|||||||
@ -74,8 +74,8 @@ func (s *service) UpdateDocument(ctx context.Context, id, text string) (err erro
|
|||||||
err = s.treeCache.Do(ctx, id, func(tree acltree.ACLTree) error {
|
err = s.treeCache.Do(ctx, id, func(tree acltree.ACLTree) error {
|
||||||
ch, err = tree.AddContent(ctx, func(builder acltree.ChangeBuilder) error {
|
ch, err = tree.AddContent(ctx, func(builder acltree.ChangeBuilder) error {
|
||||||
builder.AddChangeContent(
|
builder.AddChangeContent(
|
||||||
&testchangepb.PlainTextChangeData{
|
&testchangepb.PlainTextChange_Data{
|
||||||
Content: []*testchangepb.PlainTextChangeContent{
|
Content: []*testchangepb.PlainTextChange_Content{
|
||||||
createAppendTextChangeContent(text),
|
createAppendTextChangeContent(text),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -100,7 +100,7 @@ func (s *service) UpdateDocument(ctx context.Context, id, text string) (err erro
|
|||||||
zap.String("header", header.String())).
|
zap.String("header", header.String())).
|
||||||
Debug("document updated in the database")
|
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,
|
Heads: heads,
|
||||||
Changes: []*aclpb.RawChange{ch},
|
Changes: []*aclpb.RawChange{ch},
|
||||||
TreeId: id,
|
TreeId: id,
|
||||||
@ -155,7 +155,7 @@ func (s *service) CreateDocument(ctx context.Context, text string) (id string, e
|
|||||||
log.With(zap.String("id", id), zap.String("text", text)).
|
log.With(zap.String("id", id), zap.String("text", text)).
|
||||||
Debug("creating document")
|
Debug("creating document")
|
||||||
|
|
||||||
err = s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.SyncHeadUpdate{
|
err = s.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(&syncproto.Sync_HeadUpdate{
|
||||||
Heads: heads,
|
Heads: heads,
|
||||||
Changes: []*aclpb.RawChange{ch},
|
Changes: []*aclpb.RawChange{ch},
|
||||||
TreeId: id,
|
TreeId: id,
|
||||||
@ -169,18 +169,18 @@ func (s *service) CreateDocument(ctx context.Context, text string) (id string, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createInitialChangeContent(text string) proto.Marshaler {
|
func createInitialChangeContent(text string) proto.Marshaler {
|
||||||
return &testchangepb.PlainTextChangeData{
|
return &testchangepb.PlainTextChange_Data{
|
||||||
Content: []*testchangepb.PlainTextChangeContent{
|
Content: []*testchangepb.PlainTextChange_Content{
|
||||||
createAppendTextChangeContent(text),
|
createAppendTextChangeContent(text),
|
||||||
},
|
},
|
||||||
Snapshot: &testchangepb.PlainTextChangeSnapshot{Text: text},
|
Snapshot: &testchangepb.PlainTextChange_Snapshot{Text: text},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createAppendTextChangeContent(text string) *testchangepb.PlainTextChangeContent {
|
func createAppendTextChangeContent(text string) *testchangepb.PlainTextChange_Content {
|
||||||
return &testchangepb.PlainTextChangeContent{
|
return &testchangepb.PlainTextChange_Content{
|
||||||
Value: &testchangepb.PlainTextChangeContentValueOfTextAppend{
|
Value: &testchangepb.PlainTextChange_Content_TextAppend{
|
||||||
TextAppend: &testchangepb.PlainTextChangeTextAppend{
|
TextAppend: &testchangepb.PlainTextChange_TextAppend{
|
||||||
Text: text,
|
Text: text,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -56,7 +56,7 @@ func (s *service) Close(ctx context.Context) (err error) {
|
|||||||
func (s *service) HandleMessage(ctx context.Context, msg *pool.Message) (err error) {
|
func (s *service) HandleMessage(ctx context.Context, msg *pool.Message) (err error) {
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
msg.AckError(syncproto.SystemError_UNKNOWN, err.Error())
|
msg.AckError(syncproto.System_Error_UNKNOWN, err.Error())
|
||||||
} else {
|
} else {
|
||||||
msg.Ack()
|
msg.Ack()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,9 +70,9 @@ func (r *requestHandler) HandleSyncMessage(ctx context.Context, senderId string,
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, update *syncproto.SyncHeadUpdate) (err error) {
|
func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string, update *syncproto.Sync_HeadUpdate) (err error) {
|
||||||
var (
|
var (
|
||||||
fullRequest *syncproto.SyncFullRequest
|
fullRequest *syncproto.Sync_Full_Request
|
||||||
snapshotPath []string
|
snapshotPath []string
|
||||||
result acltree.AddResult
|
result acltree.AddResult
|
||||||
)
|
)
|
||||||
@ -100,7 +100,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
|
|||||||
// if there are no such tree
|
// if there are no such tree
|
||||||
if err == treestorage.ErrUnknownTreeId {
|
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
|
// 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.SyncFullRequest{
|
fullRequest = &syncproto.Sync_Full_Request{
|
||||||
TreeId: update.TreeId,
|
TreeId: update.TreeId,
|
||||||
TreeHeader: update.TreeHeader,
|
TreeHeader: update.TreeHeader,
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// otherwise sending heads update message
|
// otherwise sending heads update message
|
||||||
newUpdate := &syncproto.SyncHeadUpdate{
|
newUpdate := &syncproto.Sync_HeadUpdate{
|
||||||
Heads: result.Heads,
|
Heads: result.Heads,
|
||||||
Changes: result.Added,
|
Changes: result.Added,
|
||||||
SnapshotPath: snapshotPath,
|
SnapshotPath: snapshotPath,
|
||||||
@ -124,9 +124,9 @@ func (r *requestHandler) HandleHeadUpdate(ctx context.Context, senderId string,
|
|||||||
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId string, request *syncproto.SyncFullRequest) (err error) {
|
func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId string, request *syncproto.Sync_Full_Request) (err error) {
|
||||||
var (
|
var (
|
||||||
fullResponse *syncproto.SyncFullResponse
|
fullResponse *syncproto.Sync_Full_Response
|
||||||
snapshotPath []string
|
snapshotPath []string
|
||||||
result acltree.AddResult
|
result acltree.AddResult
|
||||||
)
|
)
|
||||||
@ -159,7 +159,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
|
|||||||
}
|
}
|
||||||
|
|
||||||
// otherwise sending heads update message
|
// otherwise sending heads update message
|
||||||
newUpdate := &syncproto.SyncHeadUpdate{
|
newUpdate := &syncproto.Sync_HeadUpdate{
|
||||||
Heads: result.Heads,
|
Heads: result.Heads,
|
||||||
Changes: result.Added,
|
Changes: result.Added,
|
||||||
SnapshotPath: snapshotPath,
|
SnapshotPath: snapshotPath,
|
||||||
@ -169,7 +169,7 @@ func (r *requestHandler) HandleFullSyncRequest(ctx context.Context, senderId str
|
|||||||
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.SyncFullResponse) (err error) {
|
func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId string, response *syncproto.Sync_Full_Response) (err error) {
|
||||||
var (
|
var (
|
||||||
snapshotPath []string
|
snapshotPath []string
|
||||||
result acltree.AddResult
|
result acltree.AddResult
|
||||||
@ -203,7 +203,7 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sending heads update message
|
// sending heads update message
|
||||||
newUpdate := &syncproto.SyncHeadUpdate{
|
newUpdate := &syncproto.Sync_HeadUpdate{
|
||||||
Heads: result.Heads,
|
Heads: result.Heads,
|
||||||
Changes: result.Added,
|
Changes: result.Added,
|
||||||
SnapshotPath: snapshotPath,
|
SnapshotPath: snapshotPath,
|
||||||
@ -212,12 +212,12 @@ func (r *requestHandler) HandleFullSyncResponse(ctx context.Context, senderId st
|
|||||||
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
return r.messageService.SendToSpaceAsync("", syncproto.WrapHeadUpdate(newUpdate))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.TreeHeader, theirPath []string, tree acltree.ACLTree) (*syncproto.SyncFullRequest, error) {
|
func (r *requestHandler) prepareFullSyncRequest(treeId string, header *treepb.TreeHeader, theirPath []string, tree acltree.ACLTree) (*syncproto.Sync_Full_Request, error) {
|
||||||
ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath)
|
ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &syncproto.SyncFullRequest{
|
return &syncproto.Sync_Full_Request{
|
||||||
Heads: tree.Heads(),
|
Heads: tree.Heads(),
|
||||||
Changes: ourChanges,
|
Changes: ourChanges,
|
||||||
TreeId: treeId,
|
TreeId: treeId,
|
||||||
@ -230,7 +230,7 @@ func (r *requestHandler) prepareFullSyncResponse(
|
|||||||
treeId string,
|
treeId string,
|
||||||
theirPath []string,
|
theirPath []string,
|
||||||
theirChanges []*aclpb.RawChange,
|
theirChanges []*aclpb.RawChange,
|
||||||
tree acltree.ACLTree) (*syncproto.SyncFullResponse, error) {
|
tree acltree.ACLTree) (*syncproto.Sync_Full_Response, error) {
|
||||||
// TODO: we can probably use the common snapshot calculated on the request step from previous peer
|
// TODO: we can probably use the common snapshot calculated on the request step from previous peer
|
||||||
ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath)
|
ourChanges, err := tree.ChangesAfterCommonSnapshot(theirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -251,7 +251,7 @@ func (r *requestHandler) prepareFullSyncResponse(
|
|||||||
log.With(zap.Int("len(changes)", len(final)), zap.String("id", treeId)).
|
log.With(zap.Int("len(changes)", len(final)), zap.String("id", treeId)).
|
||||||
Debug("preparing changes for tree")
|
Debug("preparing changes for tree")
|
||||||
|
|
||||||
return &syncproto.SyncFullResponse{
|
return &syncproto.Sync_Full_Response{
|
||||||
Heads: tree.Heads(),
|
Heads: tree.Heads(),
|
||||||
Changes: final,
|
Changes: final,
|
||||||
TreeId: treeId,
|
TreeId: treeId,
|
||||||
@ -260,7 +260,7 @@ func (r *requestHandler) prepareFullSyncResponse(
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *requestHandler) createTree(ctx context.Context, response *syncproto.SyncFullResponse) error {
|
func (r *requestHandler) createTree(ctx context.Context, response *syncproto.Sync_Full_Response) error {
|
||||||
return r.treeCache.Add(
|
return r.treeCache.Add(
|
||||||
ctx,
|
ctx,
|
||||||
response.TreeId,
|
response.TreeId,
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
package syncproto
|
package syncproto
|
||||||
|
|
||||||
func WrapHeadUpdate(update *SyncHeadUpdate) *Sync {
|
func WrapHeadUpdate(update *Sync_HeadUpdate) *Sync {
|
||||||
return &Sync{Message: &SyncContentValue{
|
return &Sync{Message: &Sync_ContentValue{
|
||||||
Value: &SyncContentValueValueOfHeadUpdate{HeadUpdate: update},
|
Value: &Sync_Content_Value_HeadUpdate{HeadUpdate: update},
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WrapFullRequest(request *SyncFullRequest) *Sync {
|
func WrapFullRequest(request *Sync_Full_Request) *Sync {
|
||||||
return &Sync{Message: &SyncContentValue{
|
return &Sync{Message: &Sync_ContentValue{
|
||||||
Value: &SyncContentValueValueOfFullSyncRequest{FullSyncRequest: request},
|
Value: &Sync_Content_Value_FullSyncRequest{FullSyncRequest: request},
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WrapFullResponse(response *SyncFullResponse) *Sync {
|
func WrapFullResponse(response *Sync_Full_Response) *Sync {
|
||||||
return &Sync{Message: &SyncContentValue{
|
return &Sync{Message: &Sync_ContentValue{
|
||||||
Value: &SyncContentValueValueOfFullSyncResponse{FullSyncResponse: response},
|
Value: &Sync_Content_Value_FullSyncResponse{FullSyncResponse: response},
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user