Documentation
¶
Index ¶
- Constants
- Variables
- type FileInfo
- type IFile
- type IWal
- type Item
- type Log
- type OpType
- type Option
- type Record
- type UnixFile
- func (f *UnixFile) Check() error
- func (f *UnixFile) Close() error
- func (f *UnixFile) First() (*Record, error)
- func (f *UnixFile) Header() (*header, error)
- func (f *UnixFile) Info() *FileInfo
- func (f *UnixFile) Item(idx uint64) (*Item, error)
- func (f *UnixFile) Items() ([]*Item, error)
- func (f *UnixFile) Last() (*Record, error)
- func (f *UnixFile) Read(p []byte) (n int, err error)
- func (f *UnixFile) ReadAt(p []byte, off int64) (n int, err error)
- func (f *UnixFile) Remove(stx, end int64)
- func (f *UnixFile) Seek(offset int64, whence int) (int64, error)
- func (f *UnixFile) Stat() (os.FileInfo, error)
- func (f *UnixFile) Sync() error
- func (f *UnixFile) Truncate(size int64) error
- func (f *UnixFile) Write(p []byte) (n int, err error)
- func (f *UnixFile) WriteAt(p []byte, off int64) (n int, err error)
- func (f *UnixFile) WriteSize(size uint32)
Constants ¶
View Source
const ( RecordSize = 4 IndexSize = 8 RecordMaxSize = 1 << 31 )
View Source
const HeaderSize = 32
Variables ¶
Functions ¶
This section is empty.
Types ¶
type IFile ¶
type IFile interface {
io.Closer
io.Reader
io.ReaderAt
io.Seeker
io.Writer
io.WriterAt
// Stat returns os.FileInfo describing the file.
Stat() (os.FileInfo, error)
// Sync commits the current contents of the file.
Sync() error
// Truncate changes the size of the file.
Truncate(size int64) error
// Check check file format
Check() error
// First Record
First() (*Record, error)
// Last Record
Last() (*Record, error)
// write size
WriteSize(size uint32)
// Header
Header() (*header, error)
// Items
Items() ([]*Item, error)
// Item
Item(idx uint64) (*Item, error)
// Remove
Remove(stx, end int64)
// Info
Info() *FileInfo
}
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
func (*Log) TruncateFront ¶
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record format: rsize(4B)+index(8B)+data(NB)+rsize(4B)
Click to show internal directories.
Click to hide internal directories.