Documentation ¶
Index ¶
Constants ¶
View Source
const ( // QueueHooks is the redis queue for web hooks QueueHooks = "hook_queue" // QueueHookResults is the redis queue for web hook result messages QueueHookResults = "hook_result_queue" // QueueEmailNotifications process email send QueueEmailNotifications = "email_notifications_queue" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Project *models.ProjectDetail `json:"project"` Entity string `json:"entity"` // resource, json EntityKey string `json:"entity_key"` EntityID string `json:"entity_id"` Action string `json:"action"` // create, edit, delete Keys []string `json:"keys"` Payload []byte `json:"payload"` }
Event defines the event(s) to be processed
type HookEvent ¶
type HookEvent struct { Hook *models.WebHook `json:"hook"` EntityKey string `json:"entity_key"` Payload interface{} `json:"payload"` }
HookEvent describes a single web hook event
type Notification ¶
type Notification struct { Template string `json:"template"` Subject string `json:"subject"` ReceiverName string `json:"receiver_name"` ReceiverEmail string `json:"receiver_email"` PlainTextContent string `json:"plain_text_content"` // plain text in the case email html can't render Data map[string]string `json:"data"` // data for template Meta map[string]string `json:"meta"` // meta data for logging }
Notification contains the information in the queue for an email notification
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor process and emits events for web hooks and websockets
func NewProcessor ¶
func NewProcessor(cache redis.UniversalClient, store interfaces.ProjectHooksDatastore) *Processor
NewProcessor creates and returns a new instance of `Processor` with the given redis client
func (*Processor) ProcessResults ¶
ProcessResults listens for web hook results on the redis queue. This function should be run as a goroutine.
Click to show internal directories.
Click to hide internal directories.