publisher

package
v1.0.0-beta.130 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudEventsHeaderType    = "ce_type"
	CloudEventsHeaderTime    = "ce_time"
	CloudEventsHeaderSource  = "ce_source"
	CloudEventsHeaderSubject = "ce_subject"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudEventMarshaler

type CloudEventMarshaler interface {
	MarshalEvent(event.Event) (*message.Message, error)
}

func NewCloudEventMarshaler

func NewCloudEventMarshaler(transform TransformFunc) CloudEventMarshaler

type Publisher

type Publisher interface {
	ForTopic(topic string) TopicPublisher
}

func NewPublisher

func NewPublisher(opts PublisherOptions) (Publisher, error)

type PublisherOptions

type PublisherOptions struct {
	// Publisher is the underlying watermill publisher object
	Publisher message.Publisher

	// Transform is a function that can be used to transform the message before it is published, mainly used
	// for driver specific tweaks. If more are required, we should add a chain function.
	Transform TransformFunc
}

type TopicPublisher

type TopicPublisher interface {
	Publish(event event.Event) error
}

func NewMockTopicPublisher

func NewMockTopicPublisher(t *testing.T) TopicPublisher

type TransformFunc

type TransformFunc func(watermillIn *message.Message, cloudEvent event.Event) (*message.Message, error)

Jump to

Keyboard shortcuts

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