alert

package
v0.0.0-...-643a650 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AlertType is type for alert
	AlertType = "Alert"

	// Not Whitelisted Alert Type
	NotWhitelisted = 401
)

Variables

This section is empty.

Functions

func NotifyChannel

func NotifyChannel(notificationChan chan Notification)

NotifyChannel iterates through messages in the notification channel and post to cloud connector

func PostNotification

func PostNotification(data []byte, toURL string) ([]byte, error)

PostNotification post notification data vial http call to the toURL

func ProcessAlert

func ProcessAlert(jsonBytes *[]byte, notificationChan chan Notification) error

ProcessAlert takes alert json bytes and post to notification channel

Types

type Notification

type Notification struct {
	NotificationType    string
	NotificationMessage string
	Data                interface{}
	GatewayID           string
	Endpoint            string
}

Notification struct

func (*Notification) GeneratePayload

func (notification *Notification) GeneratePayload() error

GeneratePayload wraps the original notification with some additional metadata for use with the Cloud Connector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL