Documentation ¶
Index ¶
Constants ¶
View Source
const CName = spacestorage.CName
View Source
const (
IndexStorageName = ".index"
)
Variables ¶
View Source
var ( ErrUnknownSpaceId = errors.New("unknown space id") ErrNoLastRecordId = errors.New("no last record id") )
View Source
var ( ErrClosed = errors.New("space storage closed") ErrDeleted = errors.New("space storage deleted") )
View Source
var ( ErrLocked = errors.New("space storage locked") ErrSpaceIdIsEmpty = errors.New("space id is empty") )
Functions ¶
This section is empty.
Types ¶
type ChangeSizeStats ¶ added in v0.4.2
type IndexStorage ¶
type IndexStorage interface { SetSpaceStatus(ctx context.Context, spaceId string, status SpaceStatus, recId string) (err error) SpaceStatus(ctx context.Context, spaceId string) (status SpaceStatus, err error) LastRecordId(ctx context.Context) (id string, err error) Close() (err error) }
func OpenIndexStorage ¶
func OpenIndexStorage(ctx context.Context, rootPath string) (ds IndexStorage, err error)
type NodeStorage ¶
type NodeStorage interface { spacestorage.SpaceStorageProvider IndexStorage() IndexStorage SpaceStorage(ctx context.Context, spaceId string) (spacestorage.SpaceStorage, error) TryLockAndDo(ctx context.Context, spaceId string, do func() error) (err error) DumpStorage(ctx context.Context, id string, do func(path string) error) (err error) AllSpaceIds() (ids []string, err error) OnDeleteStorage(onDelete func(ctx context.Context, spaceId string)) OnWriteHash(onWrite func(ctx context.Context, spaceId, hash string)) StoreDir(spaceId string) (path string) DeleteSpaceStorage(ctx context.Context, spaceId string) error }
func New ¶
func New() NodeStorage
type NodeStorageStats ¶ added in v0.4.2
type NodeStorageStats interface {
GetSpaceStats(treeTop int) (SpaceStats, error)
}
type SpaceStats ¶ added in v0.4.2
type SpaceStats struct { ObjectsCount int `json:"objectsCount,omitempty"` DeletedObjectsCount int `json:"deletedObjectsCount"` ChangesCount int `json:"changesCount"` ChangeSize ChangeSizeStats `json:"changeSizeStats,omitempty"` TreeStats []TreeStat `json:"treeStats,omitempty"` // contains filtered or unexported fields }
type SpaceStatus ¶ added in v0.3.1
type SpaceStatus int
const ( SpaceStatusOk SpaceStatus = iota SpaceStatusRemove )
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_nodestorage is a generated GoMock package.
|
Package mock_nodestorage is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.