Documentation ¶
Index ¶
- Constants
- Variables
- type File
- type FileInfo
- type Index
- type LevelDBIndex
- type Status
- type Volume
- func (v *Volume) Close()
- func (v *Volume) Delete(fid uint64, fileName string) error
- func (v *Volume) Get(fid uint64) (*File, error)
- func (v *Volume) GetDatafileSize() uint64
- func (v *Volume) GetMaxFreeSpace() uint64
- func (v *Volume) NewFile(fid uint64, fileName string, size uint64) (f *File, err error)
Constants ¶
View Source
const ( ReversedsizeOffsetPrefix = '\x11' //key= "\x01"+Reversesize(8 byte)+offset(8 byte) value=[] OffsetSizePrefix = '\x22' //key= "\x02"+offset(8 byte)+size(8 byte) value=[] )
Variables ¶
View Source
var ( TruncateSize uint64 = 1 << 30 //1GB MaxVolumeSize uint64 = 512 * TruncateSize //512GB )
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct { Fid uint64 Offset uint64 Size uint64 Ctime time.Time Mtime time.Time Atime time.Time FileName string }
func (*FileInfo) MarshalBinary ¶
func (*FileInfo) UnMarshalBinary ¶
type LevelDBIndex ¶
type LevelDBIndex struct {
// contains filtered or unexported fields
}
func NewLevelDBIndex ¶
func NewLevelDBIndex(dir string, vid uint64) (index *LevelDBIndex, err error)
func (*LevelDBIndex) Close ¶
func (l *LevelDBIndex) Close() error
func (*LevelDBIndex) Delete ¶
func (l *LevelDBIndex) Delete(fid uint64) error
func (*LevelDBIndex) Has ¶
func (l *LevelDBIndex) Has(fid uint64) bool
func (*LevelDBIndex) Set ¶
func (l *LevelDBIndex) Set(fi *FileInfo) error
type Status ¶
type Status struct {
// contains filtered or unexported fields
}
status主要存储空闲块的offset size
Click to show internal directories.
Click to hide internal directories.