Versions in this module Expand all Collapse all v1 v1.0.2 Jul 22, 2016 Changes in this version + const ASC + const DESC + var ErrDBClosed = errors.New("goque: Database is closed") + var ErrEmpty = errors.New("goque: Stack or queue is empty") + var ErrIncompatibleType = errors.New("goque: Opener type is incompatible with stored Goque type") + var ErrOutOfBounds = errors.New("goque: ID used is outside range of stack or queue") + type Item struct + ID uint64 + Key []byte + Value []byte + func NewItem(value []byte) *Item + func NewItemObject(value interface{}) (*Item, error) + func NewItemString(value string) *Item + func (i *Item) ToObject(value interface{}) error + func (i *Item) ToString() string + type PriorityItem struct + ID uint64 + Key []byte + Priority uint8 + Value []byte + func NewPriorityItem(value []byte, priority uint8) *PriorityItem + func NewPriorityItemObject(value interface{}, priority uint8) (*PriorityItem, error) + func NewPriorityItemString(value string, priority uint8) *PriorityItem + func (pi *PriorityItem) ToObject(value interface{}) error + func (pi *PriorityItem) ToString() string + type PriorityQueue struct + DataDir string + func OpenPriorityQueue(dataDir string, order order) (*PriorityQueue, error) + func (pq *PriorityQueue) Close() + func (pq *PriorityQueue) Dequeue() (*PriorityItem, error) + func (pq *PriorityQueue) DequeueByPriority(priority uint8) (*PriorityItem, error) + func (pq *PriorityQueue) Drop() + func (pq *PriorityQueue) Enqueue(item *PriorityItem) error + func (pq *PriorityQueue) Length() uint64 + func (pq *PriorityQueue) Peek() (*PriorityItem, error) + func (pq *PriorityQueue) PeekByOffset(offset uint64) (*PriorityItem, error) + func (pq *PriorityQueue) PeekByPriorityID(priority uint8, id uint64) (*PriorityItem, error) + func (pq *PriorityQueue) Update(item *PriorityItem, newValue []byte) error + func (pq *PriorityQueue) UpdateObject(item *PriorityItem, newValue interface{}) error + func (pq *PriorityQueue) UpdateString(item *PriorityItem, newValue string) error + type Queue struct + DataDir string + func OpenQueue(dataDir string) (*Queue, error) + func (q *Queue) Close() + func (q *Queue) Dequeue() (*Item, error) + func (q *Queue) Drop() + func (q *Queue) Enqueue(item *Item) error + func (q *Queue) Length() uint64 + func (q *Queue) Peek() (*Item, error) + func (q *Queue) PeekByID(id uint64) (*Item, error) + func (q *Queue) PeekByOffset(offset uint64) (*Item, error) + func (q *Queue) Update(item *Item, newValue []byte) error + func (q *Queue) UpdateObject(item *Item, newValue interface{}) error + func (q *Queue) UpdateString(item *Item, newValue string) error + type Stack struct + DataDir string + func OpenStack(dataDir string) (*Stack, error) + func (s *Stack) Close() + func (s *Stack) Drop() + func (s *Stack) Length() uint64 + func (s *Stack) Peek() (*Item, error) + func (s *Stack) PeekByID(id uint64) (*Item, error) + func (s *Stack) PeekByOffset(offset uint64) (*Item, error) + func (s *Stack) Pop() (*Item, error) + func (s *Stack) Push(item *Item) error + func (s *Stack) Update(item *Item, newValue []byte) error + func (s *Stack) UpdateObject(item *Item, newValue interface{}) error + func (s *Stack) UpdateString(item *Item, newValue string) error