fake

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSender

type EventSender struct {
	SentEvents []cloudevents.Event
	Reactors   map[string]func(event cloudevents.Event) error
}

EventSender fakes the sending of CloudEvents

func (*EventSender) AddReactor

func (es *EventSender) AddReactor(eventTypeSelector string, reactor func(event cloudevents.Event) error)

AddReactor adds custom logic that should be applied when SendEvent is called for the given event type

func (*EventSender) AssertSentEventTypes

func (es *EventSender) AssertSentEventTypes(eventTypes []string) error

AssertSentEventTypes checks if the given event types have been passed to the SendEvent function

func (*EventSender) Send added in v0.9.0

func (es *EventSender) Send(ctx context.Context, event cloudevents.Event) error

func (*EventSender) SendEvent

func (es *EventSender) SendEvent(event cloudevents.Event) error

SendEvent fakes the sending of CloudEvents

Jump to

Keyboard shortcuts

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