Documentation
¶
Index ¶
Constants ¶
View Source
const ( // HeadLen head 长度 文件前 xB 的数据为header 的存储空间 HeadLen int64 = 64 // VersionOffset 版本号在文件中下标 VersionOffset = 0 // BlockLenOffset 数据库在文件中下标 BlockLenOffset = 8 // OffsetConfigOffset 偏移量在文件中的下标 OffsetConfigOffset = 16 BlockValidOffset = 0 BlockValidLen = 1 BlockDataLenOffset = BlockValidOffset + BlockValidLen BlockDataLenLen = 8 BlockDataEndOffset = BlockDataLenOffset + BlockDataLenLen )
下面部分常量不会记录在文件中
View Source
const ( LibVersion = 1 // DefaultOffset 默认偏移量 DefaultOffset = 0 // DefaultBlockLen 默认数据块长度 DefaultBlockLen = 128 )
下面常量部分配置为默认值。并且有可能会写入文件中
Variables ¶
This section is empty.
Functions ¶
func Int64ToBytes ¶
Types ¶
type FileQueue ¶
type FileQueue struct {
// contains filtered or unexported fields
}
func NewDefaultFileQueue ¶
NewDefaultFileQueue 标准队列实体,返回一个可以使用的队列管理器
func NewFileQueue ¶
NewFileQueue dirPath 是队列目录,blockLen 是队列的块长度,不要小于等于9。前9位用于块数据是否消费/块有效长度等数据。
func (*FileQueue) Int64ToBytes ¶
Click to show internal directories.
Click to hide internal directories.