jobs

package
v0.0.0-...-fb28246 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

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

Error if any occurred during the sync

func (*PagerdutyScheduleToSlackJob) Icon

Icon returns name of icon to show in Slack messages

func (*PagerdutyScheduleToSlackJob) JobType

func (s *PagerdutyScheduleToSlackJob) JobType() string

JobType as string

func (*PagerdutyScheduleToSlackJob) Name

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

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

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
}

Jump to

Keyboard shortcuts

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