testutil

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testutil is a generated protocol buffer package.

It is generated from these files:

pkg/fes/testutil/testutil.proto

It has these top-level messages:

DummyEvent

Index

Constants

View Source
const (
	MockEntityType = "mock_entity"
)

Variables

View Source
var Projector = &EntityProjector{}

Functions

func CreateDummyEvent

func CreateDummyEvent(key fes.Aggregate, payload *DummyEvent) *fes.Event

func ToDummyEvents

func ToDummyEvents(key fes.Aggregate, msg string) []*fes.Event

Types

type Backend

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

Backend is a stub implementation of a fes.Backend

func NewBackend

func NewBackend() *Backend

func (*Backend) Append

func (b *Backend) Append(event *fes.Event) error

func (*Backend) Get

func (b *Backend) Get(aggregate fes.Aggregate) ([]*fes.Event, error)

func (*Backend) List

func (b *Backend) List(matcher fes.AggregateMatcher) ([]fes.Aggregate, error)

func (*Backend) Reset

func (b *Backend) Reset()

type Cache

type Cache struct {
	Name string
	// contains filtered or unexported fields
}

Cache provides a thread-safe, memory-unrestricted map-based CacheReaderWriter implementation.

func NewCache

func NewCache() *Cache

func (*Cache) GetAggregate

func (rc *Cache) GetAggregate(aggregate fes.Aggregate) (fes.Entity, error)

func (*Cache) Invalidate

func (rc *Cache) Invalidate(ref fes.Aggregate)

func (*Cache) List

func (rc *Cache) List() []fes.Aggregate

func (*Cache) Put

func (rc *Cache) Put(entity fes.Entity) error

func (*Cache) Refresh

func (rc *Cache) Refresh(key fes.Aggregate)

type DummyEvent

type DummyEvent struct {
	Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"`
}

DummyEvent is a stub implementation of a fes.Event

func (*DummyEvent) Descriptor

func (*DummyEvent) Descriptor() ([]byte, []int)

func (*DummyEvent) GetMsg

func (m *DummyEvent) GetMsg() string

func (*DummyEvent) ProtoMessage

func (*DummyEvent) ProtoMessage()

func (*DummyEvent) Reset

func (m *DummyEvent) Reset()

func (*DummyEvent) String

func (m *DummyEvent) String() string

type EntityProjector

type EntityProjector struct {
}

func (*EntityProjector) NewProjection

func (e *EntityProjector) NewProjection(aggregate fes.Aggregate) (fes.Entity, error)

func (*EntityProjector) Project

func (e *EntityProjector) Project(entity fes.Entity, events ...*fes.Event) (updated fes.Entity, err error)

type MockEntity

type MockEntity struct {
	S  string
	Id string
}

MockEntity is a stub implementation of a fes.Entity, which simply appends all contents of the DummyEvents it receives.

func (*MockEntity) Clone

func (e *MockEntity) Clone() *MockEntity

func (*MockEntity) ID

func (e *MockEntity) ID() string

func (*MockEntity) Type

func (e *MockEntity) Type() string

Jump to

Keyboard shortcuts

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