cornacchia

package module
v0.0.0-...-365ae5f Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2018 License: BSD-2-Clause Imports: 10 Imported by: 0

README

cornacchia

Simple bot for Alertmanager to send alert notifications to Mattermost.

Credits

This bot was written during a cold weekend, taking code here and there. Reach out if you need credits!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(address string, webhookURL string)

StartServer starts the baracca

Types

type Alert

type Alert struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	StartsAt    Timestamp         `json:"startsAt,omitempty"`
	EndsAt      Timestamp         `json:"endsAt,omitempty"`
}

Alert represent a single alert

type AlertNotification

type AlertNotification struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	Status            string            `json:"status"` // resolved|firing
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []Alert           `json:"alerts"`
}

AlertNotification is a bunch of alerts

type Timestamp

type Timestamp time.Time

Timestamp is a helper type to handle RFC3339 timestamps

func (*Timestamp) MarshalJSON

func (t *Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON emits a timestamp suitable for use in json

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(b []byte) error

UnmarshalJSON reads back data from json

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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