fake

package
v0.3.0-20261016184532-... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package fake provides an in-memory queuepause.Store for tests and examples. Seed or change a queue's state with Set; a queue never set is not paused. FailWith injects a read error on every Get to exercise the error path without a real backend. Safe for concurrent use, so a test can change state while a consumer is reading. It is intended for tests and examples only, never production.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is a programmable in-memory queuepause.Store.

func New

func New() *Store

New returns a Store under which no queue is paused.

func (*Store) FailWith

func (s *Store) FailWith(err error) *Store

FailWith makes every Get return err. Passing nil restores normal reads.

func (*Store) Get

func (s *Store) Get(_ context.Context, queue string) (entity.QueuePause, error)

Get returns the state last set for the queue, or the zero state if none was.

func (*Store) Set

func (s *Store) Set(queue string, state entity.QueuePause) *Store

Set replaces the pause state of a queue. Setting the zero state unpauses it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL