iff

package
v0.0.0-...-d221b79 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertMatch

type AlertMatch struct {
	AlertID    string `json:"id,omitempty"`
	BuildingID string `json:"buildingID,omitempty"`
	RoomID     string `json:"roomID,omitempty"`
	DeviceID   string `json:"deviceID,omitempty"`

	Type     string `json:"type,omitempty"`
	Category string `json:"category,omitempty"`
	Severity string `json:"severity,omitempty"`

	Message    string   `json:"message,omitempty"`
	MessageLog []string `json:"message-log,omitempty"`
	Data       string   `json:"data,omitempty,omitempty"`
	SystemType string   `json:"system-type,omitempty"`
	Requester  string   `json:"requester,omitempty"`

	AlertStartTime      string `json:"start-time,omitempty"`
	AlertEndTime        string `json:"end-time,omitempty"`
	AlertLastUpdateTime string `json:"update-time,omitempty"`

	Active *bool `json:"active,omitempty"`

	AlertTags  []string `json:"alert-tags,omitempty"`
	RoomTags   []string `json:"room-tags,omitempty"`
	DeviceTags []string `json:"device-tags,omitempty"`
	// contains filtered or unexported fields
}

AlertMatch .

func (*AlertMatch) DoesAlertMatch

func (m *AlertMatch) DoesAlertMatch(ctx context.Context) bool

DoesAlertMatch .

type EventMatch

type EventMatch struct {
	Count int

	GeneratingSystem string   `json:"generating-system,omitempty"`
	Timestamp        string   `json:"timestamp,omitempty"`
	EventTags        []string `json:"event-tags,omitempty"`
	Key              string   `json:"key,omitempty"`
	Value            string   `json:"value,omitempty"`
	User             string   `json:"user,omitempty"`
	Data             string   `json:"data,omitempty"`
	AffectedRoom     struct {
		BuildingID string `json:"buildingID,omitempty"`
		RoomID     string `json:"roomID,omitempty"`
	} `json:"affected-room,omitempty"`
	TargetDevice struct {
		BuildingID string `json:"buildingID,omitempty"`
		RoomID     string `json:"roomID,omitempty"`
		DeviceID   string `json:"deviceID,omitempty"`
	} `json:"target-device,omitempty"`
	// contains filtered or unexported fields
}

EventMatch .

func (*EventMatch) DoesEventMatch

func (m *EventMatch) DoesEventMatch(ctx context.Context) bool

DoesEventMatch .

type If

type If struct {
	EventMatch     *EventMatch     `json:"event-match,omitempty"`
	AlertMatch     *AlertMatch     `json:"alert-match,omitempty"`
	RoomIssueMatch *RoomIssueMatch `json:"room-issue-match,omitempty"`
	StateQuery     *StateQuery     `json:"state-query,omitempty"`
}

If represents the set of conditions to running an action

func (*If) Check

func (i *If) Check(ctx context.Context, log *zap.SugaredLogger) (context.Context, bool)

Check returns whether or not the if check passes

type RoomIssueMatch

type RoomIssueMatch struct {
	RoomIssueID string `json:"id,omitempty"`
	BuildingID  string `json:"buildingID,omitempty"`
	RoomID      string `json:"roomID,omitempty"`

	RoomTags []string `json:"room-tags,omitempty"`

	AlertTypes      []string `json:"alert-types,omitempty"`
	AlertDevices    []string `json:"alert-devices,omitempty"`
	AlertCategories []string `json:"alert-categories,omitempty"`
	AlertSeverities []string `json:"alert-severities,omitempty"`
	AlertCount      *int     `json:"alert-count,omitempty"`

	ActiveAlertTypes      []string `json:"active-alert-types,omitempty"`
	ActiveAlertDevices    []string `json:"active-alert-devices,omitempty"`
	ActiveAlertCategories []string `json:"active-alert-categories,omitempty"`
	ActiveAlertSeverities []string `json:"active-alert-severities,omitempty"`
	AlertActiveCount      *int     `json:"active-alert-count,omitempty"`

	SystemType string `json:"system-type,omitempty"`

	IssueTags  []string `json:"issue-tags,omitempty"`
	IncidentID []string `json:"incident-id,omitempty"`
	Notes      string   `json:"notes,omitempty"`

	RoomIssueResponses []struct {
		Responders    []string `json:"responders,omitempty"`
		HelpSentAt    string   `json:"help-sent-at,omitempty"`
		HelpArrivedAt string   `json:"help-arrived-at,omitempty"`
	} `json:"responses,omitempty"`

	Resolved       *bool `json:"resolved,omitempty"`
	ResolutionInfo struct {
		Code       string `json:"resolution-code,omitempty"`
		Notes      string `json:"notes,omitempty"`
		ResolvedAt string `json:"resolved-at,omitempty"`
	} `json:"resolution-info,omitempty"`

	NotesLog []string `json:"notes-log,omitempty"`
	// contains filtered or unexported fields
}

RoomIssueMatch .

func (*RoomIssueMatch) DoesRoomIssueMatch

func (m *RoomIssueMatch) DoesRoomIssueMatch(ctx context.Context) bool

DoesRoomIssueMatch .

type RoomIssueResponseMatchRegex

type RoomIssueResponseMatchRegex struct {
	Responders    []*regexp.Regexp
	HelpSentAt    *regexp.Regexp
	HelpArrivedAt *regexp.Regexp
}

RoomIssueResponseMatchRegex .

type StateQuery

type StateQuery struct {
	Query     string `json:"query"`
	CacheName string `json:"cache-name"` //cache-name
	DataType  string `json:"data-type"`  //reserved for future use
	// contains filtered or unexported fields
}

func (*StateQuery) CheckStore

func (s *StateQuery) CheckStore(ctx context.Context) (bool, context.Context)

CheckStore doesn't expect anything in the context, but it will place the

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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