Documentation ¶
Index ¶
- Variables
- func StreamItems[I any](store Store[I], target Target, doneCh <-chan struct{}, logger logger)
- type Batch
- type Key
- type QueueStore
- func (store *QueueStore[_]) Del(key string) error
- func (store *QueueStore[_]) DelList(keys []string) error
- func (store *QueueStore[_]) Extension() string
- func (store *QueueStore[I]) Get(key string) (item I, err error)
- func (store *QueueStore[_]) Len() int
- func (store *QueueStore[_]) List() ([]string, error)
- func (store *QueueStore[_]) Open() error
- func (store *QueueStore[I]) Put(item I) error
- type Store
- type Target
Constants ¶
This section is empty.
Variables ¶
var ErrBatchFull = errors.New("batch is full")
ErrBatchFull indicates that the batch is full
var ErrNotConnected = errors.New("not connected to target server/service")
ErrNotConnected - indicates that the target connection is not active.
Functions ¶
func StreamItems ¶
StreamItems reads the keys from the store and replays the corresponding item to the target.
Types ¶
type Batch ¶
Batch represents an ordered batch
func (*Batch[K, T]) GetAll ¶
GetAll fetches the items and resets the batch Returned items are not referenced by the batch
type QueueStore ¶
QueueStore - Filestore for persisting items.
func NewQueueStore ¶
func NewQueueStore[I any](directory string, limit uint64, ext string) *QueueStore[I]
NewQueueStore - Creates an instance for QueueStore.
func (*QueueStore[_]) Del ¶
func (store *QueueStore[_]) Del(key string) error
Del - Deletes an entry from the store.
func (*QueueStore[_]) DelList ¶
func (store *QueueStore[_]) DelList(keys []string) error
DelList - Deletes a list of entries from the store. Returns an error even if one key fails to be deleted.
func (*QueueStore[_]) Extension ¶
func (store *QueueStore[_]) Extension() string
Extension will return the file extension used for the items stored in the queue.
func (*QueueStore[I]) Get ¶
func (store *QueueStore[I]) Get(key string) (item I, err error)
Get - gets an item from the store.
func (*QueueStore[_]) List ¶
func (store *QueueStore[_]) List() ([]string, error)
List - lists all files registered in the store.
func (*QueueStore[_]) Open ¶
func (store *QueueStore[_]) Open() error
Open - Creates the directory if not present.
func (*QueueStore[I]) Put ¶
func (store *QueueStore[I]) Put(item I) error
Put - puts an item to the store.