Documentation
¶
Index ¶
- Constants
- Variables
- func GetRoutingKeyFor(webhookType string) string
- func SubmitWebRequest(method string, url string, body interface{}) ([]byte, int, error)
- type NewAlertWebhookData
- type NewAlertWebhookMessage
- type NewCallbackWebhookData
- type NewCallbackWebookMessage
- type NewCustomWebhookMessage
- type NewFeedbackWebhookData
- type NewFeedbackWebookMessage
- type NewStartupWebhookData
- type NewStartupWebhookMessage
- type SlackWebhookMessage
- type SlackWebhookMessageAttachment
- type SlackWebhookMessageAttachmentBlock
- type SlackWebhookMessageAttachmentBlockText
- type WEBHOOK_TYPE
- type WebhookDefinition
Constants ¶
View Source
const ( WEBHOOK_TYPE_NEW_CALLBACK WEBHOOK_TYPE = "new_callback" WEBHOOK_TYPE_NEW_FEEDBACK = "new_feedback" WEBHOOK_TYPE_NEW_STARTUP = "new_startup" WEBHOOK_TYPE_NEW_ALERT = "new_alert" WEBHOOK_TYPE_NEW_CUSTOM = "new_custom" )
View Source
const EMIT_WEBHOOK_ROUTING_KEY_PREFIX = "emit_webhook"
Variables ¶
View Source
var (
AllWebhookData containerWebhookData
)
View Source
var HTTPClient = &http.Client{ Timeout: 5 * time.Second, Transport: tr, }
Functions ¶
func GetRoutingKeyFor ¶
Types ¶
type NewAlertWebhookData ¶
type NewAlertWebhookMessage ¶
type NewAlertWebhookMessage struct {
Data NewAlertWebhookData `json:"data"`
// contains filtered or unexported fields
}
type NewCallbackWebhookData ¶
type NewCallbackWebhookData struct {
User string `json:"user" mapstructure:"user"`
Host string `json:"host" mapstructure:"host"`
IPs string `json:"ips" mapstructure:"ips"`
Domain string `json:"domain" mapstructure:"domain"`
ExternalIP string `json:"external_ip" mapstructure:"external_ip"`
ProcessName string `json:"process_name" mapstructure:"process_name"`
PID int `json:"pid" mapstructure:"pid"`
Os string `json:"os" mapstructure:"os"`
Architecture string `json:"architecture" mapstructure:"architecture"`
AgentType string `json:"agent_type" mapstructure:"agent_type"`
Description string `json:"description" mapstructure:"description"`
ExtraInfo string `json:"extra_info" mapstructure:"extra_info"`
SleepInfo string `json:"sleep_info" mapstructure:"sleep_info"`
DisplayID int `json:"display_id" mapstructure:"display_id"`
ID int `json:"id" mapstructure:"id"`
IntegrityLevel int `json:"integrity_level" mapstructure:"integrity_level"`
}
type NewCallbackWebookMessage ¶
type NewCallbackWebookMessage struct {
Data NewCallbackWebhookData `json:"data"`
// contains filtered or unexported fields
}
type NewCustomWebhookMessage ¶
type NewFeedbackWebhookData ¶
type NewFeedbackWebookMessage ¶
type NewFeedbackWebookMessage struct {
Data NewFeedbackWebhookData `json:"data"`
// contains filtered or unexported fields
}
type NewStartupWebhookData ¶
type NewStartupWebhookData struct {
StartupMessage string `json:"startup_message"`
}
type NewStartupWebhookMessage ¶
type NewStartupWebhookMessage struct {
Data NewStartupWebhookData `json:"data"`
// contains filtered or unexported fields
}
type SlackWebhookMessage ¶
type SlackWebhookMessage struct {
Channel string `json:"channel"`
Username string `json:"username"`
IconEmoji string `json:"icon_emoji"`
Attachments []SlackWebhookMessageAttachment `json:"attachments"`
}
func GetNewDefaultWebhookMessage ¶
func GetNewDefaultWebhookMessage() SlackWebhookMessage
type SlackWebhookMessageAttachment ¶
type SlackWebhookMessageAttachment struct {
Title string `json:"fallback"`
Color string `json:"color,omitempty"`
Blocks *[]SlackWebhookMessageAttachmentBlock `json:"blocks,omitempty"`
}
type SlackWebhookMessageAttachmentBlock ¶
type SlackWebhookMessageAttachmentBlock struct {
Type string `json:"type"`
Text *SlackWebhookMessageAttachmentBlockText `json:"text,omitempty"`
Fields *[]SlackWebhookMessageAttachmentBlockText `json:"fields,omitempty"`
}
type WEBHOOK_TYPE ¶
type WEBHOOK_TYPE = string
type WebhookDefinition ¶
type WebhookDefinition struct {
Name string
Description string
// SemVer is a specific semantic version tracker you can use for your payload type
SemVer string `json:"semver"`
WebhookURL string
WebhookChannel string
NewFeedbackFunction func(input NewFeedbackWebookMessage)
NewCallbackFunction func(input NewCallbackWebookMessage)
NewStartupFunction func(input NewStartupWebhookMessage)
NewAlertFunction func(input NewAlertWebhookMessage)
NewCustomFunction func(input NewCustomWebhookMessage)
Subscriptions []string
OnContainerStartFunction func(sharedStructs.ContainerOnStartMessage) sharedStructs.ContainerOnStartMessageResponse
}
Click to show internal directories.
Click to hide internal directories.