jobs

package
v0.0.0-...-fd813fb Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

Error if any occurred during the sync

func (*ServicenowScheduleToSlackJob) Icon

Icon returns name of icon to show in Slack messages

func (*ServicenowScheduleToSlackJob) JobType

func (s *ServicenowScheduleToSlackJob) JobType() string

JobType as string

func (*ServicenowScheduleToSlackJob) Name

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

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
}

Jump to

Keyboard shortcuts

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