Versions in this module Expand all Collapse all v0 v0.1.9 Apr 15, 2026 v0.1.8 Apr 15, 2026 v0.1.7 Apr 15, 2026 v0.1.6 Apr 14, 2026 v0.1.5 Apr 9, 2026 v0.1.4 Apr 7, 2026 v0.1.3 Apr 7, 2026 v0.1.2 Mar 17, 2026 v0.1.1 Feb 12, 2026 v0.1.0 Feb 12, 2026 Changes in this version + var ErrWebhookNameExists = fmt.Errorf("%w: webhook name already exists", shared.ErrAlreadyExists) + var ErrWebhookNotFound = fmt.Errorf("%w: webhook not found", shared.ErrNotFound) + type Delivery struct + Attempt int + CreatedAt time.Time + DeliveredAt *time.Time + DurationMs *int + ErrorMessage string + EventID *ID + EventType string + ID ID + NextRetryAt *time.Time + Payload map[string]any + ResponseBody string + ResponseCode *int + ResponseHeaders map[string]any + Status DeliveryStatus + WebhookID ID + type DeliveryFilter struct + Page int + PerPage int + Status *DeliveryStatus + WebhookID *ID + type DeliveryListResult struct + Data []*Delivery + Page int + PerPage int + Total int64 + TotalPages int + type DeliveryStatus string + const DeliveryFailed + const DeliveryPending + const DeliveryRetrying + const DeliverySuccess + type Filter struct + EventType string + Page int + PerPage int + Search string + SortBy string + SortOrder string + Status *Status + TenantID *ID + type ID = shared.ID + type ListResult struct + Data []*Webhook + Page int + PerPage int + Total int64 + TotalPages int + type Repository interface + Create func(ctx context.Context, w *Webhook) error + Delete func(ctx context.Context, id, tenantID ID) error + GetByID func(ctx context.Context, id, tenantID ID) (*Webhook, error) + List func(ctx context.Context, filter Filter) (ListResult, error) + ListDeliveries func(ctx context.Context, filter DeliveryFilter) (DeliveryListResult, error) + Update func(ctx context.Context, w *Webhook) error + type Status string + const StatusActive + const StatusDisabled + const StatusError + func (s Status) IsValid() bool + type Webhook struct + func NewWebhook(id, tenantID ID, name, url string, eventTypes []string) *Webhook + func Reconstruct(id, tenantID ID, name, description, url string, secretEncrypted []byte, ...) *Webhook + func (w *Webhook) AssetGroupIDs() []string + func (w *Webhook) CreatedAt() time.Time + func (w *Webhook) CreatedBy() *ID + func (w *Webhook) Description() string + func (w *Webhook) Disable() + func (w *Webhook) Enable() + func (w *Webhook) EventTypes() []string + func (w *Webhook) ID() ID + func (w *Webhook) LastError() string + func (w *Webhook) LastErrorAt() *time.Time + func (w *Webhook) LastSentAt() *time.Time + func (w *Webhook) MaxRetries() int + func (w *Webhook) Name() string + func (w *Webhook) RetryIntervalSeconds() int + func (w *Webhook) SecretEncrypted() []byte + func (w *Webhook) SetCreatedBy(id ID) + func (w *Webhook) SetDescription(desc string) + func (w *Webhook) SetEventTypes(types []string) + func (w *Webhook) SetMaxRetries(n int) + func (w *Webhook) SetName(name string) + func (w *Webhook) SetRetryIntervalSeconds(n int) + func (w *Webhook) SetSecret(secret []byte) + func (w *Webhook) SetSeverityThreshold(s string) + func (w *Webhook) SetURL(url string) + func (w *Webhook) SeverityThreshold() string + func (w *Webhook) Status() Status + func (w *Webhook) Tags() []string + func (w *Webhook) TenantID() ID + func (w *Webhook) TotalFailed() int + func (w *Webhook) TotalSent() int + func (w *Webhook) URL() string + func (w *Webhook) UpdatedAt() time.Time