notification

package
v0.0.0-...-c8675c1 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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBodyContent

func CreateBodyContent(tags []tag.Tag, temperature float32, readerAlias string) string

CreateBodyContent composes the body for the notification message

func PostNotification

func PostNotification(content string, notificationServiceURL string) error

PostNotification sends a notification when group of tags reach freezer area This leverages EdgeX Alerts & notification service

func RegisterSubscriber

func RegisterSubscriber(emails []string, notificationServiceURL string) error

RegisterSubscriber registers a subscriber to EdgeX Alerts & notification service using email as channel

Types

type Channels

type Channels struct {
	Type          string   `json:"type"`
	URL           string   `json:"url,omitempty"`
	MailAddresses []string `json:"mailAddresses,omitempty"`
}

Channels holds the body schema to specify different type of notification channels (email, SMS, REST post call)

type Notification

type Notification struct {
	Slug     string   `json:"slug"`
	Sender   string   `json:"sender"`
	Category string   `json:"category"`
	Severity string   `json:"severity"`
	Content  string   `json:"content"`
	Labels   []string `json:"labels"`
}

Notification holds the body schema to post a notification event to EdgeX

type Subscriber

type Subscriber struct {
	Slug                 string     `json:"slug"`
	Receiver             string     `json:"receiver"`
	SubscribedCategories []string   `json:"subscribedCategories"`
	SubscribedLabels     []string   `json:"subscribedLabels"`
	Channels             []Channels `json:"channels"`
}

Subscriber holds the body schema to register a subscriber to EdgeX

Jump to

Keyboard shortcuts

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