Documentation ¶
Index ¶
- Constants
- Variables
- type AckType
- type AckWait
- type Command
- type CommandMessage
- type CommandMessageData
- func (*CommandMessageData) Descriptor() ([]byte, []int)deprecated
- func (x *CommandMessageData) GetMetadata() *structpb.Struct
- func (x *CommandMessageData) GetOccurredAt() *timestamppb.Timestamp
- func (x *CommandMessageData) GetPayload() []byte
- func (*CommandMessageData) ProtoMessage()
- func (x *CommandMessageData) ProtoReflect() protoreflect.Message
- func (x *CommandMessageData) Reset()
- func (x *CommandMessageData) String() string
- type CommandMessageHandler
- type CommandMessageHandlerFunc
- type CommandPublisher
- type CommandStream
- type CommandSubscriber
- type EventMessage
- type EventMessageData
- func (*EventMessageData) Descriptor() ([]byte, []int)deprecated
- func (x *EventMessageData) GetMetadata() *structpb.Struct
- func (x *EventMessageData) GetOccurredAt() *timestamppb.Timestamp
- func (x *EventMessageData) GetPayload() []byte
- func (*EventMessageData) ProtoMessage()
- func (x *EventMessageData) ProtoReflect() protoreflect.Message
- func (x *EventMessageData) Reset()
- func (x *EventMessageData) String() string
- type EventPublisher
- type EventStream
- type EventSubscriber
- type FakeMessagePublisher
- type GroupName
- type IncomingCommandMessage
- type IncomingEventMessage
- type IncomingMessage
- type IncomingRawMessage
- type IncomingReplyMessage
- type MaxRedeliver
- type Message
- type MessageFilter
- type MessageHandler
- type MessageHandlerFunc
- type MessagePublisher
- type MessageStream
- type MessageSubscriber
- type MockMessageHandler
- type MockMessagePublisher
- type MockMessageSubscriber
- type RawMessage
- type RawMessageHandler
- func NewCommandMessageHandler(reg registry.Registry, publisher ReplyPublisher, ...) RawMessageHandler
- func NewEventMessageHandler(reg registry.Registry, handler ddd.EventHandler[ddd.Event]) RawMessageHandler
- func NewReplyMessageHandler(reg registry.Registry, handler ddd.ReplyHandler[ddd.Reply]) RawMessageHandler
- func RawMessageHandlerWithMiddleware(handler RawMessageHandler, mws ...RawMessageHandlerMiddleware) RawMessageHandler
- type RawMessageHandlerFunc
- type RawMessageHandlerMiddleware
- type RawMessagePublisher
- type RawMessageStream
- type RawMessageStreamMiddleware
- type RawMessageSubscriber
- type ReplyMessage
- type ReplyMessageData
- func (*ReplyMessageData) Descriptor() ([]byte, []int)deprecated
- func (x *ReplyMessageData) GetMetadata() *structpb.Struct
- func (x *ReplyMessageData) GetOccurredAt() *timestamppb.Timestamp
- func (x *ReplyMessageData) GetPayload() []byte
- func (*ReplyMessageData) ProtoMessage()
- func (x *ReplyMessageData) ProtoReflect() protoreflect.Message
- func (x *ReplyMessageData) Reset()
- func (x *ReplyMessageData) String() string
- type ReplyPublisher
- type ReplyStream
- type ReplySubscriber
- type SubscriberConfig
- type SubscriberOption
- type Subscription
Constants ¶
const ( CommandHdrPrefix = "COMMAND_" CommandNameHdr = CommandHdrPrefix + "NAME" CommandReplyChannelHdr = CommandHdrPrefix + "REPLY_CHANNEL" )
const ( FailureReply = "am.Failure" SuccessReply = "am.Success" OutcomeSuccess = "SUCCESS" OutcomeFailure = "FAILURE" ReplyHdrPrefix = "REPLY_" ReplyNameHdr = ReplyHdrPrefix + "NAME" ReplyOutcomeHdr = ReplyHdrPrefix + "OUTCOME" )
Variables ¶
var File_message_types_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Command ¶
func NewCommand ¶
func NewCommand(name, destination string, payload ddd.CommandPayload, options ...ddd.CommandOption) Command
type CommandMessage ¶
type CommandMessageData ¶
type CommandMessageData struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` OccurredAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` Metadata *structpb.Struct `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*CommandMessageData) Descriptor
deprecated
func (*CommandMessageData) Descriptor() ([]byte, []int)
Deprecated: Use CommandMessageData.ProtoReflect.Descriptor instead.
func (*CommandMessageData) GetMetadata ¶
func (x *CommandMessageData) GetMetadata() *structpb.Struct
func (*CommandMessageData) GetOccurredAt ¶
func (x *CommandMessageData) GetOccurredAt() *timestamppb.Timestamp
func (*CommandMessageData) GetPayload ¶
func (x *CommandMessageData) GetPayload() []byte
func (*CommandMessageData) ProtoMessage ¶
func (*CommandMessageData) ProtoMessage()
func (*CommandMessageData) ProtoReflect ¶
func (x *CommandMessageData) ProtoReflect() protoreflect.Message
func (*CommandMessageData) Reset ¶
func (x *CommandMessageData) Reset()
func (*CommandMessageData) String ¶
func (x *CommandMessageData) String() string
type CommandMessageHandler ¶
type CommandMessageHandler = MessageHandler[IncomingCommandMessage]
type CommandMessageHandlerFunc ¶
type CommandMessageHandlerFunc func(ctx context.Context, msg IncomingCommandMessage) error
func (CommandMessageHandlerFunc) HandleMessage ¶
func (f CommandMessageHandlerFunc) HandleMessage(ctx context.Context, cmd IncomingCommandMessage) error
type CommandPublisher ¶
type CommandStream ¶
type CommandStream interface { MessagePublisher[ddd.Command] MessageSubscriber[IncomingCommandMessage] }
func NewCommandStream ¶
func NewCommandStream(reg registry.Registry, stream RawMessageStream) CommandStream
type CommandSubscriber ¶
type CommandSubscriber = MessageSubscriber[IncomingCommandMessage]
type EventMessage ¶
type EventMessageData ¶
type EventMessageData struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` OccurredAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` Metadata *structpb.Struct `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*EventMessageData) Descriptor
deprecated
func (*EventMessageData) Descriptor() ([]byte, []int)
Deprecated: Use EventMessageData.ProtoReflect.Descriptor instead.
func (*EventMessageData) GetMetadata ¶
func (x *EventMessageData) GetMetadata() *structpb.Struct
func (*EventMessageData) GetOccurredAt ¶
func (x *EventMessageData) GetOccurredAt() *timestamppb.Timestamp
func (*EventMessageData) GetPayload ¶
func (x *EventMessageData) GetPayload() []byte
func (*EventMessageData) ProtoMessage ¶
func (*EventMessageData) ProtoMessage()
func (*EventMessageData) ProtoReflect ¶
func (x *EventMessageData) ProtoReflect() protoreflect.Message
func (*EventMessageData) Reset ¶
func (x *EventMessageData) Reset()
func (*EventMessageData) String ¶
func (x *EventMessageData) String() string
type EventPublisher ¶
type EventStream ¶
type EventStream = MessageStream[ddd.Event, IncomingEventMessage]
func NewEventStream ¶
func NewEventStream(reg registry.Registry, stream RawMessageStream) EventStream
type EventSubscriber ¶
type EventSubscriber = MessageSubscriber[IncomingEventMessage]
type FakeMessagePublisher ¶
type FakeMessagePublisher[O any] struct { // contains filtered or unexported fields }
func NewFakeMessagePublisher ¶
func NewFakeMessagePublisher[O any]() *FakeMessagePublisher[O]
func (*FakeMessagePublisher[O]) Last ¶
func (p *FakeMessagePublisher[O]) Last() (string, O, error)
func (*FakeMessagePublisher[O]) Publish ¶
func (p *FakeMessagePublisher[O]) Publish(ctx context.Context, topicName string, v O) error
func (*FakeMessagePublisher[O]) Reset ¶
func (p *FakeMessagePublisher[O]) Reset()
type IncomingCommandMessage ¶
type IncomingCommandMessage interface { IncomingMessage ddd.Command }
type IncomingEventMessage ¶
type IncomingEventMessage interface { IncomingMessage ddd.Event }
type IncomingMessage ¶
type IncomingRawMessage ¶
type IncomingRawMessage interface { IncomingMessage Data() []byte }
type IncomingReplyMessage ¶
type IncomingReplyMessage interface { IncomingMessage ddd.Reply }
type MaxRedeliver ¶
type MaxRedeliver int
type MessageFilter ¶
type MessageFilter []string
type MessageHandler ¶
type MessageHandler[I IncomingMessage] interface { HandleMessage(ctx context.Context, msg I) error }
type MessageHandlerFunc ¶
type MessageHandlerFunc[I IncomingMessage] func(ctx context.Context, msg I) error
func (MessageHandlerFunc[I]) HandleMessage ¶
type MessagePublisher ¶
type MessageStream ¶
type MessageStream[O any, I IncomingMessage] interface { MessagePublisher[O] MessageSubscriber[I] }
type MessageSubscriber ¶
type MessageSubscriber[I IncomingMessage] interface { Subscribe(topicName string, handler MessageHandler[I], options ...SubscriberOption) (Subscription, error) Unsubscribe() error }
type MockMessageHandler ¶
type MockMessageHandler[I IncomingMessage] struct { mock.Mock }
MockMessageHandler is an autogenerated mock type for the MessageHandler type
func NewMockMessageHandler ¶
func NewMockMessageHandler[I IncomingMessage](t mockConstructorTestingTNewMockMessageHandler) *MockMessageHandler[I]
NewMockMessageHandler creates a new instance of MockMessageHandler. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockMessageHandler[I]) HandleMessage ¶
func (_m *MockMessageHandler[I]) HandleMessage(ctx context.Context, msg I) error
HandleMessage provides a mock function with given fields: ctx, msg
type MockMessagePublisher ¶
MockMessagePublisher is an autogenerated mock type for the MessagePublisher type
func NewMockMessagePublisher ¶
func NewMockMessagePublisher[O interface{}](t mockConstructorTestingTNewMockMessagePublisher) *MockMessagePublisher[O]
NewMockMessagePublisher creates a new instance of MockMessagePublisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
type MockMessageSubscriber ¶
type MockMessageSubscriber[I IncomingMessage] struct { mock.Mock }
MockMessageSubscriber is an autogenerated mock type for the MessageSubscriber type
func NewMockMessageSubscriber ¶
func NewMockMessageSubscriber[I IncomingMessage](t mockConstructorTestingTNewMockMessageSubscriber) *MockMessageSubscriber[I]
NewMockMessageSubscriber creates a new instance of MockMessageSubscriber. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func (*MockMessageSubscriber[I]) Subscribe ¶
func (_m *MockMessageSubscriber[I]) Subscribe(topicName string, handler MessageHandler[I], options ...SubscriberOption) error
Subscribe provides a mock function with given fields: topicName, handler, options
type RawMessage ¶
type RawMessageHandler ¶
type RawMessageHandler = MessageHandler[IncomingRawMessage]
func NewCommandMessageHandler ¶
func NewCommandMessageHandler(reg registry.Registry, publisher ReplyPublisher, handler ddd.CommandHandler[ddd.Command]) RawMessageHandler
func NewEventMessageHandler ¶
func NewEventMessageHandler(reg registry.Registry, handler ddd.EventHandler[ddd.Event]) RawMessageHandler
func NewReplyMessageHandler ¶
func NewReplyMessageHandler(reg registry.Registry, handler ddd.ReplyHandler[ddd.Reply]) RawMessageHandler
func RawMessageHandlerWithMiddleware ¶
func RawMessageHandlerWithMiddleware(handler RawMessageHandler, mws ...RawMessageHandlerMiddleware) RawMessageHandler
type RawMessageHandlerFunc ¶
type RawMessageHandlerFunc func(ctx context.Context, msg IncomingRawMessage) error
func (RawMessageHandlerFunc) HandleMessage ¶
func (f RawMessageHandlerFunc) HandleMessage(ctx context.Context, cmd IncomingRawMessage) error
type RawMessageHandlerMiddleware ¶
type RawMessageHandlerMiddleware = func(handler RawMessageHandler) RawMessageHandler
type RawMessagePublisher ¶
type RawMessagePublisher = MessagePublisher[RawMessage]
type RawMessageStream ¶
type RawMessageStream = MessageStream[RawMessage, IncomingRawMessage]
func RawMessageStreamWithMiddleware ¶
func RawMessageStreamWithMiddleware(stream RawMessageStream, mws ...RawMessageStreamMiddleware) RawMessageStream
type RawMessageStreamMiddleware ¶
type RawMessageStreamMiddleware = func(stream RawMessageStream) RawMessageStream
type RawMessageSubscriber ¶
type RawMessageSubscriber = MessageSubscriber[IncomingRawMessage]
type ReplyMessage ¶
type ReplyMessageData ¶
type ReplyMessageData struct { Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` OccurredAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=occurred_at,json=occurredAt,proto3" json:"occurred_at,omitempty"` Metadata *structpb.Struct `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` // contains filtered or unexported fields }
func (*ReplyMessageData) Descriptor
deprecated
func (*ReplyMessageData) Descriptor() ([]byte, []int)
Deprecated: Use ReplyMessageData.ProtoReflect.Descriptor instead.
func (*ReplyMessageData) GetMetadata ¶
func (x *ReplyMessageData) GetMetadata() *structpb.Struct
func (*ReplyMessageData) GetOccurredAt ¶
func (x *ReplyMessageData) GetOccurredAt() *timestamppb.Timestamp
func (*ReplyMessageData) GetPayload ¶
func (x *ReplyMessageData) GetPayload() []byte
func (*ReplyMessageData) ProtoMessage ¶
func (*ReplyMessageData) ProtoMessage()
func (*ReplyMessageData) ProtoReflect ¶
func (x *ReplyMessageData) ProtoReflect() protoreflect.Message
func (*ReplyMessageData) Reset ¶
func (x *ReplyMessageData) Reset()
func (*ReplyMessageData) String ¶
func (x *ReplyMessageData) String() string
type ReplyPublisher ¶
type ReplyStream ¶
type ReplyStream = MessageStream[ddd.Reply, IncomingReplyMessage]
func NewReplyStream ¶
func NewReplyStream(reg registry.Registry, stream RawMessageStream) ReplyStream
type ReplySubscriber ¶
type ReplySubscriber = MessageSubscriber[IncomingReplyMessage]
type SubscriberConfig ¶
type SubscriberConfig struct {
// contains filtered or unexported fields
}
func NewSubscriberConfig ¶
func NewSubscriberConfig(options []SubscriberOption) SubscriberConfig
func (SubscriberConfig) AckType ¶
func (c SubscriberConfig) AckType() AckType
func (SubscriberConfig) AckWait ¶
func (c SubscriberConfig) AckWait() time.Duration
func (SubscriberConfig) GroupName ¶
func (c SubscriberConfig) GroupName() string
func (SubscriberConfig) MaxRedeliver ¶
func (c SubscriberConfig) MaxRedeliver() int
func (SubscriberConfig) MessageFilters ¶
func (c SubscriberConfig) MessageFilters() []string
type SubscriberOption ¶
type SubscriberOption interface {
// contains filtered or unexported methods
}
type Subscription ¶
type Subscription interface {
Unsubscribe() error
}