 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- Variables
- func CreateTreeStorage(t *testing.T, storage spacestorage.SpaceStorage, treeLen, changeLen int)
- func GenStorage(t *testing.T, ss NodeStorage, treeLen, changeLen int) spacestorage.SpaceStorage
- func NewStorageCreatePayload(t *testing.T) spacestorage.SpaceStorageCreatePayload
- type ChangeSizeStats
- type Config
- type IndexStorage
- type NodeStorage
- type NodeStorageStats
- type ObjectSpaceStats
- type PerObjectSizeStats
- type SpaceStats
- type SpaceStatus
- type SpaceStorageStat
- type SpaceUpdate
- type StorageStat
- type StorageStats
- type TreeStat
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") )
Functions ¶
func CreateTreeStorage ¶ added in v0.5.0
func CreateTreeStorage(t *testing.T, storage spacestorage.SpaceStorage, treeLen, changeLen int)
func GenStorage ¶ added in v0.5.0
func GenStorage(t *testing.T, ss NodeStorage, treeLen, changeLen int) spacestorage.SpaceStorage
func NewStorageCreatePayload ¶ added in v0.5.0
func NewStorageCreatePayload(t *testing.T) spacestorage.SpaceStorageCreatePayload
Types ¶
type ChangeSizeStats ¶ added in v0.4.2
type IndexStorage ¶ added in v0.5.0
type IndexStorage interface {
	UpdateHash(ctx context.Context, update SpaceUpdate) (err error)
	RemoveHash(ctx context.Context, spaceId string) (err error)
	ReadHashes(ctx context.Context, iterFunc func(update SpaceUpdate) (bool, error)) (err error)
	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 ¶ added in v0.5.0
func OpenIndexStorage(ctx context.Context, rootPath string) (ds IndexStorage, err error)
type NodeStorage ¶
type NodeStorage interface {
	spacestorage.SpaceStorageProvider
	IndexStorage() IndexStorage
	IndexSpace(ctx context.Context, spaceId string, setHead bool) (spacestorage.SpaceStorage, error)
	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, oldHash, newHash string))
	StoreDir(spaceId string) (path string)
	DeleteSpaceStorage(ctx context.Context, spaceId string) error
	GetStats(ctx context.Context, id string, treeTop int) (spaceStats SpaceStats, err error)
}
    func New ¶
func New() NodeStorage
type NodeStorageStats ¶ added in v0.4.2
type NodeStorageStats interface {
	GetSpaceStats(ctx context.Context, treeTop int) (ObjectSpaceStats, error)
}
    type ObjectSpaceStats ¶ added in v0.5.0
type ObjectSpaceStats struct {
	ObjectsCount        int                `json:"objectsCount,omitempty"`
	DeletedObjectsCount int                `json:"deletedObjectsCount"`
	ChangesCount        int                `json:"changesCount"`
	ChangeSize          ChangeSizeStats    `json:"changeSizeStats,omitempty"`
	PerObjectSize       PerObjectSizeStats `json:"perObjectSizeStats,omitempty"`
	TreeStats           []TreeStat         `json:"treeStats,omitempty"`
	// contains filtered or unexported fields
}
    type PerObjectSizeStats ¶ added in v0.5.0
type PerObjectSizeStats struct {
	LenTotalMax     int     `json:"len"`
	LenTotalP95     float64 `json:"lenTotalP95"`
	LenTotalMedian  float64 `json:"lenTotalMedian"`
	SizeTotalMax    int     `json:"sizeTotal"`
	SizeTotalP95    float64 `json:"SizeTotalP95"`
	SizeTotalMedian float64 `json:"SizeTotalMedian"`
	SizeMax         int     `json:"sizeMax"`
	SizeP95         float64 `json:"sizeP95"`
	SizeMedian      float64 `json:"sizeMedian"`
}
    type SpaceStats ¶ added in v0.4.2
type SpaceStats struct {
	Storage ObjectSpaceStats `json:"storage"`
	Acl     struct {
		Readers int `json:"readers"`
		Writers int `json:"writers"`
	} `json:"acl"`
}
    type SpaceStatus ¶ added in v0.3.1
type SpaceStatus int
const ( SpaceStatusOk SpaceStatus = iota SpaceStatusRemove SpaceStatusRemovePrepare )
type SpaceStorageStat ¶ added in v0.5.3
type SpaceUpdate ¶ added in v0.6.4
type StorageStat ¶ added in v0.5.0
type StorageStat struct {
	// contains filtered or unexported fields
}
    type StorageStats ¶ added in v0.5.3
type StorageStats struct {
	Total  int                `json:"total"`
	Spaces []SpaceStorageStat `json:"spaces"`
}
    
       Source Files
      ¶
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.