sentrylib

package
v0.0.0-...-b93a57f Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyCallsignError error = errors.New("No Callsign")
View Source
var FrameNotValidError error = errors.New("Frame Not Valid")

Functions

func NewWebServer

func NewWebServer(store sentry_store.Store)

func RunReaper

func RunReaper(sentryWorker SentryWorker, duration time.Duration, skipCooldown bool)

func Watchdog

func Watchdog(sentryWorker SentryWorker)

Types

type AprsClient

type AprsClient interface {
	Dial() error
	Next() bool
	Error() error
	Frame() (aprs.Frame, error)
	Close() error
}

func NewAprsClient

func NewAprsClient(server, callsign, passcode, filter string) AprsClient

type BoltConfig

type BoltConfig struct {
	File string
}

type CallsignTimeLive

type CallsignTimeLive struct {
	sentry_store.CallsignTime
	SeenRecently bool
}

type Config

type Config struct {
	AprsServer      string
	AprsUser        string
	AprsPasscode    string
	AprsFilter      string
	Cutoff          string
	SkipCooldown    bool             `json:",omitempty"`
	Mailgun         *MailgunConfig   `json:",omitempty"`
	BoltConfig      *BoltConfig      `json:",omitempty"`
	PostgresConfig  *PostgresConfig  `json:",omitempty"`
	GoLevelDBConfig *GoLevelDbConfig `json:",omitempty"`
	RethinkDBConfig *RethinkConfig   `json:",omitempty"`
}

type GoLevelDbConfig

type GoLevelDbConfig struct {
	File string
}

type Mail

type Mail interface {
	Send(email, callsign string, ts time.Time) error
}

func NewMailgunServer

func NewMailgunServer(config Config) Mail

type MailgunConfig

type MailgunConfig struct {
	Domain      string
	ApiKey      string
	PubApiKey   string
	FromAddress string
}

type PostgresConfig

type PostgresConfig struct {
	ConnString string `yaml:"connstring,omitempty" json:",omitempty"`
	User       string
	Password   string
	Host       string
	DbName     string
	SslMode    string
}

type RethinkConfig

type RethinkConfig struct {
	Address  string
	Database string
	Username string
	Password string
}

type Sentry

type Sentry interface {
	Serve() error
}

func NewSentry

func NewSentry(config Config) Sentry

type SentryWorker

type SentryWorker interface {
	HandleMessage(frame aprs.Frame) error
	ReapLiveNodes() ([]sentry_store.CallsignTime, error)
	Email(callsign string, ts time.Time)
	LastSeen() (time.Time, error)
}

func NewSentryWorker

func NewSentryWorker(store sentry_store.Store, liveDuration time.Duration, mail Mail) SentryWorker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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