Documentation
¶
Index ¶
Constants ¶
const JiraJqlQuery string = "project = 'OHSS' AND (status = 'To Do' OR status = 'In Progress') AND priority >= 'High'"
const JiraPressure int = 3
const PDPressure int = 3
Variables ¶
This section is empty.
Functions ¶
func FormatIncList ¶
FormatIncList pretty prints the incident list with clickable links
Types ¶
type Helper ¶
type Helper struct {
PD PDHelper
Jira JiraHelper
Slack SlackHelper
}
Helper is a class-like struct to help quickly init other needed helpers and provide a single access point to values
type JiraHelper ¶
type JiraHelper struct {
Client *jira.Client
User *jira.User
BaseUrl string
Pressure int
JqlQuery string
}
JiraHelper helps configure a client and settings needed to interact with Jira
func (*JiraHelper) AssignJiraIssue ¶
func (j *JiraHelper) AssignJiraIssue(issueKey string) error
AssignJiraIssue assigns an issues to the helpers defined user
func (*JiraHelper) CheckJiraPressure ¶
func (j *JiraHelper) CheckJiraPressure() (bool, error)
CheckJiraPressure checks the number of issues and compares it to the Pressure value. It initializes a swarm of the value is exceeded.
func (*JiraHelper) GetJiraClient ¶
func (j *JiraHelper) GetJiraClient()
GetJiraClient setups a Jira client
func (*JiraHelper) GetJiraIssues ¶
func (j *JiraHelper) GetJiraIssues() ([]string, error)
GetJiraIssues returns all issues based on the JQL query defined in the Helper
func (*JiraHelper) GetJiraUser ¶
func (j *JiraHelper) GetJiraUser(email string) error
GetJiraUser finds a Jira user using the provided user's email
type PDHelper ¶
type PDHelper struct {
Client *pagerduty.Client
User *pagerduty.User
ScheduleID string
EscalationPolicy string
BaseUrl string
Pressure int
}
PDHelper helps configure a client and settings needed to interact with PagerDuty
func (*PDHelper) AssignPDInc ¶
AssignPDInc handles assigning a PagerDuty incident to a user
func (*PDHelper) CheckPDPressure ¶
CheckPDPressure checks the number of incidents and compares it to the Pressure value. It initializes a swarm of the value is exceeded.
func (*PDHelper) GetPDClient ¶
func (p *PDHelper) GetPDClient()
GetPDClient creates a PagerDuty client for interacting with the API
func (*PDHelper) GetPrimaryOnCall ¶
GetPrimaryOnCall gets the current on-call user in PagerDuty to determining incident counts
type SlackHelper ¶
SlackHelper helps configure a client and stores data captured from Slack
func (*SlackHelper) GetSlackUserEmail ¶
func (s *SlackHelper) GetSlackUserEmail(userID string) error
GetSlackUserEmail gets the email address of a user
func (*SlackHelper) GetSlackUsername ¶
func (s *SlackHelper) GetSlackUsername(email string) error
GetSlackUsername gets the slack handle for a user by email