event

package
v0.0.0-...-b0e8a66 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetRegistered

type AssetRegistered struct {
	TickerSymbol string  `json:"ticker_symbol"`
	SpreadPrice  float64 `json:"spread_price"`
}

func (AssetRegistered) AggregateID

func (a AssetRegistered) AggregateID() string

func (AssetRegistered) Name

func (AssetRegistered) Name() string

type Bus

type Bus interface {
	Publish(context.Context, ...DomainEvent) error
}

type DomainEvent

type DomainEvent interface {
	AggregateID() string
	Name() string
}

type IntegrationEvent

type IntegrationEvent struct {
	Id          string `json:"id"`
	Source      string `json:"source"`
	SpecVersion string `json:"specversion"`
	Type        string `json:"type"`

	// Optional region
	DataContentType string      `json:"datacontenttype,omitempty"`
	DataSchema      string      `json:"dataschema,omitempty"`
	Subject         string      `json:"subject,omitempty"`
	Time            time.Time   `json:"time,omitempty"`
	Data            interface{} `json:"data,omitempty"`
}

IntegrationEvent is a kind of event based on the CNCF CloudEvent specification used to propagate domain events to different modules and systems

func (*IntegrationEvent) FromDomainEvent

func (i *IntegrationEvent) FromDomainEvent(e DomainEvent)

Jump to

Keyboard shortcuts

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