worker

package
v0.0.0-...-d39f515 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CreateEventQueue rabbitmq.QueueName = "createEvent"
View Source
const EndTrialsQueue rabbitmq.QueueName = "endTrials"
View Source
const NotifyAboutEndingTrialsQueue rabbitmq.QueueName = "notifyAboutEndingTrials"
View Source
const NotifyAboutTrialMidwaysQueue rabbitmq.QueueName = "notifyAboutTrialMidways"
View Source
const SendEmailQueue rabbitmq.QueueName = "sendEmail"
View Source
const SendWebhookQueue rabbitmq.QueueName = "sendWebhook"

Variables

View Source
var Queues = []*rabbitmq.Queue{
	{Name: CreateEventQueue},
	{Name: EndTrialsQueue},
	{Name: NotifyAboutEndingTrialsQueue, Ttl: 24 * time.Hour},
	{Name: NotifyAboutTrialMidwaysQueue, Ttl: 15 * 24 * time.Hour},
	{Name: SendEmailQueue},
	{Name: SendWebhookQueue},
}

Functions

func CreateEvent

func CreateEvent(dp *depot.Depot, payload *CreateEventPayload) error

func EndTrials

func EndTrials(dp *depot.Depot) error

func NotifyAboutEndingTrials

func NotifyAboutEndingTrials(dp *depot.Depot) error

func NotifyAboutTrialMidways

func NotifyAboutTrialMidways(dp *depot.Depot) error

func Run

func Run(dp *depot.Depot, queues []string) error

func SendEmail

func SendEmail(dp *depot.Depot, payload *SendEmailPayload) error

func SendWebhook

func SendWebhook(dp *depot.Depot, payload *SendWebhookPayload)

Types

type CreateEventPayload

type CreateEventPayload = event.CreatePayload

type Event

type Event string
const (
	SendWebhookEventOrganizationDeleted Event = "organization.deleted"
	SendWebhookEventUserSignedUp        Event = "user.signed_up"
)

type SendEmailPayload

type SendEmailPayload = email.SendInput

type SendWebhookPayload

type SendWebhookPayload struct {
	Data  map[string]any
	Event Event
}

Jump to

Keyboard shortcuts

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