Documentation
¶
Index ¶
- type MemoryQueueService
- func (m *MemoryQueueService) AddSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
- func (m *MemoryQueueService) Close() error
- func (m *MemoryQueueService) GetSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
- func (m *MemoryQueueService) Publish(topic string, messages ...*message.Message) error
- func (m *MemoryQueueService) RemoveSubscriber(ctx context.Context, userID string) error
- func (m *MemoryQueueService) Subscribe(ctx context.Context, topic string) (<-chan *message.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryQueueService ¶
type MemoryQueueService struct {
// contains filtered or unexported fields
}
MemoryQueueService implements QueueEngineInterface using Watermill GoChannel Pub/Sub
func GetMemoryQueueDriver ¶
func GetMemoryQueueDriver(cfg *models.Config) (*MemoryQueueService, error)
func (*MemoryQueueService) AddSubscriber ¶
func (m *MemoryQueueService) AddSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
AddSubscriber method adds a subscriber to the Pub/Sub service and returns a pointer to the Subscriber object and an error if the operation fails.
func (*MemoryQueueService) Close ¶
func (m *MemoryQueueService) Close() error
Close implements QueueEngineInterface.Close
func (*MemoryQueueService) GetSubscriber ¶
func (m *MemoryQueueService) GetSubscriber(ctx context.Context, userID string) (*models.Subscriber, error)
GetSubscriber method retrieves a subscriber from the Pub/Sub service and returns a pointer to the Subscriber object and an error if the operation fails.
func (*MemoryQueueService) Publish ¶
func (m *MemoryQueueService) Publish(topic string, messages ...*message.Message) error
Publish implements message.Publisher interface
func (*MemoryQueueService) RemoveSubscriber ¶
func (m *MemoryQueueService) RemoveSubscriber(ctx context.Context, userID string) error
RemoveSubscriber method removes a subscriber from the Pub/Sub service and returns an error if the operation fails.
Click to show internal directories.
Click to hide internal directories.