Documentation
¶
Overview ¶
Package webhooks defines the ticket and article events GoatFlow publishes to outbound webhooks and turns database changes into those events.
Index ¶
Constants ¶
View Source
const ( // RetentionDaysEnv sets the retention in days; 0 keeps deliveries forever. RetentionDaysEnv = "GOATFLOW_WEBHOOK_DELIVERY_RETENTION_DAYS" DefaultRetentionDays = 30 )
Delivery log retention. Delivered and failed deliveries older than the retention are deleted by the dispatcher at most once per pruneInterval.
View Source
const ( EventTicketCreated = "ticket.created" EventTicketUpdated = "ticket.updated" EventTicketStateChanged = "ticket.state_changed" EventTicketClosed = "ticket.closed" EventTicketQueueMoved = "ticket.queue_moved" EventTicketAssigned = "ticket.assigned" EventTicketPriorityChanged = "ticket.priority_changed" EventTicketMerged = "ticket.merged" EventTicketEscalated = "ticket.escalated" EventArticleCreated = "article.created" )
Event types a webhook can subscribe to.
Variables ¶
View Source
var Events = []EventInfo{ {EventTicketCreated, "A ticket was created (any channel)."}, {EventTicketUpdated, "Ticket title, customer, type, service, SLA, responsible, lock, pending time or a dynamic field changed."}, {EventTicketStateChanged, "The ticket state changed to a state that is not closed."}, {EventTicketClosed, "The ticket state changed to a closed state."}, {EventTicketQueueMoved, "The ticket moved to another queue."}, {EventTicketAssigned, "The ticket owner changed."}, {EventTicketPriorityChanged, "The ticket priority changed."}, {EventTicketMerged, "The ticket was merged."}, {EventTicketEscalated, "A response, update or solution time escalation started."}, {EventArticleCreated, "An article (note, reply, email, phone call, web request) was added to a ticket."}, }
Events is the catalogue of subscribable events, in display order.
Functions ¶
Types ¶
type Service ¶ added in v0.10.0
type Service struct {
// contains filtered or unexported fields
}
Service turns ticket, article and history rows into webhook deliveries, sends due deliveries and prunes the delivery log. Run it periodically from a single goroutine per process (the runner task does); several processes may run it concurrently.
func NewService ¶ added in v0.10.0
NewService returns a service on db.
Click to show internal directories.
Click to hide internal directories.