Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Ack(segID uint32, offset uint32) (err error)
- func (db *DB) Clean() (err error)
- func (db *DB) Close() (err error)
- func (db *DB) GetPath() string
- func (db *DB) Pop() (data []byte, segID uint32, offset uint32, err error)
- func (db *DB) Push(data []byte) (segID uint32, offset uint32, err error)
- func (db *DB) SetReadPos(fileID uint32, offset uint32) error
- func (db *DB) Sync() error
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = Options{ WriteBufferSize: 128 << 10, ReadBufferSize: 128 << 10, MaxBytesPerSegment: 128 << 20, Fsync: false, }
DefaultOptions contains options that should work for most applications
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents thread-safe FIFO disk queue with WAL of queue operations.
type Options ¶
type Options struct { // Directory to store the data. Would be created if not exists. Path string // Size of bytes to keep in memory before persisting to avoid much write syscalls. WriteBufferSize uint32 // Size of bytes buffered from file to avoid much read syscalls. ReadBufferSize uint32 // Maximum size of each segment file. MaxBytesPerSegment uint32 // Fsync each write Fsync bool }
Options are params for creating DB object.
Click to show internal directories.
Click to hide internal directories.