lib

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloudEvent

func NewCloudEvent(opts ...CloudEventOption) cloudevents.Event

Types

type CloudEventOption

type CloudEventOption func(*cloudevents.Event)

func CloudEventWithExtensionOption

func CloudEventWithExtensionOption(key, value string) CloudEventOption

func CloudEventWithIDOption

func CloudEventWithIDOption(id string) CloudEventOption

func CloudEventWithSourceOption

func CloudEventWithSourceOption(s string) CloudEventOption

func CloudEventWithTypeOption

func CloudEventWithTypeOption(t string) CloudEventOption

type Consumer

type Consumer interface {
	Start(ctx context.Context) error
	GetStoredEvents() []StoredEvent
	GetConsumerEndPoint() string
	WaitForEvent(timeout time.Duration, filters ...EventFilterOption) bool
}

func NewSimpleConsumer

func NewSimpleConsumer(port int) Consumer

type EventFilterOption

type EventFilterOption func(event *cloudevents.Event) bool

func EventiFilterWithID

func EventiFilterWithID(id string) EventFilterOption

type Producer

type Producer interface {
	Produce(ctx context.Context, event cloudevents.Event) error
	GetStoredEvents() []StoredEvent
}

func NewSimpleProducer

func NewSimpleProducer(endpoint string) Producer

type SimpleConsumer

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

func (*SimpleConsumer) GetConsumerEndPoint

func (s *SimpleConsumer) GetConsumerEndPoint() string

func (*SimpleConsumer) GetStoredEvents

func (s *SimpleConsumer) GetStoredEvents() []StoredEvent

func (*SimpleConsumer) Start

func (s *SimpleConsumer) Start(ctx context.Context) error

func (*SimpleConsumer) WaitForEvent

func (s *SimpleConsumer) WaitForEvent(timeout time.Duration, filters ...EventFilterOption) bool

type SimpleProducer

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

func (*SimpleProducer) GetStoredEvents

func (p *SimpleProducer) GetStoredEvents() []StoredEvent

func (*SimpleProducer) Produce

func (p *SimpleProducer) Produce(ctx context.Context, event cloudevents.Event) error

type Store

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

func (*Store) Add

func (s *Store) Add(event cloudevents.Event, opts ...StoredEventOption)

func (*Store) GetAll

func (s *Store) GetAll() []StoredEvent

type StoredEvent

type StoredEvent struct {
	Time   time.Time
	Event  cloudevents.Event
	Result cloudevents.Result
	Reply  cloudevents.Event
}

type StoredEventOption

type StoredEventOption func(*StoredEvent)

func StoredEventWithResult

func StoredEventWithResult(r cloudevents.Result) StoredEventOption

Jump to

Keyboard shortcuts

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