Documentation
¶
Index ¶
- func PostInfoMessage(c *slackclient.Client, j *ServicenowScheduleToSlackJob) error
- type ObjectSyncType
- type ServicenowScheduleToSlackJob
- func (s *ServicenowScheduleToSlackJob) Dryrun() bool
- func (s *ServicenowScheduleToSlackJob) Error() error
- func (s *ServicenowScheduleToSlackJob) Icon() string
- func (s *ServicenowScheduleToSlackJob) JobType() string
- func (s *ServicenowScheduleToSlackJob) Name() string
- func (s *ServicenowScheduleToSlackJob) NextRun() time.Time
- func (s *ServicenowScheduleToSlackJob) Run() error
- func (s *ServicenowScheduleToSlackJob) SlackHandle() string
- type SyncJob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostInfoMessage ¶
func PostInfoMessage(c *slackclient.Client, j *ServicenowScheduleToSlackJob) error
PostInfoMessage posts a message to slack with the current sync state of the job
Types ¶
type ObjectSyncType ¶
type ObjectSyncType string
ObjectSyncType
const (
ScheduleSync ObjectSyncType = "Schedule"
)
type ServicenowScheduleToSlackJob ¶
type ServicenowScheduleToSlackJob struct {
// contains filtered or unexported fields
}
func NewScheduleSyncJob ¶
func NewScheduleSyncJob(cfg config.ScheduleSync, dryrun bool, sn *servicenow.Client, slackClient *slackclient.Client) (*ServicenowScheduleToSlackJob, error)
NewSchedulesSyncJob creates a new job to sync members of schedules to a slack user group
func (*ServicenowScheduleToSlackJob) Dryrun ¶
func (s *ServicenowScheduleToSlackJob) Dryrun() bool
Dryrun is true when the job is not performing changes
func (*ServicenowScheduleToSlackJob) Error ¶
func (s *ServicenowScheduleToSlackJob) Error() error
Error if any occurred during the sync
func (*ServicenowScheduleToSlackJob) Icon ¶
func (s *ServicenowScheduleToSlackJob) Icon() string
Icon returns name of icon to show in Slack messages
func (*ServicenowScheduleToSlackJob) JobType ¶
func (s *ServicenowScheduleToSlackJob) JobType() string
JobType as string
func (*ServicenowScheduleToSlackJob) Name ¶
func (s *ServicenowScheduleToSlackJob) Name() string
Name of the job
func (*ServicenowScheduleToSlackJob) NextRun ¶
func (s *ServicenowScheduleToSlackJob) NextRun() time.Time
NextRun returns the time from now when the cron is next executed
func (*ServicenowScheduleToSlackJob) Run ¶
func (s *ServicenowScheduleToSlackJob) Run() error
Run syncs schedule members to slack user group
func (*ServicenowScheduleToSlackJob) SlackHandle ¶
func (s *ServicenowScheduleToSlackJob) SlackHandle() string
SlackHandle of the slack user group
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
// ScheduleObjects returns the schedule/teams synced
ScheduleObjects() []config.SyncObject
// 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
}
Click to show internal directories.
Click to hide internal directories.