spacestorage

package
v0.5.20 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TreeDeletedStatusQueued  = "queued"
	TreeDeletedStatusDeleted = "deleted"
)
View Source
const CName = "common.commonspace.spacestorage"

Variables

View Source
var (
	ErrSpaceStorageExists   = errors.New("space storage exists")
	ErrSpaceStorageMissing  = errors.New("space storage missing")
	ErrIncorrectSpaceHeader = errors.New("incorrect space header")

	ErrTreeStorageAlreadyDeleted = errors.New("tree storage already deleted")
)

Functions

This section is empty.

Types

type InMemorySpaceStorage

type InMemorySpaceStorage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*InMemorySpaceStorage) AclStorage

func (*InMemorySpaceStorage) AllTrees

func (*InMemorySpaceStorage) Close

func (i *InMemorySpaceStorage) Close(ctx context.Context) (err error)

func (*InMemorySpaceStorage) CopyStorage

func (i *InMemorySpaceStorage) CopyStorage() *InMemorySpaceStorage

func (*InMemorySpaceStorage) CreateTreeStorage

func (*InMemorySpaceStorage) HasTree

func (i *InMemorySpaceStorage) HasTree(id string) (bool, error)

func (*InMemorySpaceStorage) Id

func (i *InMemorySpaceStorage) Id() string

func (*InMemorySpaceStorage) Init added in v0.2.0

func (i *InMemorySpaceStorage) Init(a *app.App) (err error)

func (*InMemorySpaceStorage) IsSpaceDeleted

func (i *InMemorySpaceStorage) IsSpaceDeleted() (bool, error)

func (*InMemorySpaceStorage) Name added in v0.2.0

func (i *InMemorySpaceStorage) Name() (name string)

func (*InMemorySpaceStorage) ReadSpaceHash

func (i *InMemorySpaceStorage) ReadSpaceHash() (hash string, err error)

func (*InMemorySpaceStorage) Run added in v0.2.0

func (i *InMemorySpaceStorage) Run(ctx context.Context) (err error)

func (*InMemorySpaceStorage) SetSpaceDeleted

func (i *InMemorySpaceStorage) SetSpaceDeleted() error

func (*InMemorySpaceStorage) SetTreeDeletedStatus

func (i *InMemorySpaceStorage) SetTreeDeletedStatus(id, state string) error

func (*InMemorySpaceStorage) SetTrees

func (i *InMemorySpaceStorage) SetTrees(trees map[string]treestorage.TreeStorage)

func (*InMemorySpaceStorage) SpaceHeader

func (*InMemorySpaceStorage) SpaceSettingsId

func (i *InMemorySpaceStorage) SpaceSettingsId() string

func (*InMemorySpaceStorage) StoredIds

func (i *InMemorySpaceStorage) StoredIds() ([]string, error)

func (*InMemorySpaceStorage) TreeDeletedStatus

func (i *InMemorySpaceStorage) TreeDeletedStatus(id string) (string, error)

func (*InMemorySpaceStorage) TreeRoot

func (*InMemorySpaceStorage) TreeStorage

func (*InMemorySpaceStorage) WriteSpaceHash

func (i *InMemorySpaceStorage) WriteSpaceHash(hash string) error

type InMemorySpaceStorageProvider

type InMemorySpaceStorageProvider struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*InMemorySpaceStorageProvider) CreateSpaceStorage

func (*InMemorySpaceStorageProvider) Init

func (i *InMemorySpaceStorageProvider) Init(a *app.App) (err error)

func (*InMemorySpaceStorageProvider) Name

func (i *InMemorySpaceStorageProvider) Name() (name string)

func (*InMemorySpaceStorageProvider) SetStorage

func (i *InMemorySpaceStorageProvider) SetStorage(storage SpaceStorage)

func (*InMemorySpaceStorageProvider) SpaceExists

func (i *InMemorySpaceStorageProvider) SpaceExists(id string) bool

func (*InMemorySpaceStorageProvider) WaitSpaceStorage

func (i *InMemorySpaceStorageProvider) WaitSpaceStorage(ctx context.Context, id string) (SpaceStorage, error)

type SpaceStorage

type SpaceStorage interface {
	app.ComponentRunnable
	Id() string
	SetSpaceDeleted() error
	IsSpaceDeleted() (bool, error)
	SetTreeDeletedStatus(id, state string) error
	TreeDeletedStatus(id string) (string, error)
	SpaceSettingsId() string
	AclStorage() (liststorage.ListStorage, error)
	SpaceHeader() (*spacesyncproto.RawSpaceHeaderWithId, error)
	StoredIds() ([]string, error)
	TreeRoot(id string) (*treechangeproto.RawTreeChangeWithId, error)
	TreeStorage(id string) (treestorage.TreeStorage, error)
	HasTree(id string) (bool, error)
	CreateTreeStorage(payload treestorage.TreeStorageCreatePayload) (treestorage.TreeStorage, error)
	WriteSpaceHash(hash string) error
	ReadSpaceHash() (hash string, err error)
}

func NewInMemorySpaceStorage

func NewInMemorySpaceStorage(payload SpaceStorageCreatePayload) (SpaceStorage, error)

type SpaceStorageCreatePayload

type SpaceStorageCreatePayload struct {
	AclWithId           *consensusproto.RawRecordWithId
	SpaceHeaderWithId   *spacesyncproto.RawSpaceHeaderWithId
	SpaceSettingsWithId *treechangeproto.RawTreeChangeWithId
}

type SpaceStorageProvider

type SpaceStorageProvider interface {
	app.Component
	WaitSpaceStorage(ctx context.Context, id string) (SpaceStorage, error)
	SpaceExists(id string) bool
	CreateSpaceStorage(payload SpaceStorageCreatePayload) (SpaceStorage, error)
}

func NewInMemorySpaceStorageProvider

func NewInMemorySpaceStorageProvider() SpaceStorageProvider

Directories

Path Synopsis
Package mock_spacestorage is a generated GoMock package.
Package mock_spacestorage is a generated GoMock package.

Jump to

Keyboard shortcuts

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