Documentation
¶
Overview ¶
Package messaging publishes and reads inter-agent messages.
Index ¶
- type Service
- func (m *Service) Acknowledge(ctx context.Context, consumerID string, messageIDs []string) error
- func (m *Service) GenerateTopic(prefix string) string
- func (m *Service) GetUnread(ctx context.Context, consumerID string, topic string) ([]messaging.Message, error)
- func (m *Service) ListTopics(ctx context.Context) ([]string, error)
- func (m *Service) Prune(ctx context.Context, olderThan time.Duration) (int, error)
- func (m *Service) Publish(ctx context.Context, msg messaging.Message, topics []string) (messaging.PublishResult, error)
- func (m *Service) Subscribe(ctx context.Context, topic string, since time.Time) ([]messaging.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service wraps messaging.Store with domain logic.
func NewService ¶
NewService creates a new Service.
func (*Service) Acknowledge ¶
Acknowledge marks messages as read by a consumer.
func (*Service) GenerateTopic ¶
GenerateTopic creates a new topic name using the configured prefix and a random suffix.
func (*Service) GetUnread ¶
func (m *Service) GetUnread(ctx context.Context, consumerID string, topic string) ([]messaging.Message, error)
GetUnread returns messages not yet acknowledged by consumer.
func (*Service) ListTopics ¶
ListTopics returns all topic names.
Click to show internal directories.
Click to hide internal directories.