am

package
v0.0.0-...-3a9fddd Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_message_types_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AckType

type AckType int
const (
	AckTypeAuto AckType = iota
	AckTypeManual
)

type AckWait

type AckWait time.Duration

type EventMessage

type EventMessage interface {
	Message
	ddd.Event
}

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 EventPublisher = MessagePublisher[ddd.Event]

type EventStream

type EventStream = MessageStream[ddd.Event, EventMessage]

func NewEventStream

func NewEventStream(reg registry.Registry, stream MessageStream[RawMessage, RawMessage]) EventStream

type EventSubscriber

type EventSubscriber = MessageSubscriber[EventMessage]

type GroupName

type GroupName string

type MaxRedeliver

type MaxRedeliver int

type Message

type Message interface {
	ddd.IDer
	MessageName() string
	Ack() error
	NAck() error
	Extend() error
	Kill() error
}

type MessageFilter

type MessageFilter []string

type MessageHandler

type MessageHandler[O Message] interface {
	HandleMessage(ctx context.Context, msg O) error
}

type MessageHandlerFunc

type MessageHandlerFunc[O Message] func(ctx context.Context, msg O) error

func (MessageHandlerFunc[O]) HandleMessage

func (f MessageHandlerFunc[O]) HandleMessage(ctx context.Context, msg O) error

type MessagePublisher

type MessagePublisher[I any] interface {
	Publish(ctx context.Context, topicName string, v I) error
}

type MessageStream

type MessageStream[I any, O Message] interface {
	MessagePublisher[I]
	MessageSubscriber[O]
}

type MessageSubscriber

type MessageSubscriber[O Message] interface {
	Subscribe(topicName string, handler MessageHandler[O], options ...SubscriberOption) error
}

type RawMessage

type RawMessage interface {
	Message
	Data() []byte
}

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
}

Jump to

Keyboard shortcuts

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