Versions in this module Expand all Collapse all v2 v2.1.2 Nov 19, 2021 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 (i *Item) ToObject(value interface{}) error + func (i *Item) ToObjectFromJSON(value interface{}) error + func (i *Item) ToString() string + type PrefixQueue struct + DataDir string + func OpenPrefixQueue(dataDir string) (*PrefixQueue, error) + func (pq *PrefixQueue) Close() error + func (pq *PrefixQueue) Dequeue(prefix []byte) (*Item, error) + func (pq *PrefixQueue) DequeueString(prefix string) (*Item, error) + func (pq *PrefixQueue) Drop() error + func (pq *PrefixQueue) Enqueue(prefix, value []byte) (*Item, error) + func (pq *PrefixQueue) EnqueueObject(prefix []byte, value interface{}) (*Item, error) + func (pq *PrefixQueue) EnqueueObjectAsJSON(prefix []byte, value interface{}) (*Item, error) + func (pq *PrefixQueue) EnqueueString(prefix, value string) (*Item, error) + func (pq *PrefixQueue) Length() uint64 + func (pq *PrefixQueue) Peek(prefix []byte) (*Item, error) + func (pq *PrefixQueue) PeekByID(prefix []byte, id uint64) (*Item, error) + func (pq *PrefixQueue) PeekByIDString(prefix string, id uint64) (*Item, error) + func (pq *PrefixQueue) PeekString(prefix string) (*Item, error) + func (pq *PrefixQueue) Update(prefix []byte, id uint64, newValue []byte) (*Item, error) + func (pq *PrefixQueue) UpdateObject(prefix []byte, id uint64, newValue interface{}) (*Item, error) + func (pq *PrefixQueue) UpdateObjectAsJSON(prefix []byte, id uint64, newValue interface{}) (*Item, error) + func (pq *PrefixQueue) UpdateString(prefix string, id uint64, value string) (*Item, error) + type PriorityItem struct + ID uint64 + Key []byte + Priority uint8 + Value []byte + func (pi *PriorityItem) ToObject(value interface{}) error + func (pi *PriorityItem) ToObjectFromJSON(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() error + func (pq *PriorityQueue) Dequeue() (*PriorityItem, error) + func (pq *PriorityQueue) DequeueByPriority(priority uint8) (*PriorityItem, error) + func (pq *PriorityQueue) Drop() error + func (pq *PriorityQueue) Enqueue(priority uint8, value []byte) (*PriorityItem, error) + func (pq *PriorityQueue) EnqueueObject(priority uint8, value interface{}) (*PriorityItem, error) + func (pq *PriorityQueue) EnqueueObjectAsJSON(priority uint8, value interface{}) (*PriorityItem, error) + func (pq *PriorityQueue) EnqueueString(priority uint8, value string) (*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(priority uint8, id uint64, newValue []byte) (*PriorityItem, error) + func (pq *PriorityQueue) UpdateObject(priority uint8, id uint64, newValue interface{}) (*PriorityItem, error) + func (pq *PriorityQueue) UpdateObjectAsJSON(priority uint8, id uint64, newValue interface{}) (*PriorityItem, error) + func (pq *PriorityQueue) UpdateString(priority uint8, id uint64, newValue string) (*PriorityItem, error) + type Queue struct + DataDir string + func OpenQueue(dataDir string) (*Queue, error) + func (q *Queue) Close() error + func (q *Queue) Dequeue() (*Item, error) + func (q *Queue) DequeueBlock() (*Item, error) + func (q *Queue) Drop() error + func (q *Queue) Enqueue(value []byte) (*Item, error) + func (q *Queue) EnqueueObject(value interface{}) (*Item, error) + func (q *Queue) EnqueueObjectAsJSON(value interface{}) (*Item, error) + func (q *Queue) EnqueueString(value string) (*Item, error) + func (q *Queue) Length() uint64 + func (q *Queue) Peek() (*Item, error) + func (q *Queue) PeekBlock() (*Item, error) + func (q *Queue) PeekByID(id uint64) (*Item, error) + func (q *Queue) PeekByOffset(offset uint64) (*Item, error) + func (q *Queue) Update(id uint64, newValue []byte) (*Item, error) + func (q *Queue) UpdateObject(id uint64, newValue interface{}) (*Item, error) + func (q *Queue) UpdateObjectAsJSON(id uint64, newValue interface{}) (*Item, error) + func (q *Queue) UpdateString(id uint64, newValue string) (*Item, error) + type Stack struct + DataDir string + func OpenStack(dataDir string) (*Stack, error) + func (s *Stack) Close() error + func (s *Stack) Drop() error + 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(value []byte) (*Item, error) + func (s *Stack) PushObject(value interface{}) (*Item, error) + func (s *Stack) PushObjectAsJSON(value interface{}) (*Item, error) + func (s *Stack) PushString(value string) (*Item, error) + func (s *Stack) Update(id uint64, newValue []byte) (*Item, error) + func (s *Stack) UpdateObject(id uint64, newValue interface{}) (*Item, error) + func (s *Stack) UpdateObjectAsJSON(id uint64, newValue interface{}) (*Item, error) + func (s *Stack) UpdateString(id uint64, newValue string) (*Item, error) Other modules containing this package github.com/ldmtam/goque