Versions in this module Expand all Collapse all v0 v0.0.1 Nov 28, 2025 Changes in this version + const DataFileName + const DefaultDataPageSize + const DefaultIndexItemsPerPage + const Default_Page_Size + const FanoutFrontFileName + const FrontFileName + const IndexFileName + const MaxInt64 + const MetaFileName + var DefaultOptions = &Options + var ErrEnqueueDataNull = errors.New("enqueue data can not be null") + var ErrIndexOutOfBoundTH = errors.New("index is valid which should between tail and head index") + var ErrSubscribeExistErr = errors.New("Subscriber alread set, can not repeat set") + var ErrSubscribeFailedNoOpenErr = errors.New("Subscriber method only support after queue opened") + func Assert(condition bool, message string, v ...interface{}) + func BytesToInt(b []byte) int64 + func BytesToInt32(b []byte) int32 + func GetFileName(prefix string, suffix string, index int64) string + func GetFiles(pathname string) (*list.List, error) + func IntToBytes(n int64) []byte + func Mod(val int64, bits int) int64 + func PathExists(path string) (bool, error) + func Printstack() + func RemoveFiles(pathname string) error + func Warn(v ...interface{}) + func Warnf(msg string, v ...interface{}) + type DB struct + InitialMmapSize int + MmapFlags int + func (db *DB) Close() error + func (db *DB) GoString() string + func (db *DB) Open(mode os.FileMode) error + func (db *DB) Path() string + type DBFactory struct + InitialMmapSize int + func (f *DBFactory) Close() error + type FanOutQueue interface + Close func() error + Dequeue func(fanoutID int64) (int64, []byte, error) + Enqueue func(data []byte) (int64, error) + EnqueueAsync func(data []byte, fn func(int64, error)) + FreeAllSubscribe func() + FreeSubscribe func(fanoutID int64) + IsEmpty func(fanoutID int64) bool + Open func(dir string, queueName string, options *Options) error + Peek func(fanoutID int64) (int64, []byte, error) + Size func(fanoutID int64) int64 + Skip func(fanoutID int64, count int64) error + Subscribe func(fanoutID int64, fn func(int64, []byte, error)) error + type FileFanoutQueue struct + func (q *FileFanoutQueue) Close() + func (q *FileFanoutQueue) Dequeue(fanoutID int64) (int64, []byte, error) + func (q *FileFanoutQueue) Enqueue(data []byte) (int64, error) + func (q *FileFanoutQueue) FreeAllSubscribe() + func (q *FileFanoutQueue) FreeSubscribe(fanoutID int64) + func (q *FileFanoutQueue) IsEmpty(fanoutID int64) bool + func (q *FileFanoutQueue) Open(dir string, queueName string, options *Options) error + func (q *FileFanoutQueue) Peek(fanoutID int64) (int64, []byte, error) + func (q *FileFanoutQueue) PeekAll(fanoutID int64) ([][]byte, []int64, error) + func (q *FileFanoutQueue) PeekPagination(fanoutID int64, page, pagesize uint64) ([][]byte, []int64, error) + func (q *FileFanoutQueue) Size(fanoutID int64) int64 + func (q *FileFanoutQueue) Skip(fanoutID int64, count int64) error + func (q *FileFanoutQueue) Status(fanoutID int64) *QueueFilesStatus + func (q *FileFanoutQueue) Subscribe(fanoutID int64, fn func(int64, []byte, error)) error + type FileQueue struct + func (q *FileQueue) Close() error + func (q *FileQueue) Dequeue() (int64, []byte, error) + func (q *FileQueue) Enqueue(data []byte) (int64, error) + func (q *FileQueue) EnqueueAsync(data []byte, fn func(int64, error)) + func (q *FileQueue) FreeSubscribe() + func (q *FileQueue) Gc() error + func (q *FileQueue) IsEmpty() bool + func (q *FileQueue) Open(dir string, queueName string, options *Options) error + func (q *FileQueue) Peek() (int64, []byte, error) + func (q *FileQueue) PeekAll() ([][]byte, []int64, error) + func (q *FileQueue) PeekPagination(page, pagesize uint64) ([][]byte, []int64, error) + func (q *FileQueue) Size() int64 + func (q *FileQueue) SizeInBytes() int64 + func (q *FileQueue) Skip(count int64) error + func (q *FileQueue) Status() *QueueFilesStatus + func (q *FileQueue) Subscribe(fn func(int64, []byte, error)) error + type IOQueue interface + Open func(dir string, queueName string, options *Options) error + func NewAndOpenFileQueue(dir string, queueName string, options *Options) (IOQueue, error) + type Options struct + AutoGCBySeconds int + DataPageSize int + IndexItemsPerPage int + type Queue interface + Close func() error + Dequeue func() (int64, []byte, error) + Enqueue func(data []byte) (int64, error) + EnqueueAsync func(data []byte, fn func(int64, error)) + FreeSubscribe func() + Gc func() error + IsEmpty func() bool + Peek func() (int64, []byte, error) + Size func() int64 + Skip func(count int64) error + Subscribe func(fn func(int64, []byte, error)) error + type QueueFileInfo struct + CanGC bool + FileIndex int64 + Name string + Path string + Size int64 + type QueueFilesStatus struct + DataFileList []*QueueFileInfo + FrontFileInfo *QueueFileInfo + FrontIndex int64 + HeadDataItemOffset int64 + HeadDataPageIndex int64 + HeadIndex int64 + IndexFileList []*QueueFileInfo + MetaFileInfo *QueueFileInfo + TailIndex int64 + type QueueFront struct + type RemoteQueue interface + Open func(serverUrl string, queueName string)