Documentation ¶
Index ¶
- type Disk
- func (s *Disk) ChangeConfig(log types.Logger)
- func (s *Disk) Discard(id *types.ObjectID) error
- func (s *Disk) DiscardPart(idx *types.ObjectIndex) error
- func (s *Disk) GetAvailableParts(oid *types.ObjectID) ([]*types.ObjectIndex, error)
- func (s *Disk) GetMetadata(id *types.ObjectID) (*types.ObjectMetadata, error)
- func (s *Disk) GetPart(idx *types.ObjectIndex) (io.ReadCloser, error)
- func (s *Disk) Iterate(callback func(*types.ObjectMetadata, ...*types.ObjectIndex) bool) error
- func (s *Disk) PartSize() uint64
- func (s *Disk) SaveMetadata(m *types.ObjectMetadata) error
- func (s *Disk) SavePart(idx *types.ObjectIndex, data io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
Disk implements the Storage interface by writing data to a disk
func (*Disk) ChangeConfig ¶
ChangeConfig change the logger of the disk storage
func (*Disk) DiscardPart ¶
func (s *Disk) DiscardPart(idx *types.ObjectIndex) error
DiscardPart removes the specified part of an Object from the disk.
func (*Disk) GetAvailableParts ¶
GetAvailableParts returns types.ObjectIndexMap including all the available parts of for the object specified by the provided objectMetadata
func (*Disk) GetMetadata ¶
GetMetadata returns the metadata on disk for this object, if present.
func (*Disk) GetPart ¶
func (s *Disk) GetPart(idx *types.ObjectIndex) (io.ReadCloser, error)
GetPart returns an io.ReadCloser that will read the specified part of the object from the disk.
func (*Disk) Iterate ¶
func (s *Disk) Iterate(callback func(*types.ObjectMetadata, ...*types.ObjectIndex) bool) error
Iterate is a disk-specific function that iterates over all the objects on the disk and passes them to the supplied callback function. If the callback function returns false, the iteration stops.
func (*Disk) SaveMetadata ¶
func (s *Disk) SaveMetadata(m *types.ObjectMetadata) error
SaveMetadata writes the supplied metadata to the disk.