pagerduty

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pagerduty provides a simple interface to send alerts to a specific service

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a wrapper for the pagerduty client

func New

func New(opts ...ClientOptions) (*Client, error)

New returns a new Client

func (*Client) EventAction

func (c *Client) EventAction(detail *cw.EventDetails) string

EventAction returns the pagerduty action we'll take based on the Cloudwatch alarm

func (*Client) SubmitEvent

func (c *Client) SubmitEvent(routingKey string, detail *cw.EventDetails) error

SubmitEvent sends an event to PagerDuty using alarm details from cloudwatch - note: some logic here - it will change the PagerDuty action based on the current cw alarm status

type ClientOptions

type ClientOptions func(*Client)

ClientOptions provides the method to configure the new client

func WithPDAPIClient

func WithPDAPIClient(pd PDAPIClientInterface) ClientOptions

WithPDAPIClient allows overriding the pdapi client

type PDAPIClientInterface

type PDAPIClientInterface interface {
	ManageEvent(pdapi.V2Event) (*pdapi.V2EventResponse, error)
}

PDAPIClientInterface is an interface for the purpose of overriding the pagerduty client behaviour

Jump to

Keyboard shortcuts

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