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 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 RawMessage
- type RawMessageHandler
- type RawMessagePublisher
- type RawMessageStream
- 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
Constants ¶
View Source
const ( CommandHdrPrefix = "COMMAND_" CommandNameHdr = CommandHdrPrefix + "NAME" CommandReplyChannelHdr = CommandHdrPrefix + "REPLY_CHANNEL" )
View Source
const ( FailureReply = "am.Failure" SuccessReply = "am.Success" OutcomeSuccess = "SUCCESS" OutcomeFailure = "FAILURE" ReplyHdrPrefix = "REPLY_" ReplyNameHdr = ReplyHdrPrefix + "NAME" ReplyOutcomeHdr = ReplyHdrPrefix + "OUTCOME" )
Variables ¶
View Source
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 CommandMessageHandlerFunc ¶
type CommandMessageHandlerFunc func(ctx context.Context, msg IncomingCommandMessage) (ddd.Reply, error)
func (CommandMessageHandlerFunc) HandleMessage ¶
func (f CommandMessageHandlerFunc) HandleMessage(ctx context.Context, cmd IncomingCommandMessage) (ddd.Reply, error)
type CommandPublisher ¶
type CommandStream ¶
type CommandStream interface {
MessagePublisher[ddd.Command]
CommandSubscriber
}
func NewCommandStream ¶
func NewCommandStream(reg registry.Registry, stream RawMessageStream) CommandStream
type CommandSubscriber ¶
type CommandSubscriber interface {
Subscribe(topicName string, handler CommandMessageHandler, options ...SubscriberOption) error
}
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 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) error }
type RawMessage ¶
type RawMessageHandler ¶
type RawMessageHandler = MessageHandler[IncomingRawMessage]
type RawMessagePublisher ¶
type RawMessagePublisher = MessagePublisher[RawMessage]
type RawMessageStream ¶
type RawMessageStream = MessageStream[RawMessage, IncomingRawMessage]
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
}
Click to show internal directories.
Click to hide internal directories.