cli

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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"`
	// contains filtered or unexported fields
}

Config contains the configuration

func BuildFromFile

func BuildFromFile(filename string, logger core.Logger) (*Config, error)

BuildFromFile builds a scheduler using the config from a file

func BuildFromString

func BuildFromString(config string, logger core.Logger) (*Config, error)

BuildFromString builds a scheduler using the config from a string

func NewConfig

func NewConfig(logger core.Logger) *Config

func (*Config) InitializeApp

func (c *Config) InitializeApp() error

Call this only once at app init

type DaemonCommand

type DaemonCommand struct {
	ConfigFile string `long:"config" description:"configuration file" default:"/etc/chadburn.conf"`

	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() *docker.Client

TODO: Implement an interface so the code does not have to use third parties directly

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"`
}

ExecJobConfig contains all configuration params needed to build a ExecJob

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"`
}

LocalJobConfig contains all configuration params needed to build a RunJob

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"`
}

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

Jump to

Keyboard shortcuts

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