alert

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

Documentation

Index

Constants

View Source
const (
	// InventoryUnload is the alert number for reset-baseline type of alert
	InventoryUnload = 260
	// NotWhitelisted is the alert number for epc tag not being whitelist
	NotWhitelisted = 401
	// SendEventFailed is the alert number for unable to send processed event to the cloud connector
	SendEventFailed = 403
)

alert_number section:

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	SentOn      int64       `json:"sent_on"`
	Number      int         `json:"alert_number"`
	Description string      `json:"alert_description"`
	Severity    string      `json:"severity"`
	Optional    interface{} `json:"optional"`
}

Alert value for cloud which does not include controller_id

func (Alert) IsInventoryUnloadAlert

func (alert Alert) IsInventoryUnloadAlert() bool

IsInventoryUnloadAlert parses out the payload JSON bytes and check if the alert number is for INENTORY_UNLOAD, which is 260, or not. Return true if it is; false otherwise

type MessagePayload

type MessagePayload struct {
	Application string `json:"application"`
	Value       Alert  `json:"value"`
}

MessagePayload is the json data to alertmessage endpoint of RFID-alert-service

func (*MessagePayload) SendDeleteTagCompletionAlertMessage

func (payload *MessagePayload) SendDeleteTagCompletionAlertMessage() error

SendDeleteTagCompletionAlertMessage sends alertmessage POST restful API call to RFID alert service for completion of deleting tag collection in mongo db

func (*MessagePayload) SendEventPostFailedAlertMessage

func (payload *MessagePayload) SendEventPostFailedAlertMessage(cloudConnectorPostURL string) error

SendEventPostFailedAlertMessage sends alertmessage POST restful API call to RFID alert service for failures on posting events to cloud connector service

type RRSAlert

type RRSAlert struct {
	Alert           // embed
	DeviceId string `json:"device_id"`
}

func ProcessAlert

func ProcessAlert(reading *models.Reading) (RRSAlert, error)

ProcessAlert is to process the RRS Alert JSON payload

Jump to

Keyboard shortcuts

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