Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AddAssetToView(ctx context.Context, root cid.Cid) error
- func (m *Manager) AssetCount() (int, error)
- func (m *Manager) AssetExists(root cid.Cid) (bool, error)
- func (m *Manager) DeleteAsset(root cid.Cid) error
- func (m *Manager) DeletePuller(c cid.Cid) error
- func (m *Manager) GetAsset(root cid.Cid) (io.ReadSeekCloser, error)
- func (m *Manager) GetAssetsInBucket(ctx context.Context, bucketID uint32) ([]cid.Cid, error)
- func (m *Manager) GetBlockCount(ctx context.Context, root cid.Cid) (uint32, error)
- func (m *Manager) GetBucketHashes(ctx context.Context) (map[uint32]string, error)
- func (m *Manager) GetDiskUsageStat() (totalSpace, usage float64)
- func (m *Manager) GetFileSystemType() string
- func (m *Manager) GetPuller(c cid.Cid) ([]byte, error)
- func (m *Manager) GetTopHash(ctx context.Context) (string, error)
- func (m *Manager) GetWaitList() ([]byte, error)
- func (m *Manager) PullerExists(c cid.Cid) (bool, error)
- func (m *Manager) RemoveAssetFromView(ctx context.Context, root cid.Cid) error
- func (m *Manager) SetBlockCount(ctx context.Context, root cid.Cid, count uint32) error
- func (m *Manager) StoreAsset(ctx context.Context, root cid.Cid) error
- func (m *Manager) StoreBlocks(ctx context.Context, root cid.Cid, blks []blocks.Block) error
- func (m *Manager) StorePuller(c cid.Cid, data []byte) error
- func (m *Manager) StoreWaitList(data []byte) error
- type ManagerOptions
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles storage operations
func NewManager ¶
func NewManager(opts *ManagerOptions) (*Manager, error)
NewManager creates a new Manager instance
func (*Manager) AddAssetToView ¶
AddAssetToView adds an asset to the assets view
func (*Manager) AssetCount ¶
AssetCount returns the number of assets
func (*Manager) AssetExists ¶
AssetExists checks if an asset exists
func (*Manager) DeleteAsset ¶
DeleteAsset removes an asset
func (*Manager) DeletePuller ¶
DeletePuller removes an puller from storage
func (*Manager) GetAssetsInBucket ¶
GetAssetsInBucket retrieves the assets in a specific bucket
func (*Manager) GetBlockCount ¶
GetBlockCount retrieves the block count of an asset
func (*Manager) GetBucketHashes ¶
GetBucketHashes retrieves the hashes for each bucket
func (*Manager) GetDiskUsageStat ¶
GetDiskUsageStat retrieves the disk usage statistics
func (*Manager) GetFileSystemType ¶
GetFileSystemType retrieves the type of the file system
func (*Manager) GetTopHash ¶
AssetsView API GetTopHash retrieves the top hash of assets
func (*Manager) GetWaitList ¶
GetWaitList retrieves the waitlist data
func (*Manager) PullerExists ¶
PullerExists checks if an puller exist in storage
func (*Manager) RemoveAssetFromView ¶
RemoveAssetFromView removes an asset from the assets view
func (*Manager) SetBlockCount ¶
SetBlockCount sets the block count of an asset
func (*Manager) StoreAsset ¶
StoreAsset stores a single asset
func (*Manager) StoreBlocks ¶
asset api StoreBlocks stores multiple blocks for an asset
func (*Manager) StorePuller ¶
StorePuller stores puller data in storage
func (*Manager) StoreWaitList ¶
StoreWaitList stores the waitlist data
type ManagerOptions ¶
ManagerOptions contains configuration options for the Manager
type Storage ¶
type Storage interface {
StorePuller(c cid.Cid, data []byte) error
GetPuller(c cid.Cid) ([]byte, error)
PullerExists(c cid.Cid) (bool, error)
DeletePuller(c cid.Cid) error
StoreBlocks(ctx context.Context, root cid.Cid, blks []blocks.Block) error
StoreAsset(ctx context.Context, root cid.Cid) error
GetAsset(root cid.Cid) (io.ReadSeekCloser, error)
AssetExists(root cid.Cid) (bool, error)
DeleteAsset(root cid.Cid) error
AssetCount() (int, error)
GetBlockCount(ctx context.Context, root cid.Cid) (uint32, error)
SetBlockCount(ctx context.Context, root cid.Cid, count uint32) error
// assets view
GetTopHash(ctx context.Context) (string, error)
GetBucketHashes(ctx context.Context) (map[uint32]string, error)
GetAssetsInBucket(ctx context.Context, bucketID uint32) ([]cid.Cid, error)
AddAssetToView(ctx context.Context, root cid.Cid) error
RemoveAssetFromView(ctx context.Context, root cid.Cid) error
StoreWaitList(data []byte) error
GetWaitList() ([]byte, error)
GetDiskUsageStat() (totalSpace, usage float64)
GetFileSystemType() string
}
Storage is an interface for handling storage operations related to assets.