naads

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2019 License: BSD-2-Clause Imports: 10 Imported by: 0

README

naads - Highly available Go client for Pelmorex NAADS

Build Status Go Report Card GoDoc GitHub license

Package naads is a highly available client written in Go for Pelmorex's National Alert Aggregation & Dissemination System (NAADS).

screenshot

This is a work in progress. Please do not use it yet as more testing is still required. Documentation will be provided soon.

The naads client currently undergoing tests. The test instance is publicly accessible and can be accessed here.

License

Copyright (c) 2019 Tanner Ryan. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Documentation

Overview

Package naads is a highly available client written in Go for Pelmorex's National Alert Aggregation & Dissemination System (NAADS).

This is a work in progress. Please do not use it yet as more testing is still required. Documentation will be provided soon.

License

Copyright (c) 2019 Tanner Ryan. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Feeds      []*Feed // Array of NAADS Feeds to listen to (feeds defined first have greater priority when multiple feeds are available)
	LogControl bool    // Indicator to log control status to stdout
	// contains filtered or unexported fields
}

Client represents the configuration for the NAAD client.

func (*Client) HTTP

func (c *Client) HTTP(port int)

HTTP starts an endpoint for viewing the status of the NAADS client.

func (*Client) Start

func (c *Client) Start() chan *cap.Alert

Start will start the highly available NAADS client. It will connect to all the feeds listed, locking to one of the feeds. When locked, the feed's messages will be passed to the output channel. If the locked feed goes down, the client will automatically lock onto another available feed. The individual feeds are responsible for providing their connection status, and for performing reconnect procedures.

type Feed

type Feed struct {
	Name            string        // Name of NAADS server (display purposes)
	Host            string        // Hostname of NAADS server
	SendHeartbeat   bool          // Send NAADS heartbeats to output channel
	ConnectTimeout  time.Duration // Timeout on connection/reconnection
	LivenessTimeout time.Duration // Duration between messages before feed is considered dead
	ReconnectDelay  time.Duration // Delay before attempting reconnection
	LogStatus       bool          // Indicator to log feed status (incoming messages + disconnections) to stdout
	LogHeartbeat    bool          // If LogStatus is enabled, indicator to log heartbeats to stdout
	// contains filtered or unexported fields
}

Feed is a TCP client for the NAADS system. It will be used for receiving the TCP data stream and for converting the raw XML to CAP Alert structs.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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