Documentation ¶
Index ¶
Constants ¶
View Source
const DataFilePerm = 0644
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileIOType ¶
type FileIOType byte
const ( FIOStandar FileIOType = iota // 标准文件 IO FIOMemoryMap // 内存映射文件 IO )
type FileIo ¶
type FileIo struct {
// contains filtered or unexported fields
}
FileIo 标准系统文件 IO
func NewFileManager ¶
NewFileManager 初始化标准文件 IO
type IOManager ¶
type IOManager interface { // Read 从文件的给定位置读取数据 Read([]byte, int64) (int, error) // Write 写入字节数组到文件中 Write([]byte) (int, error) // Sync 持久化数据 Sync() error // Close 关闭文件 Close() error // Size 返回文件大小 Size() (int64, error) }
IOManager 抽象文件 IO 接口, 可以接入不同的文件 IO 类型,目前支持标准文件 IO
func NewIOManager ¶
func NewIOManager(filePath string, ioType FileIOType) (IOManager, error)
NewIOManager 初始化 IOManager, 当前仅支持标准文件 IO
type MMap ¶
type MMap struct {
// contains filtered or unexported fields
}
MMap IO, 内存映射文件 IO
func NewMMapIOManager ¶
NewMMapIOManager 初始化内存映射文件 IO
Click to show internal directories.
Click to hide internal directories.