marshaler

package
v1.0.0-beta.172 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CloudEventsHeaderType    = "ce_type"
	CloudEventsHeaderTime    = "ce_time"
	CloudEventsHeaderSource  = "ce_source"
	CloudEventsHeaderSubject = "ce_subject"
)
View Source
const (
	UnknownEventName = "io.openmeter.unknown"
)

Variables

This section is empty.

Functions

func NewCloudEvent

func NewCloudEvent(ev Event) (cloudevents.Event, error)

Types

type Event

type Event interface {
	EventName() string
	EventMetadata() metadata.EventMetadata
	Validate() error
}

func WithSource

func WithSource(source string, ev Event) Event

WithSource can be used to add the CloudEvents source field to an event.

type Marshaler

type Marshaler = cqrs.CommandEventMarshaler

func New

func New(transform TransformFunc) Marshaler

type TransformFunc

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

Jump to

Keyboard shortcuts

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