config

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FinalLayer           = "FinalLayer"
	OverridesOnlyIfThere = "OverridesOnlyIfThere"
	AllActiveLayers      = "AllActiveLayers"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Slack          SlackConfig     `yaml:"slack"`
	Pagerduty      PagerdutyConfig `yaml:"pagerduty"`
	Global         GlobalConfig    `yaml:"global"`
	Jobs           JobsConfig      `yaml:"jobs"`
	ConfigFilePath string
}

Config we need

func NewConfig

func NewConfig(configFilePath string) (cfg Config, err error)

NewConfig reads the configuration from the given filePath.

type GlobalConfig

type GlobalConfig struct {
	// loglevel
	LogLevel string `yaml:"logLevel"`

	// write
	Write bool `yaml:"write"`

	RecheckInterval time.Duration
	// if true all task run at start
	RunAtStart bool `yaml:"runAtStart"`
}

GlobalConfig Options passed via cmd line

type JobsConfig

type JobsConfig struct {
	ScheduleSync []PagerdutyScheduleOnDutyToSlackGroup `yaml:"pd-schedules-on-duty-to-slack-group"`
	TeamSync     []PagerdutyTeamToSlackGroup           `yaml:"pd-teams-to-slack-group"`
}

JobsConfig Real Work Definition

type PagerdutyConfig

type PagerdutyConfig struct {
	// Token to authenticate
	AuthToken string
	APIUser   string
}

PagerdutyConfig Struct

type PagerdutyScheduleOnDutyToSlackGroup

type PagerdutyScheduleOnDutyToSlackGroup struct {
	CrontabExpressionForRepetition string              `yaml:"crontabExpressionForRepetition"`
	DisableHandleIfNoneOnShift     bool                `yaml:"disableSlackHandleTemporaryIfNoneOnShift"`
	CheckUserContactForPhoneSet    bool                `yaml:"informUserIfContactPhoneNumberMissing"`
	SyncOptions                    ScheduleSyncOptions `yaml:"syncOptions"`
	ObjectsToSync                  SyncObjects         `yaml:"syncObjects"`
}

PagerdutyScheduleOnDutyToSlackGroup Struct

type PagerdutyTeamToSlackGroup

type PagerdutyTeamToSlackGroup struct {
	CrontabExpressionForRepetition string      `yaml:"crontabExpressionForRepetition"`
	CheckUserContactForPhoneSet    bool        `yaml:"informUserIfContactPhoneNumberMissing"`
	ObjectsToSync                  SyncObjects `yaml:"syncObjects"`
}

PagerdutyTeamToSlackGroup Struct

type ScheduleSyncOptions

type ScheduleSyncOptions struct {
	HandoverTimeFrameForward                 string `yaml:"handoverTimeFrameForward"`
	HandoverTimeFrameBackward                string `yaml:"handoverTimeFrameBackward"`
	DisableSlackHandleTemporaryIfNoneOnShift bool   `yaml:"disableSlackHandleTemporaryIfNoneOnShift"`
	InformUserIfContactPhoneNumberMissing    bool   `yaml:"informUserIfContactPhoneNumberMissing"`
	//TakeTheLayersNotTheFinal bool `yaml:"scheduleLayerFinalOnly"`
	SyncStyle SyncStyle `yaml:"syncStyle"`
}

ScheduleSyncOptions SyncOptions Struct

type SlackConfig

type SlackConfig struct {
	// Token to authenticate
	BotSecurityToken  string
	UserSecurityToken string
	InfoChannelID     string `yaml:"infoChannelID"`
	Workspace         string `yaml:"workspaceForChatLinks"`
}

SlackConfig Struct

type SyncObjects

type SyncObjects struct {
	SlackGroupHandle   string   `yaml:"slackGroupHandle"`
	PagerdutyObjectIDs []string `yaml:"pdObjectIds"`
}

SyncObjects Struct

type SyncStyle

type SyncStyle string

SyncStyle Type of which Layer (or combination) is used

Jump to

Keyboard shortcuts

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