Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFakeEmailSender ¶
NewFakeEmailSender initiates email sender
func StartWorkerService ¶
func StartWorkerService(ctx context.Context, data *ServiceData) (chan struct{}, error)
StartWorkerService starts the event queue listener service to listen for inform events returns channel for tracking when all jobs are finished
Types ¶
type DB ¶
type DB interface { LockEmailTable(context.Context, string, string) error UnLockEmailTable(context.Context, string, string, int) error LoadRequest(ctx context.Context, id string) (*persistence.ReqData, error) }
DB tracks email sending process It is used to quarantee not to send the emails twice
type EmailMaker ¶
EmailMaker prepares the email
type EmailRetriever ¶
EmailRetriever return the email by ID
type MsgSender ¶
type MsgSender interface {
SendMessage(context.Context, amessages.Message, messages.Options) error
}
MsgSender provides send msg functionality
type ServiceData ¶
type ServiceData struct { GueClient *gue.Client WorkerCount int EmailSender Sender EmailMaker EmailMaker DB DB Location *time.Location }
ServiceData keeps data required for service work
Click to show internal directories.
Click to hide internal directories.