Documentation ¶
Index ¶
- Variables
- type Dir
- func (dir *Dir) Commit(ctx context.Context, file *os.File, ref storage.BlobRef) (err error)
- func (dir *Dir) CreateTemporaryFile(ctx context.Context, prealloc int64) (_ *os.File, err error)
- func (dir *Dir) Delete(ctx context.Context, ref storage.BlobRef) (err error)
- func (dir *Dir) DeleteTemporary(ctx context.Context, file *os.File) (err error)
- func (dir *Dir) GarbageCollect(ctx context.Context) (err error)
- func (dir *Dir) Info() (DiskInfo, error)
- func (dir *Dir) Open(ctx context.Context, ref storage.BlobRef) (_ *os.File, err 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, err error)
- func (store *Store) Delete(ctx context.Context, ref storage.BlobRef) (err error)
- func (store *Store) FreeSpace() (int64, error)
- func (store *Store) GarbageCollect(ctx context.Context) (err error)
- func (store *Store) Open(ctx context.Context, ref storage.BlobRef) (_ storage.BlobReader, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is the default filestore error class Error = errs.Class("filestore error") )
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, err 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.