commonspace

package
v0.4.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: MIT Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const AddSpaceCtxKey ctxKey = 0
View Source
const CName = "common.commonspace"
View Source
const (
	SpaceReserved = "any-sync.space"
)

Variables

View Source
var ErrIncorrectIdentity = errors.New("incorrect identity")

Functions

func NewSpaceId

func NewSpaceId(id string, repKey uint64) string

func ValidateSpaceHeader

func ValidateSpaceHeader(rawHeaderWithId *spacesyncproto.RawSpaceHeaderWithId, identity crypto.PubKey) (err error)

Types

type Deps added in v0.3.2

type Deps struct {
	TreeSyncer treesyncer.TreeSyncer
}

type Space

type Space interface {
	Id() string
	Init(ctx context.Context) error
	Acl() syncacl.SyncAcl

	StoredIds() []string
	DebugAllHeads() []headsync.TreeHeads
	Description() (desc SpaceDescription, err error)

	TreeBuilder() objecttreebuilder.TreeBuilder
	TreeSyncer() treesyncer.TreeSyncer
	AclClient() aclclient.AclSpaceClient
	SyncStatus() syncstatus.StatusUpdater
	Storage() spacestorage.SpaceStorage

	DeleteTree(ctx context.Context, id string) (err error)
	GetNodePeers(ctx context.Context) (peer []peer.Peer, err error)

	HandleMessage(ctx context.Context, msg objectsync.HandleMessage) (err error)
	HandleSyncRequest(ctx context.Context, req *spacesyncproto.ObjectSyncMessage) (resp *spacesyncproto.ObjectSyncMessage, err error)
	HandleRangeRequest(ctx context.Context, req *spacesyncproto.HeadSyncRequest) (resp *spacesyncproto.HeadSyncResponse, err error)

	TryClose(objectTTL time.Duration) (close bool, err error)
	Close() error
}

type SpaceCreatePayload

type SpaceCreatePayload struct {
	// SigningKey is the signing key of the owner
	SigningKey crypto.PrivKey
	// SpaceType is an arbitrary string
	SpaceType string
	// ReplicationKey is a key which is to be used to determine the node where the space should be held
	ReplicationKey uint64
	// SpacePayload is an arbitrary payload related to space type
	SpacePayload []byte
	// MasterKey is the master key of the owner
	MasterKey crypto.PrivKey
	// ReadKey is the first read key of space
	ReadKey crypto.SymKey
	// MetadataKey is the first metadata key of space
	MetadataKey crypto.PrivKey
	// Metadata is the metadata of the owner
	Metadata []byte
}

type SpaceDerivePayload

type SpaceDerivePayload struct {
	SigningKey   crypto.PrivKey
	MasterKey    crypto.PrivKey
	SpaceType    string
	SpacePayload []byte
}

type SpaceDescription

type SpaceDescription struct {
	SpaceHeader          *spacesyncproto.RawSpaceHeaderWithId
	AclId                string
	AclPayload           []byte
	SpaceSettingsId      string
	SpaceSettingsPayload []byte
}

type SpaceService

type SpaceService interface {
	DeriveSpace(ctx context.Context, payload SpaceDerivePayload) (string, error)
	DeriveId(ctx context.Context, payload SpaceDerivePayload) (string, error)
	CreateSpace(ctx context.Context, payload SpaceCreatePayload) (string, 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.
mock_headsync
Package mock_headsync is a generated GoMock package.
Package mock_headsync is a generated GoMock package.
Package mock_commonspace is a generated GoMock package.
Package mock_commonspace is a generated GoMock package.
object
acl/list/mock_list
Package mock_list is a generated GoMock package.
Package mock_list is a generated GoMock package.
acl/liststorage/mock_liststorage
Package mock_liststorage is a generated GoMock package.
Package mock_liststorage 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.
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/updatelistener/mock_updatelistener
Package mock_updatelistener is a generated GoMock package.
Package mock_updatelistener is a generated GoMock package.
tree/treestorage/mock_treestorage
Package mock_treestorage is a generated GoMock package.
Package mock_treestorage 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_objectsync
Package mock_objectsync is a generated GoMock package.
Package mock_objectsync 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL