Documentation ¶
Index ¶
- Variables
- type Dir
- func (dir *Dir) Commit(file *os.File, ref storage.BlobRef) error
- func (dir *Dir) CreateTemporaryFile(prealloc int64) (*os.File, error)
- func (dir *Dir) Delete(ref storage.BlobRef) error
- func (dir *Dir) DeleteTemporary(file *os.File) error
- func (dir *Dir) GarbageCollect() error
- func (dir *Dir) Info() (DiskInfo, error)
- func (dir *Dir) Open(ref storage.BlobRef) (*os.File, error)
- func (dir *Dir) Path() string
- type DiskInfo
- type Store
- func (store *Store) Close() error
- func (store *Store) Create(ctx context.Context, ref storage.BlobRef, size int64) (storage.BlobWriter, error)
- func (store *Store) Delete(ctx context.Context, ref storage.BlobRef) error
- func (store *Store) FreeSpace() (int64, error)
- func (store *Store) GarbageCollect(ctx context.Context) error
- func (store *Store) Open(ctx context.Context, ref storage.BlobRef) (storage.BlobReader, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Error = errs.Class("filestore error")
Error is the default filestore error class
Functions ¶
This section is empty.
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir represents single folder for storing blobs
func (*Dir) CreateTemporaryFile ¶
CreateTemporaryFile creates a preallocated temporary file in the temp directory prealloc preallocates file to make writing faster
func (*Dir) DeleteTemporary ¶
DeleteTemporary deletes a temporary file
func (*Dir) GarbageCollect ¶
GarbageCollect collects files that are pending deletion
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a blob store
func (*Store) Create ¶
func (store *Store) Create(ctx context.Context, ref storage.BlobRef, size int64) (storage.BlobWriter, error)
Create creates a new blob that can be written optionally takes a size argument for performance improvements, -1 is unknown size
func (*Store) GarbageCollect ¶
GarbageCollect tries to delete any files that haven't yet been deleted
Click to show internal directories.
Click to hide internal directories.