Documentation
¶
Index ¶
- type FilesystemStorage
- func (s *FilesystemStorage) GetChunk(id contenthash.Hash) (io.ReadCloser, error)
- func (s *FilesystemStorage) GetObject(id contenthash.Hash) (*pb.ObjectManifest, error)
- func (s *FilesystemStorage) PutChunk(id contenthash.Hash, r io.ReadSeeker) error
- func (s *FilesystemStorage) PutObject(manifest *pb.ObjectManifest) error
- type FilesystemStorageOpts
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemStorage ¶
type FilesystemStorage struct {
// contains filtered or unexported fields
}
func NewFilesystemStorage ¶
func NewFilesystemStorage(dir string, opts *FilesystemStorageOpts) (*FilesystemStorage, error)
func (*FilesystemStorage) GetChunk ¶
func (s *FilesystemStorage) GetChunk(id contenthash.Hash) (io.ReadCloser, error)
GetChunk retrieves a chunk from storage.
func (*FilesystemStorage) GetObject ¶
func (s *FilesystemStorage) GetObject(id contenthash.Hash) (*pb.ObjectManifest, error)
GetObject retrieves an object manifest from storage.
func (*FilesystemStorage) PutChunk ¶
func (s *FilesystemStorage) PutChunk(id contenthash.Hash, r io.ReadSeeker) error
PutChunk adds a chunk to the storage.
func (*FilesystemStorage) PutObject ¶
func (s *FilesystemStorage) PutObject(manifest *pb.ObjectManifest) error
PutObject adds an object manifest to the storage.
type FilesystemStorageOpts ¶ added in v0.5.0
type FilesystemStorageOpts struct {
// NoSync disables fsync() calls after writing files. This will increase
// performance but may lead to data loss in the event of a system crash.
NoSync bool
}
type Storage ¶
type Storage interface {
// GetObject retrieves an object manifest from storage.
GetObject(id contenthash.Hash) (*pb.ObjectManifest, error)
// PutObject adds an object manifest to the storage.
PutObject(manifest *pb.ObjectManifest) error
// GetChunk retrieves a chunk from storage.
GetChunk(id contenthash.Hash) (io.ReadCloser, error)
// PutChunk adds a chunk to the storage.
PutChunk(id contenthash.Hash, r io.ReadSeeker) error
}
Click to show internal directories.
Click to hide internal directories.