Documentation
¶
Index ¶
- Constants
- func ConfigLoaded() bool
- func DisableAllJobs()
- func EnableAllJobs()
- func EnableNonScheduledJobs()
- func EnableScheduledJobs()
- func GetAllCrons() map[string][]Job
- func GetCommandsByJobName(name string) []string
- func GetDeleteRunsAfterDays() int
- func GetJobsCron(job *Job) string
- func GetLogLevel() slog.Level
- func GetServer() string
- func New()
- func ToggleDisabledJob(name string) error
- func ValidateAndLoadConfig(v *viper.Viper) error
- type AllowedCommands
- type Env
- type GlobalConfig
- type HealthCheck
- type Job
- type JobDefaults
- type OrderedEnvs
- type ServerSettings
- type Software
- type TerminalSettings
- type Url
Constants ¶
View Source
const (
ConfigFolder = "./config/"
)
Variables ¶
This section is empty.
Functions ¶
func ConfigLoaded ¶
func ConfigLoaded() bool
func DisableAllJobs ¶
func DisableAllJobs()
func EnableAllJobs ¶
func EnableAllJobs()
func EnableNonScheduledJobs ¶
func EnableNonScheduledJobs()
func EnableScheduledJobs ¶
func EnableScheduledJobs()
func GetAllCrons ¶
func GetCommandsByJobName ¶
func GetDeleteRunsAfterDays ¶
func GetDeleteRunsAfterDays() int
func GetJobsCron ¶
func GetLogLevel ¶
func ToggleDisabledJob ¶
func ValidateAndLoadConfig ¶
Types ¶
type AllowedCommands ¶
type GlobalConfig ¶
type GlobalConfig struct {
LogLevel string `mapstructure:"log_level" validate:"omitempty,oneof=debug info warn error"`
TimeZone string `mapstructure:"time_zone" validate:"omitempty,timezone"`
DeleteRunsAfterDays int `mapstructure:"delete_runs_after_days" validate:"gte=0"`
Jobs []Job `mapstructure:"jobs" validate:"omitempty,dive"`
JobDefaults JobDefaults `mapstructure:"job_defaults"`
Healthcheck HealthCheck `mapstructure:"healthcheck" validate:"omitempty"`
Server ServerSettings `mapstructure:"server"`
Terminal TerminalSettings `mapstructure:"terminal" validate:"omitempty"`
Software []Software `mapstructure:"software" validate:"omitempty,dive"`
}
type HealthCheck ¶
type HealthCheck struct {
Authorization string `mapstructure:"authorization"`
Type string `mapstructure:"type" validate:"omitempty,oneof=HEAD GET POST"`
Start Url `mapstructure:"start" validate:"omitempty"`
End Url `mapstructure:"end" validate:"omitempty"`
Failure Url `mapstructure:"failure" validate:"omitempty"`
}
func GetHealthcheck ¶
func GetHealthcheck() HealthCheck
type Job ¶
type Job struct {
Name string `mapstructure:"name" validate:"required" json:"name"`
Cron string `mapstructure:"cron" validate:"omitempty,cron" json:"cron"`
DisableCron bool `mapstructure:"disable_cron" json:"disable_cron"`
DisableFailFast bool `mapstructure:"disable_fail_fast" json:"disable_fail_fast"`
Envs []Env `mapstructure:"envs" validate:"dive" json:"-"`
Commands []string `mapstructure:"commands" validate:"required" json:"-"`
Disabled bool `json:"disabled"`
}
func GetJobByName ¶
type JobDefaults ¶
type OrderedEnvs ¶
func GetEnvsByJobName ¶
func GetEnvsByJobName(name string) OrderedEnvs
type ServerSettings ¶
type TerminalSettings ¶
type TerminalSettings struct {
AllowAllCommands bool `mapstructure:"allow_all_commands"`
AllowedCommands map[string]AllowedCommands `mapstructure:"allowed_commands" validate:"required_if=AllowAllCommands false,dive"`
}
func GetTerminalSettings ¶
func GetTerminalSettings() TerminalSettings
func (*TerminalSettings) Hydrate ¶
func (s *TerminalSettings) Hydrate()
Click to show internal directories.
Click to hide internal directories.