Documentation ¶
Index ¶
- Variables
- func GenerateNewBlobPath(bs RandomAccessBlobStore) (string, error)
- type BlobHandle
- type BlobLister
- type BlobMatcher
- type BlobRemover
- type BlobSizer
- type BlobStore
- type FileBlobHandle
- type FileBlobStore
- func (f *FileBlobStore) BlobSize(blobpath string) (int64, error)
- func (f *FileBlobStore) Flags() int
- func (f *FileBlobStore) GetBase() string
- func (*FileBlobStore) ImplName() string
- func (f *FileBlobStore) ListBlobs() ([]string, error)
- func (f *FileBlobStore) Open(blobpath string, flags int) (BlobHandle, error)
- func (f *FileBlobStore) OpenReader(blobpath string) (io.ReadCloser, error)
- func (f *FileBlobStore) OpenWriter(blobpath string) (io.WriteCloser, error)
- func (f *FileBlobStore) RemoveBlob(blobpath string) error
- func (f *FileBlobStore) SetFlags(flags int)
- func (f *FileBlobStore) TotalSize() (int64, error)
- type MemBlobHandle
- type MemBlobStore
- type MockBlobHandle
- type MockBlobStore
- type MockBlobStoreOperation
- type Mux
- func (m Mux) BlobSize(blobpath string) (int64, error)
- func (m Mux) Flags() int
- func (Mux) ImplName() string
- func (m Mux) ListBlobs() ([]string, error)
- func (m Mux) Open(blobpath string, flags int) (BlobHandle, error)
- func (m Mux) OpenReader(blobpath string) (io.ReadCloser, error)
- func (m Mux) OpenWriter(blobpath string) (io.WriteCloser, error)
- func (m Mux) RemoveBlob(blobpath string) error
- type MuxEntry
- type OffsetReader
- type OffsetWriter
- type PReader
- type PWriter
- type RandomAccessBlobStore
- type RandomAccessIO
- type SizeQueryable
- type TotalSizer
- type ZeroFillPReader
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEmptyMux = errors.New("blobstore.Mux is empty.")
)
Functions ¶
func GenerateNewBlobPath ¶
func GenerateNewBlobPath(bs RandomAccessBlobStore) (string, error)
GenerateNewBlobPath tries to return a new unique blob path. Note that this may return an already used blobpath in high contention, although it is highly unlikely it will happen.
Types ¶
type BlobHandle ¶
type BlobHandle interface { RandomAccessIO SizeQueryable Truncate(int64) error io.Closer }
type BlobLister ¶
type BlobMatcher ¶
type BlobRemover ¶
type BlobStore ¶
type BlobStore interface { OpenWriter(blobpath string) (io.WriteCloser, error) OpenReader(blobpath string) (io.ReadCloser, error) }
type FileBlobHandle ¶
func (FileBlobHandle) Close ¶
func (h FileBlobHandle) Close() error
func (FileBlobHandle) Size ¶
func (h FileBlobHandle) Size() int64
func (FileBlobHandle) Truncate ¶
func (h FileBlobHandle) Truncate(size int64) error
type FileBlobStore ¶
type FileBlobStore struct {
// contains filtered or unexported fields
}
func NewFileBlobStore ¶
func NewFileBlobStore(base string, flags int) (*FileBlobStore, error)
func (*FileBlobStore) Flags ¶
func (f *FileBlobStore) Flags() int
func (*FileBlobStore) GetBase ¶
func (f *FileBlobStore) GetBase() string
func (*FileBlobStore) ImplName ¶
func (*FileBlobStore) ImplName() string
func (*FileBlobStore) ListBlobs ¶
func (f *FileBlobStore) ListBlobs() ([]string, error)
func (*FileBlobStore) Open ¶
func (f *FileBlobStore) Open(blobpath string, flags int) (BlobHandle, error)
func (*FileBlobStore) OpenReader ¶
func (f *FileBlobStore) OpenReader(blobpath string) (io.ReadCloser, error)
func (*FileBlobStore) OpenWriter ¶
func (f *FileBlobStore) OpenWriter(blobpath string) (io.WriteCloser, error)
func (*FileBlobStore) RemoveBlob ¶
func (f *FileBlobStore) RemoveBlob(blobpath string) error
func (*FileBlobStore) SetFlags ¶
func (f *FileBlobStore) SetFlags(flags int)
func (*FileBlobStore) TotalSize ¶
func (f *FileBlobStore) TotalSize() (int64, error)
type MemBlobHandle ¶
type MemBlobHandle struct {
Content []byte
}
func NewMemBlobHandle ¶
func NewMemBlobHandle() *MemBlobHandle
func (*MemBlobHandle) Close ¶
func (bh *MemBlobHandle) Close() error
func (*MemBlobHandle) Size ¶
func (bh *MemBlobHandle) Size() int64
func (*MemBlobHandle) Truncate ¶
func (bh *MemBlobHandle) Truncate(newSize int64) error
type MemBlobStore ¶
type MemBlobStore struct {
Paths map[string]*MemBlobHandle
}
func NewMemBlobStore ¶
func NewMemBlobStore() *MemBlobStore
func (*MemBlobStore) Flags ¶
func (bs *MemBlobStore) Flags() int
func (*MemBlobStore) Open ¶
func (bs *MemBlobStore) Open(blobpath string, flags int) (BlobHandle, error)
type MockBlobHandle ¶
type MockBlobHandle struct { Log []MockBlobStoreOperation PayloadLen int64 }
func NewMockBlobHandle ¶
func NewMockBlobHandle() *MockBlobHandle
func (*MockBlobHandle) Close ¶
func (bh *MockBlobHandle) Close() error
func (*MockBlobHandle) Size ¶
func (bh *MockBlobHandle) Size() int64
func (*MockBlobHandle) Truncate ¶
func (bh *MockBlobHandle) Truncate(size int64) error
type MockBlobStore ¶
type MockBlobStore struct {
Paths map[string]*MockBlobHandle
}
func NewMockBlobStore ¶
func NewMockBlobStore() *MockBlobStore
func (*MockBlobStore) Flags ¶
func (bs *MockBlobStore) Flags() int
func (*MockBlobStore) Open ¶
func (bs *MockBlobStore) Open(blobpath string, flags int) (BlobHandle, error)
type MockBlobStoreOperation ¶
type Mux ¶
type Mux []MuxEntry
func (Mux) OpenReader ¶
func (m Mux) OpenReader(blobpath string) (io.ReadCloser, error)
func (Mux) OpenWriter ¶
func (m Mux) OpenWriter(blobpath string) (io.WriteCloser, error)
func (Mux) RemoveBlob ¶
type MuxEntry ¶
type MuxEntry struct { BlobMatcher BlobStore }
type OffsetReader ¶
OffsetReader provides io.Reader from PReader
type OffsetWriter ¶
OffsetWriter provides io.Reader from PWriter
type RandomAccessBlobStore ¶
type RandomAccessBlobStore interface { Open(blobpath string, flags int) (BlobHandle, error) flags.FlagsReader }
type RandomAccessIO ¶
type SizeQueryable ¶
type SizeQueryable interface {
Size() int64
}
type TotalSizer ¶
type ZeroFillPReader ¶
type ZeroFillPReader struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.