domain

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const PublishedEventsMetricPointName = "published_events"
View Source
const ReceivedEventsMetricPointName = "received_events"

Variables

View Source
var (
	LogEventsScope = namespace.Namespace{Identifier: ReceivedEventsMetricPointName}

	LogEventsSubscriptionsScope = namespace.Namespace{Identifier: "subscriptions"}
	LogEventsReceivedScope      = namespace.Namespace{Identifier: "received"}
)
View Source
var (
	LogEventsSubscriptionChannelField = namespace.Namespace{Parent: &LogEventsSubscriptionsScope, Identifier: "channel"}
	LogEventsSubscriptionCountField   = namespace.Namespace{Parent: &LogEventsSubscriptionsScope, Identifier: "count"}
	LogEventsSubscriptionKindField    = namespace.Namespace{Parent: &LogEventsSubscriptionsScope, Identifier: "kind"}

	LogEventsReceivedChannelField       = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "channel"}
	LogEventsReceivedEventTypeField     = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "event_type"}
	LogEventsReceivedMessageIdField     = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "message_id"}
	LogEventsReceivedCorrelationIdField = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "correlation_id"}
	LogEventsReceivedPayloadField       = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "payload"}
	LogEventsReceivedStatusField        = namespace.Namespace{Parent: &LogEventsReceivedScope, Identifier: "status"}
)
View Source
var ErrEventHeaderShouldBeAString = errors.New("the event header should be a string but got an unsupported type")
View Source
var ErrFailedToValidateEventHeader = errors.New("failed to validate event header")
View Source
var ErrUnableToReadFromGroup = errors.New("unable to read from group")
View Source
var ErrUnableToUnmarshalEventHeader = errors.New("unable to unmarshal the header in a json document")

Functions

This section is empty.

Types

type EventHandler

type EventHandler interface {
	Register(event string, handler EventHandlerFunc)

	MsgReceived(ctx context.Context, event contract.Message, ack func())
}

type EventHandlerFunc

type EventHandlerFunc func(ctx context.Context, eventJson string) error

type EventUnmarshallingError added in v0.1.7

type EventUnmarshallingError[T any] struct {
	Event T
}

func (EventUnmarshallingError[T]) Error added in v0.1.7

func (e EventUnmarshallingError[T]) Error() string

type FailedToCreateStreamError added in v0.1.7

type FailedToCreateStreamError struct {
	Stream string
}

func (FailedToCreateStreamError) Error added in v0.1.7

type PublishableMessage

type PublishableMessage interface {
	Channel() string
	EventType() string
}

Jump to

Keyboard shortcuts

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