eventbridge

package
v0.0.0-...-3b037d6 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 7 Imported by: 0

README

Installation

go get -u  github.com/mmadfox/es/eventbridge/eventbridge

Documentation

Overview

Package eventbridge is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	WalkUnpublishedEvents(ctx context.Context, fn UnpublishedStreamFunc) error
	UpdateVersion(ctx context.Context, streamID string, streamType string, version int) (err error)
	OnEvent(eventFunc EventFunc)
	Connect(ctx context.Context, fn func() error) error
	Close() error
}

type Dup

type Dup interface {
	Exists(e *Event) bool
	Ensure(e *Event)
}

type ErrorFunc

type ErrorFunc func(context.Context, error)

type ErrorHandlerFunc

type ErrorHandlerFunc func(ctx context.Context, err error)

type Event

type Event struct {
	StreamID   string
	StreamType string
	EventType  string
	Version    int
	Serialized []byte
}

type EventFunc

type EventFunc func(context.Context, *Event) error

type Hook

type Hook func(context.Context) error

type Metrics

type Metrics interface {
	WalkUnpublishedEventsInc()
	PublishEventInc(streamType string, eventType string)
}

type MockDB

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

MockDB is a mock of DB interface

func NewMockDB

func NewMockDB(ctrl *gomock.Controller) *MockDB

NewMockDB creates a new mock instance

func (*MockDB) Close

func (m *MockDB) Close() error

Close mocks base method

func (*MockDB) Connect

func (m *MockDB) Connect(ctx context.Context, fn func() error) error

Connect mocks base method

func (*MockDB) EXPECT

func (m *MockDB) EXPECT() *MockDBMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockDB) OnEvent

func (m *MockDB) OnEvent(eventFunc EventFunc)

OnEvent mocks base method

func (*MockDB) UpdateVersion

func (m *MockDB) UpdateVersion(ctx context.Context, streamID, streamType string, version int) error

UpdateVersion mocks base method

func (*MockDB) WalkUnpublishedEvents

func (m *MockDB) WalkUnpublishedEvents(ctx context.Context, fn UnpublishedStreamFunc) error

WalkUnpublishedEvents mocks base method

type MockDBMockRecorder

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

MockDBMockRecorder is the mock recorder for MockDB

func (*MockDBMockRecorder) Close

func (mr *MockDBMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockDBMockRecorder) Connect

func (mr *MockDBMockRecorder) Connect(ctx, fn interface{}) *gomock.Call

Connect indicates an expected call of Connect

func (*MockDBMockRecorder) OnEvent

func (mr *MockDBMockRecorder) OnEvent(eventFunc interface{}) *gomock.Call

OnEvent indicates an expected call of OnEvent

func (*MockDBMockRecorder) UpdateVersion

func (mr *MockDBMockRecorder) UpdateVersion(ctx, streamID, streamType, version interface{}) *gomock.Call

UpdateVersion indicates an expected call of UpdateVersion

func (*MockDBMockRecorder) WalkUnpublishedEvents

func (mr *MockDBMockRecorder) WalkUnpublishedEvents(ctx, fn interface{}) *gomock.Call

WalkUnpublishedEvents indicates an expected call of WalkUnpublishedEvents

type Sync

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

func New

func New(
	db DB,
	pub esmessagingkafka.Client,
	dup Dup,
	sc Metrics,
	logger *zap.SugaredLogger,
	topicBuilder eseventbuskafka.TopicBuilder,
) *Sync

func (*Sync) Close

func (s *Sync) Close() (err error)

func (*Sync) Run

func (s *Sync) Run(ctx context.Context) error

type UnpublishedStream

type UnpublishedStream struct {
	StreamID               string
	StreamType             string
	LatestPublishedVersion int
	CurrentVersion         int
	Events                 []*Event
}

func (UnpublishedStream) TotalUnpublished

func (ua UnpublishedStream) TotalUnpublished() int

type UnpublishedStreamFunc

type UnpublishedStreamFunc func(ctx context.Context, stream *UnpublishedStream) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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