hybrid_cache

package
v4.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackingStore

type BackingStore interface {
	buffer.Block
	io.Closer
	GrowTo(size int64) error
}

func NewFileStore

func NewFileStore(blockSize int64) (BackingStore, error)

type BufferStore

type BufferStore struct {
	// contains filtered or unexported fields
}

func (*BufferStore) Append

func (m *BufferStore) Append(buf []byte)

用于存储不复用的[]byte

func (*BufferStore) Close

func (m *BufferStore) Close() error

func (*BufferStore) GrowTo

func (m *BufferStore) GrowTo(size int64) (err error)

func (*BufferStore) ReadAt

func (m *BufferStore) ReadAt(p []byte, off int64) (int, error)

func (*BufferStore) Size

func (m *BufferStore) Size() int64

func (*BufferStore) WriteAt

func (m *BufferStore) WriteAt(p []byte, off int64) (int, error)

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) CopyFromN

func (hc *HybridCache) CopyFromN(src io.Reader, n int64) (written int64, err error)

func (*HybridCache) NextBlock

func (hc *HybridCache) NextBlock() (buffer.Block, error)

func (*HybridCache) ReadAt

func (hc *HybridCache) ReadAt(p []byte, off int64) (n int, err 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

func (*HybridCache) WriteAt

func (hc *HybridCache) WriteAt(p []byte, off int64) (n int, err error)

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

func (*MultiFileStore) WriteAt

func (m *MultiFileStore) WriteAt(p []byte, off int64) (n int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL