Documentation
¶
Index ¶
- type BackingStore
- type BufferStore
- type HybridCache
- func (hc *HybridCache) AllocBlock(size uint64) (buffer.Block, error)
- func (hc *HybridCache) Close() error
- func (hc *HybridCache) CopyFromN(src io.Reader, n int64) (written int64, err error)
- func (hc *HybridCache) NextBlock() (buffer.Block, error)
- func (hc *HybridCache) ReadAt(p []byte, off int64) (n int, err error)
- func (hc *HybridCache) RewindBySize(size uint64)
- func (hc *HybridCache) RewindOneBlock()
- func (hc *HybridCache) Size() int64
- func (hc *HybridCache) WriteAt(p []byte, off int64) (n int, err error)
- type MultiFileStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackingStore ¶
func NewFileStore ¶
func NewFileStore(blockSize int64) (BackingStore, error)
type BufferStore ¶
type BufferStore struct {
// contains filtered or unexported fields
}
func (*BufferStore) Close ¶
func (m *BufferStore) Close() error
func (*BufferStore) GrowTo ¶
func (m *BufferStore) GrowTo(size int64) (err error)
func (*BufferStore) Size ¶
func (m *BufferStore) Size() int64
type HybridCache ¶
type HybridCache struct {
// contains filtered or unexported fields
}
线程不安全,单线程使用,或者外部加锁保护
func NewHybridCache ¶
func NewHybridCache(blockSize, maxMemorySize uint64) (hc *HybridCache, err error)
HybridCache 线程不安全,单线程使用,或者外部加锁保护
func (*HybridCache) AllocBlock ¶
func (hc *HybridCache) AllocBlock(size uint64) (buffer.Block, error)
分配一个新的Block,支持读写,大小为size
func (*HybridCache) Close ¶
func (hc *HybridCache) Close() error
func (*HybridCache) RewindBySize ¶
func (hc *HybridCache) RewindBySize(size uint64)
func (*HybridCache) RewindOneBlock ¶
func (hc *HybridCache) RewindOneBlock()
func (*HybridCache) Size ¶
func (hc *HybridCache) Size() int64
type MultiFileStore ¶
type MultiFileStore struct {
// contains filtered or unexported fields
}
func (*MultiFileStore) Close ¶
func (m *MultiFileStore) Close() error
func (*MultiFileStore) GrowTo ¶
func (m *MultiFileStore) GrowTo(size int64) error
func (*MultiFileStore) ReadAt ¶
func (m *MultiFileStore) ReadAt(p []byte, off int64) (n int, err error)
func (*MultiFileStore) Size ¶
func (s *MultiFileStore) Size() int64
Click to show internal directories.
Click to hide internal directories.