Documentation
¶
Index ¶
Constants ¶
View Source
const DEFAULT_DB_PATH = ".corn/corn.sqlite"
sqlite db file path, home path should be added later
View Source
const DEFAULT_LOGS_DIR = ".corn/logs"
logs dir, home path should be added later
View Source
const DEFAULT_NOTIFY_TIMEOUT = 10000
Variables ¶
View Source
var CONFIG_PATHS = []string{
".config/corn/corn.yaml",
".config/corn/corn.yml",
}
Functions ¶
func GetConfigPath ¶
Types ¶
type Config ¶
type Config struct {
DbAddr string `yaml:"dbAddr"`
Jobs map[string]Job `yaml:"jobs" validate:"required,min=1,dive"`
Remotes map[string]Remote `yaml:"remotes" validate:"dive"`
Notifiers map[string]NotifyService `yaml:"notifiers" validate:"dive"`
LogsDir string `yaml:"logsDir"`
NotifyTimeoutMs int `yaml:"notifyTimeoutMs"`
DefaultFailNotifier string `yaml:"defaultFailNotifier"`
DefaultNotifier string `yaml:"defaultNotifier"`
DefaultTimeoutS int `yaml:"defaultTimeoutS"`
DisableNotifications bool `yaml:"disableNotifications"`
Timezone string `yaml:"timezone"`
}
func ParseAndValidateConfig ¶
func ParseConfig ¶
type DiscordNotifyService ¶
type FailStrategy ¶
type FailStrategy struct {
Retry *FailStrategyRetry `yaml:"retry"`
Halt *FailStrategyHalt `yaml:"halt"`
}
type FailStrategyHalt ¶
type FailStrategyHalt struct {
}
type FailStrategyRetry ¶
type Job ¶
type Job struct {
Schedules []string `yaml:"schedules" validate:"required"`
Command string `yaml:"command" validate:"required"`
OnlyLogOnFail bool `yaml:"onlyLogOnFail"`
IgnoreStderrLog bool `yaml:"ignoreStdErrLog"`
OnlyNotifyOnFail bool `yaml:"onlyNotifyOnFail"`
FailNotifier string `yaml:"failNotifier"`
Notifier string `yaml:"notifier"`
TimeoutS int `yaml:"timeoutS"`
RemoteName string `yaml:"remoteName"`
FailStrategy *FailStrategy `yaml:"failStrategy"`
}
type NotifyService ¶
type NotifyService struct {
Telegram []TelegramNotifyService `yaml:"telegram"`
Discord []DiscordNotifyService `yaml:"discord"`
}
type PasswordAuth ¶
type PasswordAuth struct {
Password string `yaml:"password" validate:"required"`
}
type Remote ¶
type Remote struct {
Username string `yaml:"username" validate:"required,min=1"`
Address string `yaml:"address" validate:"required,min=1"`
Port uint `yaml:"port" validate:"required"`
Auth *RemoteAuth `yaml:"auth" validate:"required"`
}
type RemoteAuth ¶
type RemoteAuth struct {
PasswordAuth *PasswordAuth `yaml:"passwordAuth"`
KeyAuth *KeyAuth `yaml:"keyAuth"`
}
type TelegramNotifyService ¶
Click to show internal directories.
Click to hide internal directories.