package notifications

import "github.com/edgexfoundry/go-mod-core-contracts/clients/notifications"

notifications provides a client for integrating with the support-notifications service.

Index

Types

type CategoryEnum

type CategoryEnum string
const (
	SECURITY  CategoryEnum = "SECURITY"
	HW_HEALTH CategoryEnum = "HW_HEALTH"
	SW_HEALTH CategoryEnum = "SW_HEALTH"
)

type Notification

type Notification struct {
	Id          string       `json:"id,omitempty"`          // Generated by the system, users can ignore
	Slug        string       `json:"slug"`                  // A meaningful identifier provided by client
	Sender      string       `json:"sender"`                // Indicates the sender of a notification -- possibly a service name or email address
	Category    CategoryEnum `json:"category"`              // Allows for categorization of notifications
	Severity    SeverityEnum `json:"severity"`              // Denotes the severity of a notification
	Content     string       `json:"content"`               // Content contains the body of the notification
	ContentType string       `json:"contenttype,omitempty"` // ContentType contains the content type of the notification
	Description string       `json:"description,omitempty"` // Description content for the notification
	Status      StatusEnum   `json:"status,omitempty"`      // Status reflects a simple workflow assignment for the notification
	Labels      []string     `json:"labels,omitempty"`      // Labels allows the notification to be further described/classified
	Created     int          `json:"created,omitempty"`     // The creation timestamp
	Modified    int          `json:"modified,omitempty"`    // The last modification timestamp
}

Notification defines the structure of data being sent.

type NotificationsClient

type NotificationsClient interface {
	// SendNotification sends a notification.
	SendNotification(ctx context.Context, n Notification) error
}

NotificationsClient defines the interface for interactions with the EdgeX Foundry support-notifications service.

func NewNotificationsClient

func NewNotificationsClient(urlClient interfaces.URLClient) NotificationsClient

NewNotificationsClient creates an instance of NotificationsClient

type SeverityEnum

type SeverityEnum string
const (
	CRITICAL SeverityEnum = "CRITICAL"
	NORMAL   SeverityEnum = "NORMAL"
)

type StatusEnum

type StatusEnum string
const (
	NEW       StatusEnum = "NEW"
	PROCESSED StatusEnum = "PROCESSED"
	ESCALATED StatusEnum = "ESCALATED"
)

Source Files

client.go

Version
v0.1.149 (latest)
Published
Jan 19, 2021
Platform
linux/amd64
Imports
3 packages
Last checked
5 days ago

Tools for package owners.