Documentation
¶
Index ¶
- func PostInfoMessage(c *slackclient.Client, j SyncJob) error
- type ObjectSyncType
- type PagerdutyScheduleToSlackJob
- func (s *PagerdutyScheduleToSlackJob) Dryrun() bool
- func (s *PagerdutyScheduleToSlackJob) Error() error
- func (s *PagerdutyScheduleToSlackJob) Icon() string
- func (s *PagerdutyScheduleToSlackJob) JobType() string
- func (s *PagerdutyScheduleToSlackJob) Name() string
- func (s *PagerdutyScheduleToSlackJob) NextRun() time.Time
- func (s *PagerdutyScheduleToSlackJob) PagerDutyObjects() []pagerduty.APIObject
- func (s *PagerdutyScheduleToSlackJob) Run() error
- func (s *PagerdutyScheduleToSlackJob) SlackHandle() string
- func (s *PagerdutyScheduleToSlackJob) SlackInfoMessageBody() *slack.TextBlockObject
- type PagerdutyTeamToSlackJob
- func (t *PagerdutyTeamToSlackJob) Dryrun() bool
- func (t *PagerdutyTeamToSlackJob) Error() error
- func (t *PagerdutyTeamToSlackJob) Icon() string
- func (t *PagerdutyTeamToSlackJob) JobType() string
- func (t *PagerdutyTeamToSlackJob) Name() string
- func (t *PagerdutyTeamToSlackJob) NextRun() time.Time
- func (t *PagerdutyTeamToSlackJob) PagerDutyObjects() []pagerduty.APIObject
- func (t *PagerdutyTeamToSlackJob) Run() error
- func (t *PagerdutyTeamToSlackJob) SlackHandle() string
- func (t *PagerdutyTeamToSlackJob) SlackInfoMessageBody() *slack.TextBlockObject
- type SyncJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostInfoMessage ¶
func PostInfoMessage(c *slackclient.Client, j SyncJob) error
PostInfoMessage posts a message to slack with the current sync state of the job
Types ¶
type ObjectSyncType ¶
type ObjectSyncType string
ObjectSyncType
const ( PdScheduleSync ObjectSyncType = "PD Schedule" PdTeamSync ObjectSyncType = "PD Team" )
type PagerdutyScheduleToSlackJob ¶
type PagerdutyScheduleToSlackJob struct {
// contains filtered or unexported fields
}
func NewScheduleSyncJob ¶
func NewScheduleSyncJob(cfg config.PagerdutyScheduleOnDutyToSlackGroup, dryrun bool, pd *pagerdutyclient.Client, slackClient *slackclient.Client) (*PagerdutyScheduleToSlackJob, error)
NewSchedulesSyncJob creates a new job to sync members of pagerduty schedules to a slack user group
func (*PagerdutyScheduleToSlackJob) Dryrun ¶
func (s *PagerdutyScheduleToSlackJob) Dryrun() bool
Dryrun is true when the job is not performing changes
func (*PagerdutyScheduleToSlackJob) Error ¶
func (s *PagerdutyScheduleToSlackJob) Error() error
Error if any occurred during the sync
func (*PagerdutyScheduleToSlackJob) Icon ¶
func (s *PagerdutyScheduleToSlackJob) Icon() string
Icon returns name of icon to show in Slack messages
func (*PagerdutyScheduleToSlackJob) JobType ¶
func (s *PagerdutyScheduleToSlackJob) JobType() string
JobType as string
func (*PagerdutyScheduleToSlackJob) Name ¶
func (s *PagerdutyScheduleToSlackJob) Name() string
Name of the job
func (*PagerdutyScheduleToSlackJob) NextRun ¶
func (s *PagerdutyScheduleToSlackJob) NextRun() time.Time
NextRun returns the time from now when the cron is next executed
func (*PagerdutyScheduleToSlackJob) PagerDutyObjects ¶
func (s *PagerdutyScheduleToSlackJob) PagerDutyObjects() []pagerduty.APIObject
PagerDutyObjects returns the pagerduty schedule/teams synced
func (*PagerdutyScheduleToSlackJob) Run ¶
func (s *PagerdutyScheduleToSlackJob) Run() error
Run syncs pagerduty schedule members to slack user group
func (*PagerdutyScheduleToSlackJob) SlackHandle ¶
func (s *PagerdutyScheduleToSlackJob) SlackHandle() string
SlackHandle of the slack user group
func (*PagerdutyScheduleToSlackJob) SlackInfoMessageBody ¶
func (s *PagerdutyScheduleToSlackJob) SlackInfoMessageBody() *slack.TextBlockObject
SlackInfoMessageBody returns TexBlock with the pagerduty users on shift
type PagerdutyTeamToSlackJob ¶
type PagerdutyTeamToSlackJob struct {
// contains filtered or unexported fields
}
func NewTeamSyncJob ¶
func NewTeamSyncJob(cfg config.PagerdutyTeamToSlackGroup, dryrun bool, pd *pagerdutyclient.Client, slackClient *slackclient.Client) (*PagerdutyTeamToSlackJob, error)
NewSchedulesSyncJob creates a new job to sync members of pagerduty teams to a slack user group
func (*PagerdutyTeamToSlackJob) Dryrun ¶
func (t *PagerdutyTeamToSlackJob) Dryrun() bool
Dryrun is true when the job is not performing changes
func (*PagerdutyTeamToSlackJob) Error ¶
func (t *PagerdutyTeamToSlackJob) Error() error
Error if any occurred during the sync
func (*PagerdutyTeamToSlackJob) Icon ¶
func (t *PagerdutyTeamToSlackJob) Icon() string
Icon returns name of icon to show in Slack messages
func (*PagerdutyTeamToSlackJob) JobType ¶
func (t *PagerdutyTeamToSlackJob) JobType() string
JobType as string
func (*PagerdutyTeamToSlackJob) Name ¶
func (t *PagerdutyTeamToSlackJob) Name() string
Name of the job
func (*PagerdutyTeamToSlackJob) NextRun ¶
func (t *PagerdutyTeamToSlackJob) NextRun() time.Time
NextRun returns the time from now when the cron is next executed
func (*PagerdutyTeamToSlackJob) PagerDutyObjects ¶
func (t *PagerdutyTeamToSlackJob) PagerDutyObjects() []pagerduty.APIObject
PagerDutyObjects returns the pagerduty team(s) synced
func (*PagerdutyTeamToSlackJob) Run ¶
func (t *PagerdutyTeamToSlackJob) Run() error
Run syncs pagerduty team(s) members to slack user group
func (*PagerdutyTeamToSlackJob) SlackHandle ¶
func (t *PagerdutyTeamToSlackJob) SlackHandle() string
SlackHandle of the slack user group
func (*PagerdutyTeamToSlackJob) SlackInfoMessageBody ¶
func (t *PagerdutyTeamToSlackJob) SlackInfoMessageBody() *slack.TextBlockObject
SlackInfoMessageBody returns TextBlock describing the number of users on shift
type SyncJob ¶
type SyncJob interface { // Name of the job Name() string // Icon returns name of icon to show in Slack messages Icon() string // JobType as string JobType() string // SlackHandle of the slack user group SlackHandle() string // PagerDutyObjects returns the pagerduty schedule/teams synced PagerDutyObjects() []pagerduty.APIObject // SlackInfoMessageBody custom to the Job SlackInfoMessageBody() *slack.TextBlockObject // Dryrun is true when the job is not performing changes Dryrun() bool // NextRun returns the time from now when the cron is next executed NextRun() time.Time // Error if any occurred during the sync Error() error }