pagerduty

package
v0.0.0-...-e1057c5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetIncidentsForTeam(teamID string, since time.Time) ([]Incident, error)
	GetOncallShiftsForUser(userID string, since time.Time) ([]OncallShift, error)
	WithBaseURL(url string) Client
}

Client is the interface to interact with the PD API

func New

func New(token string) Client

New returns a pagerduty client

type Incident

type Incident struct {
	Number      int
	Description string
	CreatedAt   time.Time
	ResolvedAt  time.Time
	BaseURL     string
}

Incident represents a PD incident

func ParseIncidentsCSV

func ParseIncidentsCSV(path string) ([]Incident, error)

ParseIncidentsCSV returns incidents parsed from a given path to a csv export

func (Incident) Duration

func (i Incident) Duration() string

Duration returns the format duration of the incident

func (Incident) URL

func (i Incident) URL() string

URL returns the incident URL

type OncallShift

type OncallShift struct {
	User     string
	Start    time.Time
	End      time.Time
	Schedule string
}

OncallShift represents an on-call shift

Jump to

Keyboard shortcuts

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