Documentation ¶
Index ¶
- Constants
- Variables
- type BlockAllocator
- type BlockDevice
- type BlockFile
- func (self *BlockFile) Allocate() (pos int64, err error)
- func (self *BlockFile) AllocateBlocks(n int) (pos int64, err error)
- func (self *BlockFile) BlockSize() uint32
- func (self *BlockFile) Close() error
- func (self *BlockFile) ControlData() (data ByteSlice, err error)
- func (self *BlockFile) Free(pos int64) error
- func (self *BlockFile) Open() error
- func (self *BlockFile) Path() string
- func (self *BlockFile) ReadBlock(p int64) (ByteSlice, error)
- func (self *BlockFile) ReadBlocks(p int64, n int) (ByteSlice, error)
- func (self *BlockFile) Remove() error
- func (self *BlockFile) SetControlData(data ByteSlice) (err error)
- func (self *BlockFile) Size() (uint64, error)
- func (self *BlockFile) WriteBlock(p int64, block ByteSlice) error
- type BlockReadWriter
- type BlockReader
- type BlockSizer
- type BlockWriter
- type Closer
- type LFUCacheFile
- func (self *LFUCacheFile) Allocate() (key int64, err error)
- func (self *LFUCacheFile) AllocateBlocks(n int) (key int64, err error)
- func (self *LFUCacheFile) BlockSize() uint32
- func (self *LFUCacheFile) Close() error
- func (self *LFUCacheFile) ControlData() (data bs.ByteSlice, err error)
- func (self *LFUCacheFile) Free(key int64) error
- func (self *LFUCacheFile) ReadBlock(key int64) (block bs.ByteSlice, err error)
- func (self *LFUCacheFile) ReadBlocks(key int64, n int) (blocks bs.ByteSlice, err error)
- func (self *LFUCacheFile) Remove() error
- func (self *LFUCacheFile) SetControlData(data bs.ByteSlice) (err error)
- func (self *LFUCacheFile) WriteBlock(key int64, block bs.ByteSlice) (err error)
- type LRUCacheFile
- func (self *LRUCacheFile) Allocate() (key int64, err error)
- func (self *LRUCacheFile) AllocateBlocks(n int) (key int64, err error)
- func (self *LRUCacheFile) BlockSize() uint32
- func (self *LRUCacheFile) Close() error
- func (self *LRUCacheFile) ControlData() (data bs.ByteSlice, err error)
- func (self *LRUCacheFile) Free(key int64) error
- func (self *LRUCacheFile) Persist() error
- func (self *LRUCacheFile) ReadBlock(key int64) (block bs.ByteSlice, err error)
- func (self *LRUCacheFile) ReadBlocks(key int64, n int) (blocks bs.ByteSlice, err error)
- func (self *LRUCacheFile) Remove() error
- func (self *LRUCacheFile) SetControlData(data bs.ByteSlice) (err error)
- func (self *LRUCacheFile) WriteBlock(key int64, block bs.ByteSlice) (err error)
- type Removable
- type RemovableBlockDevice
- type RootController
Constants ¶
View Source
const BLOCKSIZE = 4096
View Source
const CONTROLSIZE = 20
View Source
const MAX_HEAP = false
View Source
const MIN_HEAP = true
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockAllocator ¶
type BlockDevice ¶
type BlockDevice interface { BlockReadWriter BlockAllocator Closer RootController }
type BlockFile ¶
type BlockFile struct {
// contains filtered or unexported fields
}
func (*BlockFile) AllocateBlocks ¶
func (*BlockFile) ControlData ¶
func (*BlockFile) SetControlData ¶
func (*BlockFile) WriteBlock ¶
type BlockReadWriter ¶
type BlockReader ¶
type BlockSizer ¶
type BlockSizer interface {
BlockSize() uint32
}
type BlockWriter ¶
type BlockWriter interface { BlockSizer WriteBlock(key int64, block ByteSlice) error }
type LFUCacheFile ¶
type LFUCacheFile struct {
// contains filtered or unexported fields
}
func NewLFUCacheFile ¶
func NewLFUCacheFile(file RemovableBlockDevice, size uint64) (cf *LFUCacheFile, err error)
func (*LFUCacheFile) Allocate ¶
func (self *LFUCacheFile) Allocate() (key int64, err error)
func (*LFUCacheFile) AllocateBlocks ¶
func (self *LFUCacheFile) AllocateBlocks(n int) (key int64, err error)
func (*LFUCacheFile) BlockSize ¶
func (self *LFUCacheFile) BlockSize() uint32
func (*LFUCacheFile) Close ¶
func (self *LFUCacheFile) Close() error
func (*LFUCacheFile) ControlData ¶
func (self *LFUCacheFile) ControlData() (data bs.ByteSlice, err error)
func (*LFUCacheFile) Free ¶
func (self *LFUCacheFile) Free(key int64) error
func (*LFUCacheFile) ReadBlock ¶
func (self *LFUCacheFile) ReadBlock(key int64) (block bs.ByteSlice, err error)
func (*LFUCacheFile) ReadBlocks ¶
func (*LFUCacheFile) Remove ¶
func (self *LFUCacheFile) Remove() error
func (*LFUCacheFile) SetControlData ¶
func (self *LFUCacheFile) SetControlData(data bs.ByteSlice) (err error)
func (*LFUCacheFile) WriteBlock ¶
func (self *LFUCacheFile) WriteBlock(key int64, block bs.ByteSlice) (err error)
type LRUCacheFile ¶
type LRUCacheFile struct {
// contains filtered or unexported fields
}
func NewLRUCacheFile ¶
func NewLRUCacheFile(file RemovableBlockDevice, size uint64) (cf *LRUCacheFile, err error)
func OpenLRUCacheFile ¶
func OpenLRUCacheFile(file RemovableBlockDevice, size uint64) (cf *LRUCacheFile, err error)
func (*LRUCacheFile) Allocate ¶
func (self *LRUCacheFile) Allocate() (key int64, err error)
func (*LRUCacheFile) AllocateBlocks ¶
func (self *LRUCacheFile) AllocateBlocks(n int) (key int64, err error)
func (*LRUCacheFile) BlockSize ¶
func (self *LRUCacheFile) BlockSize() uint32
func (*LRUCacheFile) Close ¶
func (self *LRUCacheFile) Close() error
func (*LRUCacheFile) ControlData ¶
func (self *LRUCacheFile) ControlData() (data bs.ByteSlice, err error)
func (*LRUCacheFile) Free ¶
func (self *LRUCacheFile) Free(key int64) error
func (*LRUCacheFile) Persist ¶
func (self *LRUCacheFile) Persist() error
func (*LRUCacheFile) ReadBlock ¶
func (self *LRUCacheFile) ReadBlock(key int64) (block bs.ByteSlice, err error)
func (*LRUCacheFile) ReadBlocks ¶
func (*LRUCacheFile) Remove ¶
func (self *LRUCacheFile) Remove() error
func (*LRUCacheFile) SetControlData ¶
func (self *LRUCacheFile) SetControlData(data bs.ByteSlice) (err error)
func (*LRUCacheFile) WriteBlock ¶
func (self *LRUCacheFile) WriteBlock(key int64, block bs.ByteSlice) (err error)
type RemovableBlockDevice ¶
type RemovableBlockDevice interface { BlockDevice Removable }
type RootController ¶
Click to show internal directories.
Click to hide internal directories.