Documentation
¶
Index ¶
- Constants
- func AllEvents() []string
- func IsValidEvent(event string) bool
- func ParseEvents(eventsJSON string) []string
- type Alert
- type Delivery
- type Error
- type Event
- func (e *Event) WithAlert(alertType, message, severity string) *Event
- func (e *Event) WithDelivery(id, name string) *Event
- func (e *Event) WithError(code, message string) *Event
- func (e *Event) WithFile(id, name string, size int64, checksum, path string) *Event
- func (e *Event) WithProduct(id, name string) *Event
- type File
- type Manager
- func (m *Manager) CreateWebhook(name, url string, events []string) (*database.Webhook, error)
- func (m *Manager) DeleteWebhook(id uint) error
- func (m *Manager) Emit(ctx context.Context, event *Event)
- func (m *Manager) GetWebhook(id uint) (*database.Webhook, error)
- func (m *Manager) ListWebhooks() ([]database.Webhook, error)
- func (m *Manager) SetDisabled(disabled bool)
- func (m *Manager) UpdateWebhook(id uint, name, url string, events []string, enabled bool) error
- type Product
Constants ¶
View Source
const ( EventFileAvailable = "file.available" EventDownloadStarted = "download.started" EventDownloadCompleted = "download.completed" EventDownloadFailed = "download.failed" EventDownloadCancelled = "download.cancelled" EventChecksumMismatch = "checksum.mismatch" EventSyncCompleted = "sync.completed" EventSyncFailed = "sync.failed" )
Variables ¶
This section is empty.
Functions ¶
func IsValidEvent ¶
func ParseEvents ¶
Types ¶
type Event ¶
type Event struct {
Type string `json:"event"`
Timestamp time.Time `json:"timestamp"`
Source string `json:"source"`
Product *Product `json:"product,omitempty"`
Delivery *Delivery `json:"delivery,omitempty"`
File *File `json:"file,omitempty"`
Alerts []Alert `json:"alerts,omitempty"`
Error *Error `json:"error,omitempty"`
}
func (*Event) WithDelivery ¶
func (*Event) WithProduct ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) CreateWebhook ¶
func (*Manager) DeleteWebhook ¶
func (*Manager) SetDisabled ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.