testbacking

package
v0.0.0-...-004e4dd Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureModelUUID

func EnsureModelUUID(modelUUID, id string) string

EnsureModelUUID is exported as it is used in other _test files.

func SplitDocID

func SplitDocID(id string) (string, string, bool)

SplitDocID is exported as it is used in other _test files.

Types

type Backing

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

Backing is a test state AllWatcherBacking

func New

func New(initial []multiwatcher.EntityInfo) *Backing

New returns a new test backing.

func (*Backing) Changed

func (b *Backing) Changed(store multiwatcher.Store, change watcher.Change) error

Changed process the change event from the state base watcher.

func (*Backing) DeleteEntity

func (b *Backing) DeleteEntity(id multiwatcher.EntityID)

DeleteEntity allows the test to push a delete through the test.

func (*Backing) GetAll

func (b *Backing) GetAll(store multiwatcher.Store) error

GetAll does the initial population of the store.

func (*Backing) SetFetchError

func (b *Backing) SetFetchError(err error)

SetFetchError queues up an error to return on the next fetch.

func (*Backing) Unwatch

func (b *Backing) Unwatch(c chan<- watcher.Change)

Unwatch clears the channel for the events.

func (*Backing) UpdateEntity

func (b *Backing) UpdateEntity(info multiwatcher.EntityInfo)

UpdateEntity allows the test to push an update.

func (*Backing) Watch

func (b *Backing) Watch(c chan<- watcher.Change)

Watch sets up the channel for the events.

Jump to

Keyboard shortcuts

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