rangedbtest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-20 15:37:20.832346 -0800 PST m=+0.001145698

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNoMoreResultsInIterator added in v0.6.0

func AssertNoMoreResultsInIterator(t *testing.T, iter rangedb.RecordIterator)

AssertNoMoreResultsInIterator asserts no more rangedb.Record exist in the rangedb.RecordIterator.

func AssertRecordsInIterator added in v0.6.0

func AssertRecordsInIterator(t *testing.T, recordIterator rangedb.RecordIterator, expectedRecords ...*rangedb.Record)

AssertRecordsInIterator asserts all expected rangedb.Record exist in the rangedb.RecordIterator.

func BindEvents added in v0.2.1

func BindEvents(binder rangedb.EventBinder)

func BlockingSaveEvents added in v0.7.0

func BlockingSaveEvents(t *testing.T, store rangedb.Store, records ...*rangedb.EventRecord)

BlockingSaveEvents helper to save events, ensuring the broadcaster has processed every record.

func DummyRecord added in v0.6.0

func DummyRecord() *rangedb.Record

DummyRecord returns a dummy rangedb.Record

func DummyRecordFromEvent added in v0.6.0

func DummyRecordFromEvent(event rangedb.Event) *rangedb.Record

DummyRecordFromEvent returns a dummy rangedb.Record

func LoadIterator added in v0.6.0

func LoadIterator(records ...*rangedb.Record) rangedb.RecordIterator

LoadIterator returns a rangedb.RecordIterator filled with the supplied records.

func NewBlockingSubscriber added in v0.7.0

func NewBlockingSubscriber(parent rangedb.RecordSubscriber) *blockingSubscriber

NewBlockingSubscriber constructs a RecordSubscriber that blocks on Accept into Records.

func NewCountSubscriber

func NewCountSubscriber() *countSubscriber

NewCountSubscriber constructs a projection for counting events in a test context.

func NewEventThatWillFailUnmarshal added in v0.5.0

func NewEventThatWillFailUnmarshal(aggregateType, aggregateID string) rangedb.Event

NewEventThatWillFailUnmarshal returns an event that will fail a json unmarshal.

func NewFailingDeserializer added in v0.2.0

func NewFailingDeserializer() *failingDeserializer

NewFailingDeserializer constructs a failing rangedb.RecordSerializer.

func NewFailingEventStore added in v0.2.5

func NewFailingEventStore() *failingEventStore

NewFailingEventStore constructs a failing event store for testing.

func NewFailingSerializer added in v0.2.0

func NewFailingSerializer() *failingSerializer

NewFailingSerializer constructs a failing rangedb.RecordSerializer.

func NewFailingSubscribeEventStore added in v0.6.0

func NewFailingSubscribeEventStore() *failingSubscribeEventStore

NewFailingSubscribeEventStore constructs a failing event store for testing.

func NewSeededUUIDGenerator added in v0.12.0

func NewSeededUUIDGenerator() *seededUUIDGenerator

func NewTotalEventsSubscriber added in v0.3.0

func NewTotalEventsSubscriber() *totalEventsSubscriber

NewTotalEventsSubscriber constructs a projection to count total events received.

func ReadRecord added in v0.7.0

func ReadRecord(t *testing.T, recordChan chan *rangedb.Record) *rangedb.Record

ReadRecord helper to read a record or timeout.

func RecordIoStreamBenchmark added in v0.6.0

func RecordIoStreamBenchmark(b *testing.B, newIoStream func() rangedb.RecordIoStream)

RecordIoStreamBenchmark benchmarks the rangedb.RecordIoStream interface.

func RecordSerializerBenchmark added in v0.6.0

func RecordSerializerBenchmark(b *testing.B, newSerializer func() rangedb.RecordSerializer)

RecordSerializerBenchmark benchmarks the rangedb.RecordSerializer interface.

func SaveEvents added in v0.6.0

func SaveEvents(t *testing.T, store rangedb.Store, records ...*rangedb.EventRecord)

SaveEvents helper to save events with a timeout.

func SetRand added in v0.12.0

func SetRand(seed int64)

func StoreBenchmark added in v0.6.0

func StoreBenchmark(b *testing.B, newStore func(b *testing.B) rangedb.Store)

StoreBenchmark benchmarks the rangedb.Store interface.

func TimeoutContext added in v0.5.0

func TimeoutContext(c cleaner) context.Context

TimeoutContext returns a context that will timeout.

func VerifyRecordIoStream

func VerifyRecordIoStream(t *testing.T, newIoStream func() rangedb.RecordIoStream)

VerifyRecordIoStream verifies the RecordIoStream interface.

func VerifyRecordSerializer

func VerifyRecordSerializer(t *testing.T, newSerializer func() rangedb.RecordSerializer)

VerifyRecordSerializer verifies the RecordSerializer interface.

func VerifyStore

func VerifyStore(t *testing.T, newStore func(*testing.T, clock.Clock, shortuuid.Generator) rangedb.Store)

VerifyStore verifies the rangedb.Store interface.

Types

type AnotherWasComplete

type AnotherWasComplete struct {
	ID string `json:"id"`
}

AnotherWasComplete is an event used for testing.

func (AnotherWasComplete) AggregateID

func (t AnotherWasComplete) AggregateID() string

AggregateID returns the aggregate id.

func (AnotherWasComplete) AggregateType

func (t AnotherWasComplete) AggregateType() string

AggregateType returns the aggregate type.

func (AnotherWasComplete) EventType

func (t AnotherWasComplete) EventType() string

EventType returns the event type. This will always be the struct name.

type EventSaver added in v0.2.6

type EventSaver func(ctx context.Context, eventRecord ...*rangedb.EventRecord) (uint64, error)

EventSaver a function that accepts eventRecords for saving.

type FloatWasDone added in v0.4.0

type FloatWasDone struct {
	ID     string  `json:"id"`
	Number float64 `json:"number"`
}

FloatWasDone is an event used for testing.

func (FloatWasDone) AggregateID added in v0.4.0

func (t FloatWasDone) AggregateID() string

AggregateID returns the aggregate id.

func (FloatWasDone) AggregateType added in v0.4.0

func (t FloatWasDone) AggregateType() string

AggregateType returns the aggregate type.

func (FloatWasDone) EventType added in v0.4.0

func (t FloatWasDone) EventType() string

EventType returns the event type. This will always be the struct name.

type StringWasDone added in v0.7.0

type StringWasDone struct {
	ID     string `json:"id"`
	Action string `json:"action"`
}

StringWasDone is an event used for testing.

func (StringWasDone) AggregateID added in v0.7.0

func (t StringWasDone) AggregateID() string

AggregateID returns the aggregate id.

func (StringWasDone) AggregateType added in v0.7.0

func (t StringWasDone) AggregateType() string

AggregateType returns the aggregate type.

func (StringWasDone) EventType added in v0.7.0

func (t StringWasDone) EventType() string

EventType returns the event type. This will always be the struct name.

type ThatWasDone

type ThatWasDone struct {
	ID string
}

ThatWasDone is an event used for testing.

func (ThatWasDone) AggregateID

func (t ThatWasDone) AggregateID() string

AggregateID returns the aggregate id.

func (ThatWasDone) AggregateType

func (t ThatWasDone) AggregateType() string

AggregateType returns the aggregate type.

func (ThatWasDone) EventType

func (t ThatWasDone) EventType() string

EventType returns the event type. This will always be the struct name.

type ThingWasDone

type ThingWasDone struct {
	ID     string `json:"id"`
	Number int    `json:"number"`
}

ThingWasDone is an event used for testing.

func (ThingWasDone) AggregateID

func (t ThingWasDone) AggregateID() string

AggregateID returns the aggregate id.

func (ThingWasDone) AggregateType

func (t ThingWasDone) AggregateType() string

AggregateType returns the aggregate type.

func (ThingWasDone) EventType

func (t ThingWasDone) EventType() string

EventType returns the event type. This will always be the struct name.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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