pagerduty

package
v0.0.0-...-df093e9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusAcknowledged ...
	StatusAcknowledged = "acknowledged"
	// StatusTriggered ...
	StatusTriggered = "triggered"
	// TypeUserReference ...
	TypeUserReference = "user_reference"
)
View Source
const RegionAlertnameRegex = `.*\s\[(?P<region>.+?)\]\s(?P<alertname>.+?)\s\-.*`

RegionAlertnameRegex is used to find the region and alertname from an incident text

Variables

View Source
var ErrUserNotFound = errors.New("user not found")

ErrUserNotFound is the error raised when a user was not found by its mail address in Pagerduty.

Functions

This section is empty.

Types

type Client

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

Client ...

func NewClient

func NewClient(config config.Config, logger log.Logger) *Client

NewClient creates a new pagerduty client.

func (*Client) AcknowledgeIncident

func (p *Client) AcknowledgeIncident(alert *client.ExtendedAlert, userEmail string) error

AcknowledgeIncident acknowledges a currently firing incident.

func (*Client) ListParsedIncidents

func (p *Client) ListParsedIncidents() ([]*ShortPagerdutyIncident, error)

ListParsedIncidents returns a list of parsed Pagerduty incidents or an error.

type Pagerduty

type Pagerduty interface {
	AcknowledgeIncident(alert *model.Alert, userEmail string) error
}

Pagerduty ...

type ShortPagerdutyIncident

type ShortPagerdutyIncident struct {
	Name   string `json:"name"`
	Region string `json:"region"`
}

ShortPagerdutyIncident ...

Jump to

Keyboard shortcuts

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