Documentation ¶
Index ¶
- func BindTaskToEvent(event Event, triggerTask Task)
- func BindTaskToEventAndMakePayload[T PayloadType, TriggerTaskDataType PayloadType](event Event, triggerTask Task, ...)
- func PublishEvent(event Event) (isSuccess bool)
- func PublishEventToOutboxWithPayload[T PayloadType](ctx context.Context, event Event, payload T) error
- func PublishEventWithPayload[T PayloadType](event Event, fetchTaskData T) (isSuccess bool)
- func PublishTask(task Task) (isSuccess bool)
- func PublishTaskToOutbox(ctx context.Context, task Task) error
- func PublishTaskToOutboxWithPayload[T PayloadType](ctx context.Context, task Task, payload T) error
- func PublishTaskWithPayload[T PayloadType](task Task, payload T) (isSuccess bool)
- func RepublishDieMsg(batch int, ctx context.Context) error
- func SubscribeEvent[T PayloadType](event Event, name string, handleTransaction handler[T])
- func SubscribeTask(task Task, handler func(ctx context.Context) error)
- func SubscribeTaskWithPayload[T PayloadType](task Task, handle handler[T])
- func SubscribeTaskWithPayloadAndProcessInTransaction[T PayloadType](task Task, handleTransaction handler[T])
- type Event
- type EventTransactionUpdatePayload
- type PayloadSendCaptchaEmail
- type PayloadSendNotificationEmail
- type PayloadType
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindTaskToEvent ¶
func BindTaskToEventAndMakePayload ¶
func BindTaskToEventAndMakePayload[T PayloadType, TriggerTaskDataType PayloadType]( event Event, triggerTask Task, fetchTaskData func(eventData T) (TriggerTaskDataType, error), )
func PublishEvent ¶
func PublishEventToOutboxWithPayload ¶
func PublishEventToOutboxWithPayload[T PayloadType](ctx context.Context, event Event, payload T) error
func PublishEventWithPayload ¶
func PublishEventWithPayload[T PayloadType](event Event, fetchTaskData T) (isSuccess bool)
func PublishTask ¶
func PublishTaskToOutbox ¶
PublishTaskToOutbox Must be used in a transaction,see db.Transaction
func PublishTaskToOutboxWithPayload ¶
func PublishTaskToOutboxWithPayload[T PayloadType](ctx context.Context, task Task, payload T) error
PublishTaskToOutboxWithPayload Must be used in a transaction,see db.Transaction
func PublishTaskWithPayload ¶
func PublishTaskWithPayload[T PayloadType](task Task, payload T) (isSuccess bool)
func SubscribeEvent ¶
func SubscribeEvent[T PayloadType](event Event, name string, handleTransaction handler[T])
func SubscribeTaskWithPayload ¶
func SubscribeTaskWithPayload[T PayloadType](task Task, handle handler[T])
func SubscribeTaskWithPayloadAndProcessInTransaction ¶
func SubscribeTaskWithPayloadAndProcessInTransaction[T PayloadType](task Task, handleTransaction handler[T])
Types ¶
type Event ¶
const EventOutbox Event = "outbox"
const EventTransactionCreate Event = "transaction_create_event"
const EventTransactionDelete Event = "transaction_delete_event"
const EventTransactionUpdate Event = "transaction_update_event"
type EventTransactionUpdatePayload ¶
type EventTransactionUpdatePayload struct {
OldTrans, NewTrans transactionModel.Transaction
}
type PayloadSendCaptchaEmail ¶
type PayloadSendCaptchaEmail struct { Email string Action constant.UserAction }
type PayloadSendNotificationEmail ¶
type PayloadSendNotificationEmail struct { UserId uint Notification constant.Notification }
type PayloadType ¶
type PayloadType interface{}
type Task ¶
const TaskCreateTourist Task = "createTourist"
user task
const TaskMappingCategoryToAccountMapping Task = "mappingCategoryToAccountMapping"
category task
const TaskOutbox Task = "outbox"
const TaskSendCaptchaEmail Task = "sendCaptchaEmail"
email task
const TaskSendNotificationEmail Task = "sendNotificationEmail"
const TaskStatisticUpdate Task = "statisticUpdate"
transaction task
const TaskTransactionSync Task = "transactionSync"
const TaskTransactionTimingExec Task = "transactionTimingExec"
const TaskTransactionTimingTaskAssign Task = "transactionTimingTaskAssign"
const TaskUpdateCategoryMapping Task = "updateCategoryMapping"
Click to show internal directories.
Click to hide internal directories.