Documentation ¶
Index ¶
Constants ¶
View Source
const ( WebhookSecretHeader = "X-Horizon-Webhook-Secret" WebhookContentTypeHeader = "Content-Type" WebhookContentType = "application/json;charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationInfo ¶
type ApplicationInfo struct { ResourceCommonInfo Priority string `json:"priority,omitempty"` }
ApplicationInfo contains basic info of application
type ClusterInfo ¶
type ClusterInfo struct { ResourceCommonInfo ApplicationName string `json:"applicationName,omitempty"` Env string `json:"env,omitempty"` }
ClusterInfo contains basic info of cluster
type MemberInfo ¶
type MemberInfo struct { ResourceCommonInfo ResourceID uint `json:"resourceID"` ResourceType membermodels.ResourceType `json:"resourceType"` Role string `json:"role"` MemberNameID uint `json:"memberNameID"` MemberName string `json:"memberName"` }
MemberInfo contains basic info of member
type MessageContent ¶
type MessageContent struct { ID uint `json:"id,omitempty"` EventID uint `json:"eventID,omitempty"` WebhookID uint `json:"webhookID,omitempty"` Application *ApplicationInfo `json:"application,omitempty"` Cluster *ClusterInfo `json:"cluster,omitempty"` Pipelinerun *PipelinerunInfo `json:"pipelinerun,omitempty"` Member *MemberInfo `json:"member,omitempty"` EventType string `json:"eventType,omitempty"` User *usermodels.UserBasic `json:"user,omitempty"` Extra *string `json:"extra,omitempty"` }
MessageContent will be marshaled as webhook request body
type PipelinerunInfo ¶
type PipelinerunInfo struct { ResourceCommonInfo ClusterID uint `json:"clusterID,omitempty"` ClusterName string `json:"clusterName,omitempty"` Action string `json:"action,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` GitRef string `json:"gitRef,omitempty"` GitRefType string `json:"gitRefType,omitempty"` }
PipelinerunInfo contains basic info of pipelinerun
type ResourceCommonInfo ¶
type WebhookLogGenerator ¶
type WebhookLogGenerator struct {
// contains filtered or unexported fields
}
WebhookLogGenerator generates webhook logs by events
func NewWebhookLogGenerator ¶
func NewWebhookLogGenerator(manager *managerparam.Manager) *WebhookLogGenerator
Click to show internal directories.
Click to hide internal directories.