Documentation
¶
Index ¶
Constants ¶
const AddSpaceCtxKey ctxKey = 0
const CName = "common.commonspace"
Variables ¶
This section is empty.
Functions ¶
func NewSpaceId ¶
Types ¶
type Deps ¶ added in v0.3.2
type Deps struct {
SyncStatus syncstatus.StatusUpdater
TreeSyncer treesyncer.TreeSyncer
AccountService accountservice.Service
Indexer keyvaluestorage.Indexer
// PullObserver, when set, is notified about SpacePull attempts made while
// fetching a space absent from local storage; see PullObserver. Nil means
// no notifications.
PullObserver PullObserver
// contains filtered or unexported fields
}
type PullEvent ¶ added in v0.13.2
type PullEvent struct {
Kind PullEventKind
SpaceId string
// PeerId is set on Attempt and Result events.
PeerId string
// Err is set on Result events; nil means the pull succeeded.
Err error
}
PullEvent describes one stage of fetching a space absent from local storage.
type PullEventKind ¶ added in v0.13.2
type PullEventKind int
PullEventKind tells which stage of a remote space pull a PullEvent describes. Consumers must ignore kinds they do not recognize: new kinds may be added and are not a breaking change.
const ( // PullEventUnknown is the zero value and is never emitted; it exists so // a zero PullEvent cannot masquerade as a real one. PullEventUnknown PullEventKind = iota // PullEventWaiting: the pull is about to look for a responsible peer; // emitted exactly once per remote pull, before the lookup, which may // block. When the lookup never yields a peer — the pull context dies, or // the lookup fails outright — no PullEventAttempt is ever made and no // terminal event is emitted: the pull's overall outcome is NewSpace's // return value. PullEventWaiting // PullEventAttempt: SpacePull is about to be tried against PeerId. PullEventAttempt // PullEventResult: the outcome of that attempt. Err is nil on success; // otherwise it is the remote RPC failure or a local failure persisting // the received space (spacestorage errors) — discriminate by error value // if it matters. PullEventResult )
func (PullEventKind) String ¶ added in v0.13.2
func (k PullEventKind) String() string
type PullObserver ¶ added in v0.13.2
type PullObserver interface {
ObservePullEvent(ev PullEvent)
}
PullObserver receives advisory notifications about SpacePull progress while fetching a space absent from local storage. It exists for status/diagnostics surfaces; the calls never affect the pull.
Several spaces can be pulled concurrently through one observer, so implementations must be safe for concurrent use. They must be fast and must not block; panics are recovered and logged by the caller. A nil observer is allowed.
type Space ¶
type Space interface {
Id() string
Init(ctx context.Context) error
Acl() syncacl.SyncAcl
StoredIds() []string
DebugAllHeads() []headsync.TreeHeads
Description(ctx context.Context) (desc SpaceDescription, err error)
SyncHeads(ctx context.Context) error
TreeBuilder() objecttreebuilder.TreeBuilder
TreeSyncer() treesyncer.TreeSyncer
AclClient() aclclient.AclSpaceClient
SyncStatus() syncstatus.StatusUpdater
Storage() spacestorage.SpaceStorage
KeyValue() kvinterfaces.KeyValueService
DeleteTree(ctx context.Context, id string) (err error)
GetNodePeers(ctx context.Context) (peer []peer.Peer, err error)
HandleStreamSyncRequest(ctx context.Context, req *spacesyncproto.ObjectSyncMessage, stream drpc.Stream) (err error)
HandleRangeRequest(ctx context.Context, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)
HandleMessage(ctx context.Context, msg *objectmessages.HeadUpdate) (err error)
TryClose(objectTTL time.Duration) (close bool, err error)
Close() error
}
type SpaceDescription ¶
type SpaceDescription struct {
SpaceHeader *spacesyncproto.RawSpaceHeaderWithId
AclId string
AclPayload []byte
SpaceSettingsId string
SpaceSettingsPayload []byte
AclRecords []*spacesyncproto.AclRecord
}
type SpaceService ¶
type SpaceService interface {
DeriveSpace(ctx context.Context, payload spacepayloads.SpaceDerivePayload) (string, error)
DeriveId(ctx context.Context, payload spacepayloads.SpaceDerivePayload) (string, error)
CreateSpace(ctx context.Context, payload spacepayloads.SpaceCreatePayload) (string, error)
DeriveOneToOneSpace(ctx context.Context, aSk crypto.PrivKey, bPk crypto.PubKey) (id string, err error)
NewSpace(ctx context.Context, id string, deps Deps) (sp Space, err error)
app.Component
}
func New ¶
func New() SpaceService
Directories
¶
| Path | Synopsis |
|---|---|
|
acl
|
|
|
aclclient/mock_aclclient
Package mock_aclclient is a generated GoMock package.
|
Package mock_aclclient is a generated GoMock package. |
|
mock_credentialprovider
Package mock_credentialprovider is a generated GoMock package.
|
Package mock_credentialprovider is a generated GoMock package. |
|
mock_deletionmanager
Package mock_deletionmanager is a generated GoMock package.
|
Package mock_deletionmanager is a generated GoMock package. |
|
mock_deletionstate
Package mock_deletionstate is a generated GoMock package.
|
Package mock_deletionstate is a generated GoMock package. |
|
headstorage/mock_headstorage
Package mock_headstorage is a generated GoMock package.
|
Package mock_headstorage is a generated GoMock package. |
|
mock_headsync
Package mock_headsync is a generated GoMock package.
|
Package mock_headsync is a generated GoMock package. |
|
statestorage/mock_statestorage
Package mock_statestorage is a generated GoMock package.
|
Package mock_statestorage is a generated GoMock package. |
|
Package mock_commonspace is a generated GoMock package.
|
Package mock_commonspace is a generated GoMock package. |
|
object
|
|
|
acl/list/listtest
Package listtest contains test-only helpers for the acl list package.
|
Package listtest contains test-only helpers for the acl list package. |
|
acl/list/mock_list
Package mock_list is a generated GoMock package.
|
Package mock_list is a generated GoMock package. |
|
acl/syncacl/mock_syncacl
Package mock_syncacl is a generated GoMock package.
|
Package mock_syncacl is a generated GoMock package. |
|
keyvalue/keyvaluestorage/mock_keyvaluestorage
Package mock_keyvaluestorage is a generated GoMock package.
|
Package mock_keyvaluestorage is a generated GoMock package. |
|
keyvalue/kvinterfaces/mock_kvinterfaces
Package mock_kvinterfaces is a generated GoMock package.
|
Package mock_kvinterfaces is a generated GoMock package. |
|
tree/objecttree/mock_objecttree
Package mock_objecttree is a generated GoMock package.
|
Package mock_objecttree is a generated GoMock package. |
|
tree/synctree/mock_synctree
Package mock_synctree is a generated GoMock package.
|
Package mock_synctree is a generated GoMock package. |
|
tree/synctree/response/mock_response
Package mock_response is a generated GoMock package.
|
Package mock_response is a generated GoMock package. |
|
tree/synctree/updatelistener/mock_updatelistener
Package mock_updatelistener is a generated GoMock package.
|
Package mock_updatelistener is a generated GoMock package. |
|
treemanager/mock_treemanager
Package mock_treemanager is a generated GoMock package.
|
Package mock_treemanager is a generated GoMock package. |
|
treesyncer/mock_treesyncer
Package mock_treesyncer is a generated GoMock package.
|
Package mock_treesyncer is a generated GoMock package. |
|
mock_objectmanager
Package mock_objectmanager is a generated GoMock package.
|
Package mock_objectmanager is a generated GoMock package. |
|
mock_objecttreebuilder
Package mock_objecttreebuilder is a generated GoMock package.
|
Package mock_objecttreebuilder is a generated GoMock package. |
|
mock_peermanager
Package mock_peermanager is a generated GoMock package.
|
Package mock_peermanager is a generated GoMock package. |
|
settingsstate/mock_settingsstate
Package mock_settingsstate is a generated GoMock package.
|
Package mock_settingsstate is a generated GoMock package. |
|
mock_spacestorage
Package mock_spacestorage is a generated GoMock package.
|
Package mock_spacestorage is a generated GoMock package. |
|
mock_spacesyncproto
Package mock_spacesyncproto is a generated GoMock package.
|
Package mock_spacesyncproto is a generated GoMock package. |
|
syncdeps/mock_syncdeps
Package mock_syncdeps is a generated GoMock package.
|
Package mock_syncdeps is a generated GoMock package. |
|
mock_syncstatus
Package mock_syncstatus is a generated GoMock package.
|
Package mock_syncstatus is a generated GoMock package. |