pagerduty

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Action    string
	Service   string
	Severity  string
	Summary   string
	Source    string
	Component string
	Group     string
	Class     string
	Details   string
	DedupKey  string
}

Event contains the required and optional fields to sent an event

type Logger added in v0.0.4

type Logger interface {
	Debug(...interface{})
	Warn(...interface{})
	Fatal(...interface{})
}

type Pagerduty

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

Pagerduty is the main object

func New

func New(apiKey string, log Logger) *Pagerduty

New returns a new Pagerduty "instance"

func (*Pagerduty) GetServices added in v0.0.3

func (p *Pagerduty) GetServices() ([]string, error)

GetServices returns a list of all services names within the Pagerduty account

func (*Pagerduty) SendEvent

func (p *Pagerduty) SendEvent(e *Event) error

SendEvent sends the provided Event to Pagerduty. It automatically detects and sets the hostname as the `source`, if not set.

Jump to

Keyboard shortcuts

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