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) Start ¶
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.