Documentation
¶
Index ¶
- func AcknowledgeIncident(client PagerDutyClient, incidents []pagerduty.Incident, user *pagerduty.User) ([]pagerduty.Incident, error)
- func GetAlerts(client PagerDutyClient, id string, opts pagerduty.ListIncidentAlertsOptions) ([]pagerduty.IncidentAlert, error)
- func GetIncident(client PagerDutyClient, id string) (*pagerduty.Incident, error)
- func GetIncidents(client PagerDutyClient, opts pagerduty.ListIncidentsOptions) ([]pagerduty.Incident, error)
- func GetNotes(client PagerDutyClient, id string) ([]pagerduty.IncidentNote, error)
- func GetTeamMemberIDs(client PagerDutyClient, teams []*pagerduty.Team, ...) ([]string, error)
- func GetTeams(client PagerDutyClient, teams []string) ([]*pagerduty.Team, error)
- func GetUser(client PagerDutyClient, id string, opts pagerduty.GetUserOptions) (*pagerduty.User, error)
- func GetUserOnCalls(client PagerDutyClient, id string, opts pagerduty.ListOnCallOptions) ([]pagerduty.OnCall, error)
- func NewListIncidentOptsFromDefaults() pagerduty.ListIncidentsOptions
- func PostNote(client PagerDutyClient, id string, user *pagerduty.User, content string) (*pagerduty.IncidentNote, error)
- func ReassignIncidents(client PagerDutyClient, incidents []pagerduty.Incident, user *pagerduty.User, ...) ([]pagerduty.Incident, error)
- type Config
- type PagerDutyClient
- type PagerDutyClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcknowledgeIncident ¶
func GetAlerts ¶
func GetAlerts(client PagerDutyClient, id string, opts pagerduty.ListIncidentAlertsOptions) ([]pagerduty.IncidentAlert, error)
func GetIncident ¶
func GetIncident(client PagerDutyClient, id string) (*pagerduty.Incident, error)
func GetIncidents ¶
func GetIncidents(client PagerDutyClient, opts pagerduty.ListIncidentsOptions) ([]pagerduty.Incident, error)
func GetNotes ¶
func GetNotes(client PagerDutyClient, id string) ([]pagerduty.IncidentNote, error)
func GetTeamMemberIDs ¶
func GetTeamMemberIDs(client PagerDutyClient, teams []*pagerduty.Team, opts pagerduty.ListTeamMembersOptions) ([]string, error)
func GetUser ¶
func GetUser(client PagerDutyClient, id string, opts pagerduty.GetUserOptions) (*pagerduty.User, error)
func GetUserOnCalls ¶ added in v0.0.7
func GetUserOnCalls(client PagerDutyClient, id string, opts pagerduty.ListOnCallOptions) ([]pagerduty.OnCall, error)
func NewListIncidentOptsFromDefaults ¶
func NewListIncidentOptsFromDefaults() pagerduty.ListIncidentsOptions
func PostNote ¶
func PostNote(client PagerDutyClient, id string, user *pagerduty.User, content string) (*pagerduty.IncidentNote, error)
Types ¶
type Config ¶
type Config struct {
Client PagerDutyClient
CurrentUser *pagerduty.User
// List of the users in the Teams
TeamsMemberIDs []string
Teams []*pagerduty.Team
SilentUser *pagerduty.User
IgnoredUsers []*pagerduty.User
}
Config is a struct that holds the PagerDuty client used for all the PagerDuty calls, and the config info for teams, silent user, and ignored users
type PagerDutyClient ¶
type PagerDutyClient interface {
PagerDutyClientInterface
}
PagerDutyClient implements PagerDutyClientInterface and is used by the pd package to make calls to PagerDuty This allows for mocking calls that would usually use the pagerduty.Client struct
type PagerDutyClientInterface ¶
type PagerDutyClientInterface interface {
CreateIncidentNoteWithContext(ctx context.Context, id string, note pagerduty.IncidentNote) (*pagerduty.IncidentNote, error)
GetCurrentUserWithContext(ctx context.Context, opts pagerduty.GetCurrentUserOptions) (*pagerduty.User, error)
GetIncidentWithContext(ctx context.Context, id string) (*pagerduty.Incident, error)
GetTeamWithContext(ctx context.Context, id string) (*pagerduty.Team, error)
ListMembersWithContext(ctx context.Context, id string, opts pagerduty.ListTeamMembersOptions) (*pagerduty.ListTeamMembersResponse, error)
GetUserWithContext(ctx context.Context, id string, opts pagerduty.GetUserOptions) (*pagerduty.User, error)
ListIncidentAlertsWithContext(ctx context.Context, id string, opts pagerduty.ListIncidentAlertsOptions) (*pagerduty.ListAlertsResponse, error)
ListIncidentsWithContext(ctx context.Context, opts pagerduty.ListIncidentsOptions) (*pagerduty.ListIncidentsResponse, error)
ListIncidentNotesWithContext(ctx context.Context, id string) ([]pagerduty.IncidentNote, error)
ListOnCallsWithContext(ctx context.Context, opts pagerduty.ListOnCallOptions) (*pagerduty.ListOnCallsResponse, error)
ManageIncidentsWithContext(ctx context.Context, email string, opts []pagerduty.ManageIncidentsOptions) (*pagerduty.ListIncidentsResponse, error)
}
PagerDutyClientInterface is an interface that defines the methods used by the pd package and makes it easier to mock calls to PagerDuty in tests
Click to show internal directories.
Click to hide internal directories.