Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type DaemonCommand
- type DockerHandler
- type ExecJobConfig
- type LifecycleJobConfig
- type LocalJobConfig
- type OfficialDockerHandler
- func (c *OfficialDockerHandler) Close() error
- func (c *OfficialDockerHandler) GetDockerLabels() (map[string]map[string]string, error)
- func (c *OfficialDockerHandler) GetLifecycleJobs() map[string]*LifecycleJobConfig
- func (c *OfficialDockerHandler) SetLifecycleJobs(jobs map[string]*LifecycleJobConfig)
- type RunJobConfig
- type RunServiceConfig
- type ValidateCommand
Constants ¶
const (
LabelNamespace = "chadburn"
)
Variables ¶
var ErrNoContainerWithChadburnEnabled = errors.New("couldn't find containers with label 'chadburn.enabled=true'")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Global struct {
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
}
ExecJobs map[string]*ExecJobConfig `gcfg:"job-exec" mapstructure:"job-exec,squash"`
RunJobs map[string]*RunJobConfig `gcfg:"job-run" mapstructure:"job-run,squash"`
ServiceJobs map[string]*RunServiceConfig `gcfg:"job-service-run" mapstructure:"job-service-run,squash"`
LocalJobs map[string]*LocalJobConfig `gcfg:"job-local" mapstructure:"job-local,squash"`
LifecycleJobs map[string]*LifecycleJobConfig `gcfg:"job-lifecycle" mapstructure:"job-lifecycle,squash"`
// contains filtered or unexported fields
}
Config contains the configuration
func BuildFromFile ¶
BuildFromFile builds a scheduler using the config from a file
func BuildFromString ¶
BuildFromString builds a scheduler using the config from a string
func (*Config) InitializeApp ¶
Call this only once at app init
type DaemonCommand ¶
type DaemonCommand struct {
ConfigFile string `long:"config" description:"configuration file" default:"/etc/chadburn.conf"`
Metrics bool `long:"metrics" description:"Enable Prometheus compatible metrics endpoint"`
MetricsAddr string `long:"listen-address" description:"Metrics endpoint listen address." default:":8080"`
DisableDocker bool `long:"disable-docker" description:"Disable docker integration. All job kinds except 'job-local' will be ignored"`
Logger core.Logger
// contains filtered or unexported fields
}
DaemonCommand daemon process
func (*DaemonCommand) Execute ¶
func (c *DaemonCommand) Execute(args []string) error
Execute runs the daemon
type DockerHandler ¶
type DockerHandler struct {
// contains filtered or unexported fields
}
func NewDockerHandler ¶
func NewDockerHandler(notifier dockerLabelsUpdate, logger core.Logger) (*DockerHandler, error)
func (*DockerHandler) GetDockerLabels ¶
func (c *DockerHandler) GetDockerLabels() (map[string]map[string]string, error)
func (*DockerHandler) GetInternalDockerClient ¶
func (c *DockerHandler) GetInternalDockerClient() core.DockerClient
GetInternalDockerClient returns the internal Docker client
func (*DockerHandler) GetLifecycleJobs ¶ added in v1.6.0
func (c *DockerHandler) GetLifecycleJobs() map[string]*LifecycleJobConfig
GetLifecycleJobs returns the lifecycle jobs
func (*DockerHandler) SetLifecycleJobs ¶ added in v1.6.0
func (c *DockerHandler) SetLifecycleJobs(jobs map[string]*LifecycleJobConfig)
SetLifecycleJobs sets the lifecycle jobs
type ExecJobConfig ¶
type ExecJobConfig struct {
core.ExecJob `mapstructure:",squash"`
middlewares.OverlapConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
FromDockerLabel bool `mapstructure:"fromDockerLabel"`
}
ExecJobConfig contains all configuration params needed to build a ExecJob
type LifecycleJobConfig ¶ added in v1.6.0
type LifecycleJobConfig struct {
core.LifecycleJob `mapstructure:",squash"`
middlewares.OverlapConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
FromDockerLabel bool `mapstructure:"fromDockerLabel" default:"false"`
}
LifecycleJobConfig contains all configuration params needed to build a LifecycleJob
type LocalJobConfig ¶
type LocalJobConfig struct {
core.LocalJob `mapstructure:",squash"`
middlewares.OverlapConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
FromDockerLabel bool `mapstructure:"fromDockerLabel" default:"false"`
}
LocalJobConfig contains all configuration params needed to build a RunJob
type OfficialDockerHandler ¶ added in v1.7.0
type OfficialDockerHandler struct {
// contains filtered or unexported fields
}
OfficialDockerHandler is a Docker handler that uses the official Docker client
func NewOfficialDockerHandler ¶ added in v1.7.0
func NewOfficialDockerHandler(notifier dockerLabelsUpdate, logger core.Logger) (*OfficialDockerHandler, error)
NewOfficialDockerHandler creates a new Docker handler using the official Docker client
func (*OfficialDockerHandler) Close ¶ added in v1.7.0
func (c *OfficialDockerHandler) Close() error
Close closes the Docker client
func (*OfficialDockerHandler) GetDockerLabels ¶ added in v1.7.0
func (c *OfficialDockerHandler) GetDockerLabels() (map[string]map[string]string, error)
GetDockerLabels gets Docker labels from containers
func (*OfficialDockerHandler) GetLifecycleJobs ¶ added in v1.7.0
func (c *OfficialDockerHandler) GetLifecycleJobs() map[string]*LifecycleJobConfig
GetLifecycleJobs returns the lifecycle jobs
func (*OfficialDockerHandler) SetLifecycleJobs ¶ added in v1.7.0
func (c *OfficialDockerHandler) SetLifecycleJobs(jobs map[string]*LifecycleJobConfig)
SetLifecycleJobs sets the lifecycle jobs
type RunJobConfig ¶
type RunJobConfig struct {
core.RunJob `mapstructure:",squash"`
middlewares.OverlapConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
// Added for backward compatibility with tests
Pull string `default:"true"`
}
type RunServiceConfig ¶
type RunServiceConfig struct {
core.RunServiceJob `mapstructure:",squash"`
middlewares.OverlapConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.GotifyConfig `mapstructure:",squash"`
}
RunServiceConfig contains all configuration params needed to build a RunJob
type ValidateCommand ¶
type ValidateCommand struct {
ConfigFile string `long:"config" description:"configuration file" default:"/etc/chadburn.conf"`
Logger core.Logger
}
ValidateCommand validates the config file
func (*ValidateCommand) Execute ¶
func (c *ValidateCommand) Execute(args []string) error
Execute runs the validation command