queuetesting

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunBenchmarkPush

func RunBenchmarkPush(b *testing.B, queue blobqueue.Queue)

func RunTests

func RunTests(t *testing.T, queue blobqueue.Queue, shouldAlwaysFail bool)

RunTests runs a list of predefined actions on a implementation of blobqueue.Queue. If you're dependant of an external data storage (redis, db, etc..) and you want to test client specific error (e.g. a wrong redis connection) you can set shouldAlwaysFail to true.

Types

type Failing added in v0.2.0

type Failing struct {
	blobqueue.Queue
	NextError error
}

Failing wraps a queue to mock errors returned by a blobqueue.Queue.

func (Failing) Empty added in v0.2.0

func (q Failing) Empty() error

Empty implements Queue interface.

func (Failing) Len added in v0.2.0

func (q Failing) Len() (int, error)

Len implements Queue interface.

func (Failing) List added in v0.2.0

func (q Failing) List() ([][]byte, error)

List implements Queue interface.

func (Failing) Pop added in v0.2.0

func (q Failing) Pop() ([]byte, error)

Pop implements Queue interface.

func (Failing) Push added in v0.2.0

func (q Failing) Push(val []byte) error

Push implements Queue interface.

func (Failing) Shift added in v0.2.0

func (q Failing) Shift() ([]byte, error)

Shift implements Queue interface.

func (Failing) Unshift added in v0.2.0

func (q Failing) Unshift(val []byte) error

Unshift implements Queue interface.

Jump to

Keyboard shortcuts

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