bernhard

package module
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

PkgGoDev GoReportCard Coverage Status Codebeat badge GitHub Actions CI Status GitHub Actions CodeQL Status

InstallationBuild StatusLicense


bernhard is Go package for sending alerts to Bernhard service.

Installation

Make sure you have a working Go 1.15+ workspace (instructions), then:

go get pkg.re/essentialkaos/go-bernhard.v3

For update to the latest stable release, do:

go get -u pkg.re/essentialkaos/go-bernhard.v3

Build Status

Branch Status
master CI
develop CI

License

Apache License, Version 2.0

Documentation

Index

Constants

View Source
const (
	STATE_OK       = "ok"
	STATE_WARN     = "warn"
	STATE_PROBLEM  = "problem"
	STATE_CRITICAL = "critical"
)

Variables

View Source
var ErrBadServiceName = errors.New("Service name contains disallowed symbols")
View Source
var ErrHostNotSet = errors.New("Host field is mandatory and must be set")
View Source
var ErrServiceNotSet = errors.New("Service field is mandatory and must be set")
View Source
var ErrStateNotSet = errors.New("State field is mandatory and must be set")

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Service string `json:"service"`
	Host    string `json:"host"`
	TTL     int    `json:"ttl"`
	State   string `json:"state"`
	Desc    string `json:"description"`
}

Alert contains alert data

type Client

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

Client basic Bernhard client

func NewClient

func NewClient(bernhardURL string) (*Client, error)

NewClient creates new client instance

func (*Client) Add

func (c *Client) Add(a Alert) error

Add adds new alert to stack

func (*Client) Send

func (c *Client) Send() error

Send sends alerts data to Bernhard service

Jump to

Keyboard shortcuts

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