alarm

package
v0.0.0-...-2e804f1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Overview

Alarm package handles alerting and notification for dnszilla. it's meant to be modular and follow a template guideline.

Index

Constants

View Source
const (
	SeverityCritical = iota + 1
	SeverityHigh
	SeverityWarning
	SeverityInfo
)

Variables

This section is empty.

Functions

func NewStdoutAlarm

func NewStdoutAlarm(s state.State) *stdoutAlarm

func NewdummyAlarm

func NewdummyAlarm(s state.State) *dummyAlarm

func SetupAlarms

func SetupAlarms(s state.State, k *koanf.Koanf, alarmPubSub *PubSub)

Types

type Alarm

type Alarm struct {
	RawEvent dnszilla.DNSResult
	Severity uint8
	Name     string
	Text     string
	Tags     map[string]string
}

a named fanout pubsub system for DNS result alarms

type PubSub

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

func NewPubSub

func NewPubSub(s state.State) *PubSub

New creates a new PubSub instance

func (*PubSub) Pub

func (p *PubSub) Pub(pub chan Alarm, name string)

Pub takes an input chan and name and publishes it

func (*PubSub) PubCount

func (p *PubSub) PubCount() int

func (*PubSub) Sub

func (p *PubSub) Sub(names ...string) chan Alarm

Sub takes a list of publisher names and subscribes to them

func (*PubSub) SubCount

func (p *PubSub) SubCount() int

Jump to

Keyboard shortcuts

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