Documentation ¶
Index ¶
Constants ¶
View Source
const ( NotifyTypeHTTP = "http" NotifyTypeSlack = "slack" )
const definitions
View Source
const ( // WebhookTopic is topic for sending webhook payload WebhookTopic = "http" // SlackTopic is topic for sending slack payload SlackTopic = "slack" // EmailTopic is topic for sending email payload EmailTopic = "email" )
Define global topic names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventData ¶
type EventData struct { Resources []*Resource `json:"resources,omitempty"` Repository *Repository `json:"repository,omitempty"` Replication *model.Replication `json:"replication,omitempty"` Retention *model.Retention `json:"retention,omitempty"` Scan *model.Scan `json:"scan,omitempty"` Custom map[string]string `json:"custom_attributes,omitempty"` }
EventData of notification event payload
type HookEvent ¶
type HookEvent struct { ProjectID int64 PolicyID int64 EventType string Target *policy_model.EventTarget Payload *Payload }
HookEvent is hook related event data to publish
type Payload ¶
type Payload struct { Type string `json:"type"` OccurAt int64 `json:"occur_at"` Operator string `json:"operator"` EventData *EventData `json:"event_data,omitempty"` }
Payload of notification event
type Repository ¶
type Repository struct { DateCreated int64 `json:"date_created,omitempty"` Name string `json:"name"` Namespace string `json:"namespace"` RepoFullName string `json:"repo_full_name"` RepoType string `json:"repo_type"` }
Repository info of notification event
type Resource ¶
type Resource struct { Digest string `json:"digest,omitempty"` Tag string `json:"tag,omitempty"` ResourceURL string `json:"resource_url,omitempty"` ScanOverview map[string]interface{} `json:"scan_overview,omitempty"` SBOMOverview map[string]interface{} `json:"sbom_overview,omitempty"` }
Resource describe infos of resource triggered notification
Click to show internal directories.
Click to hide internal directories.