Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartWorkerService ¶
func StartWorkerService(ctx context.Context, data *ServiceData) (<-chan struct{}, error)
StartWorkerService starts the event queue listener service to listen for configured events return channel to track the finish event
to wait sync for the service to finish: fc, err := StartWorkerService(data) handle err <-fc // waits for finish
Types ¶
type EmailMaker ¶
EmailMaker prepares the email
type EmailRetriever ¶
EmailRetriever return the email by ID
type Locker ¶
type Locker interface { Lock(id string, lockKey string) error UnLock(id string, lockKey string, value *int) error }
Locker tracks email sending process It is used to quarantee not to send the emails twice
type ServiceData ¶
type ServiceData struct { TaskName string WorkCh <-chan amqp.Delivery EmailSender Sender EmailMaker EmailMaker EmailRetriever EmailRetriever Locker Locker Location *time.Location }
ServiceData keeps data required for service work
Click to show internal directories.
Click to hide internal directories.