pas

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 6 Imported by: 0

README

PAS - Point Alarm Status

Services for accessing Enlight's point alarm status

services

  • GetPointAlarmStatus
  • GetPointAlarmStatusWithContext
  • SetPointAlarmStatus
  • SetPointAlarmStatusWithContext
  • GetPointAlarmStatusStream
  • GetPointAlarmStatusStreamWithContext
  • GetPointAlarmThreshold
  • GetPointAlarmThresholdWithContext
  • SetPointAlarmThreshold
  • SetPointAlarmThresholdWithContext

example usage

See go doc - package pas

Documentation

Overview

Package pas provides the client for making API requests to the Enlight Point Alarm Status Service.

Examples

Out of Window Overall Alarm

40 <= x      => DANGER
20 <= x < 40 => ALERT
2 < x < 20   => GOOD
1 < x <= 2   => ALERT
x <= 1       => DANGER

SetPointAlarmThresholdInput {
    node_id: "<node_id>",
    user_id: "<user_id>",
    type: OVERALL_OUT_OF_WINDOW,
    intervals: [
        {
            left_bound: 40,
            type: LEFT_BOUNDED_RIGHT_UNBOUNDED_LEFT_CLOSED,
            status: DANGER
        },
        {
            left_bound: 20,
            right_bound: 40,
            type: BOUNDED_LEFT_CLOSED_RIGHT_OPEN,
            status: ALERT
        },
        {
            left_bound: 2,
            right_bound: 20,
            type: BOUNDED_OPEN,
            status: GOOD
        },
        {
            left_bound: 1,
            right_bound: 2,
            type: BOUNDED_LEFT_OPEN_RIGHT_CLOSED,
            status: ALERT
        },
        {
            right_bound: 1,
            type: LEFT_UNBOUNDED_RIGHT_BOUNDED_RIGHT_CLOSED,
            status: DANGER
        }
    ]
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the PointAlarmStatusClient and holds the connection.

func (*Client) CalculateAndSetPointAlarmStatus

func (c *Client) CalculateAndSetPointAlarmStatus(input pas_api.CalculateAndSetPointAlarmStatusInput) error

CalculateAndSetPointAlarmStatus calculates and sets new PAS based on input data

func (*Client) CalculateAndSetPointAlarmStatusWithContext

func (c *Client) CalculateAndSetPointAlarmStatusWithContext(ctx context.Context, input pas_api.CalculateAndSetPointAlarmStatusInput) error

CalculateAndSetPointAlarmStatusWithContext calculates and sets new PAS based on input data

func (*Client) Close

func (c *Client) Close()

Close tears down the ClientConn and all underlying connections.

func (*Client) DeepPing

func (c *Client) DeepPing() (err error)

DeepPing pings the service to see if it is alive.

func (*Client) DeepPingWithContext

func (c *Client) DeepPingWithContext(ctx context.Context) (err error)

DeepPingWithContext pings the service to see if it is alive.

func (*Client) Dial

func (c *Client) Dial(host, port string, opts ...grpc.DialOption) (err error)

Dial creates a client connection to the given host.

func (*Client) GetPointAlarmStatus

func (c *Client) GetPointAlarmStatus(input pas_api.GetPointAlarmStatusInput) (pas_api.AlarmStatus, error)

GetPointAlarmStatus gets the alarm status for a specific point

func (*Client) GetPointAlarmStatusEventLog

func (c *Client) GetPointAlarmStatusEventLog(seqID string) (events pas_api.GetPointAlarmStatusEventLogOutput, err error)

GetPointAlarmStatusEventLog get all alarm events after a given sequence ID

func (*Client) GetPointAlarmStatusEventLogWithContext

func (c *Client) GetPointAlarmStatusEventLogWithContext(ctx context.Context, seqID string) (events pas_api.GetPointAlarmStatusEventLogOutput, err error)

GetPointAlarmStatusEventLogWithContext get all alarm events after a given sequence ID

func (*Client) GetPointAlarmStatusStream

func (c *Client) GetPointAlarmStatusStream(dc chan<- pas_api.GetPointAlarmStatusStreamOutput) error

GetPointAlarmStatusStream gets a stream of alarm status updates for all points

func (*Client) GetPointAlarmStatusStreamWithContext

func (c *Client) GetPointAlarmStatusStreamWithContext(ctx context.Context, dc chan<- pas_api.GetPointAlarmStatusStreamOutput) (err error)

GetPointAlarmStatusStreamWithContext gets a stream of alarm status updates for all points

func (*Client) GetPointAlarmStatusWithContext

func (c *Client) GetPointAlarmStatusWithContext(ctx context.Context, input pas_api.GetPointAlarmStatusInput) (status pas_api.AlarmStatus, err error)

GetPointAlarmStatusWithContext gets the alarm status for a specific point

func (*Client) GetPointAlarmThreshold

func (c *Client) GetPointAlarmThreshold(nodeID string) (pas_api.GetPointAlarmThresholdOutput, error)

GetPointAlarmThreshold gets the alarm threshold for a specific point

func (*Client) GetPointAlarmThresholdWithContext

func (c *Client) GetPointAlarmThresholdWithContext(ctx context.Context, nodeID string) (output pas_api.GetPointAlarmThresholdOutput, err error)

GetPointAlarmThresholdWithContext gets the alarm threshold for a specific point

func (*Client) SetPointAlarmStatus

func (c *Client) SetPointAlarmStatus(input pas_api.SetPointAlarmStatusInput) error

SetPointAlarmStatus sets the alarm status for a specific point

func (*Client) SetPointAlarmStatusWithContext

func (c *Client) SetPointAlarmStatusWithContext(ctx context.Context, input pas_api.SetPointAlarmStatusInput) error

SetPointAlarmStatusWithContext sets the alarm status for a specific point

func (*Client) SetPointAlarmThreshold

func (c *Client) SetPointAlarmThreshold(input pas_api.SetPointAlarmThresholdInput) error

SetPointAlarmThreshold sets the alarm threshold for a specific point

func (*Client) SetPointAlarmThresholdWithContext

func (c *Client) SetPointAlarmThresholdWithContext(ctx context.Context, input pas_api.SetPointAlarmThresholdInput) error

SetPointAlarmThresholdWithContext sets the alarm threshold for a specific point

type PointAlarmStatusClient

type PointAlarmStatusClient interface {
	Dial(host, port string, opts ...grpc.DialOption) error
	Close()

	DeepPing() error
	DeepPingWithContext(ctx context.Context) error

	SetPointAlarmThreshold(input pas_api.SetPointAlarmThresholdInput) error
	SetPointAlarmThresholdWithContext(ctx context.Context, input pas_api.SetPointAlarmThresholdInput) error

	GetPointAlarmThreshold(nodeID string) (pas_api.GetPointAlarmThresholdOutput, error)
	GetPointAlarmThresholdWithContext(ctx context.Context, nodeID string) (pas_api.GetPointAlarmThresholdOutput, error)

	SetPointAlarmStatus(input pas_api.SetPointAlarmStatusInput) error
	SetPointAlarmStatusWithContext(ctx context.Context, input pas_api.SetPointAlarmStatusInput) error

	GetPointAlarmStatus(input pas_api.GetPointAlarmStatusInput) (pas_api.AlarmStatus, error)
	GetPointAlarmStatusWithContext(ctx context.Context, input pas_api.GetPointAlarmStatusInput) (pas_api.AlarmStatus, error)

	GetPointAlarmStatusStream(dc chan<- pas_api.GetPointAlarmStatusStreamOutput) error
	GetPointAlarmStatusStreamWithContext(ctx context.Context, dc chan<- pas_api.GetPointAlarmStatusStreamOutput) error

	CalculateAndSetPointAlarmStatus(input pas_api.CalculateAndSetPointAlarmStatusInput) error
	CalculateAndSetPointAlarmStatusWithContext(ctx context.Context, input pas_api.CalculateAndSetPointAlarmStatusInput) error
}

PointAlarmStatusClient provides the API operation methods for making requests to the Enlight Point Alarm Status Service. See this package's package overview docs for details on the service.

func CreateClient

func CreateClient() PointAlarmStatusClient

CreateClient creates an instance of the PointAlarmStatusClient

Directories

Path Synopsis
Package mock provides a mock for the PointAlarmStatusClient
Package mock provides a mock for the PointAlarmStatusClient

Jump to

Keyboard shortcuts

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