Documentation ¶
Index ¶
- type BlockStorage
- func (s *BlockStorage) CreateUploadSession(uploadID uuid.UUID, in []proto.Manifest, ttl time.Duration) (missing []proto.ID, err error)
- func (s *BlockStorage) FinishUploadSession(uploadID uuid.UUID) (err error)
- func (s *BlockStorage) GetManifests(ids []proto.ID) (res []proto.Manifest, err error)
- func (s *BlockStorage) GetMissingBlobIDs(ids []proto.ID) (res []proto.ID, err error)
- func (s *BlockStorage) IsSpecExists(id proto.ID) (ok bool, err error)
- func (s *BlockStorage) ReadChunkFromBlob(blobID proto.ID, size, offset int64, w io.Writer) (err error)
- func (s *BlockStorage) ReadSpec(id proto.ID) (res proto.Spec, err error)
- func (s *BlockStorage) SetTag(tag string, blobIDs []proto.ID) (err error)
- func (s *BlockStorage) UploadChunk(uploadID uuid.UUID, chunkID proto.ID, r io.Reader) (err error)
- func (s *BlockStorage) WriteChunk(blobID, chunkID proto.ID, size int64, r io.Reader) (err error)
- func (s *BlockStorage) WriteSpec(in proto.Spec) (err error)
- type BlockStorageOptions
- type Storage
- type StorageFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockStorage ¶
type BlockStorage struct { *BlockStorageOptions // Max Open files locker FDLocks *concurrency.Locks *concurrency.BatchPool }
Simple block device storage
func NewBlockStorage ¶
func NewBlockStorage(options *BlockStorageOptions) *BlockStorage
func (*BlockStorage) CreateUploadSession ¶
func (*BlockStorage) FinishUploadSession ¶
func (s *BlockStorage) FinishUploadSession(uploadID uuid.UUID) (err error)
func (*BlockStorage) GetManifests ¶
func (*BlockStorage) GetMissingBlobIDs ¶
func (*BlockStorage) IsSpecExists ¶
func (s *BlockStorage) IsSpecExists(id proto.ID) (ok bool, err error)
func (*BlockStorage) ReadChunkFromBlob ¶
func (*BlockStorage) SetTag ¶
func (s *BlockStorage) SetTag(tag string, blobIDs []proto.ID) (err error)
func (*BlockStorage) UploadChunk ¶
func (*BlockStorage) WriteChunk ¶
type BlockStorageOptions ¶
type Storage ¶
type Storage interface { IsSpecExists(id proto.ID) (ok bool, err error) // Write spec WriteSpec(s proto.Spec) (err error) // Read spec ReadSpec(id proto.ID) (res proto.Spec, err error) // Get manifests by it's ids GetManifests(ids []proto.ID) (res []proto.Manifest, err error) // Read Chunk from blob by size and offset ReadChunkFromBlob(blobID proto.ID, size, offset int64, w io.Writer) (err error) // Returns IDs of requested blobs except already stored GetMissingBlobIDs(ids []proto.ID) (res []proto.ID, err error) // Create new upload session. Returns upload ID and IDs of chunks // missing on bard. Upload id is simple uuid bytes CreateUploadSession(uploadID uuid.UUID, in []proto.Manifest, ttl time.Duration) (missingChunkIDs []proto.ID, err error) // Upload chunk UploadChunk(uploadID uuid.UUID, chunkID proto.ID, r io.Reader) (err error) // Finish upload session FinishUploadSession(uploadID uuid.UUID) (err error) // Set tag on blobs SetTag(tag string, blobIDs []proto.ID) (err error) }
All operations in storage driver are independent to each other
func BlockStorageFactory ¶
func GuessStorage ¶
Click to show internal directories.
Click to hide internal directories.