config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_CONNECT_TIMEOUT = 20
View Source
const DEFAULT_MAX_RUN_HISTORY = 50
View Source
const DEFAULT_READ_TIMEOUT = 86400
View Source
const DEFAULT_RUN_DIR = "/var/lib/scylla"

Variables

This section is empty.

Functions

func JobDir

func JobDir() string

func PoolCacheDir

func PoolCacheDir() string

func RunDir

func RunDir() string

Types

type Config

type Config struct {
	General  General
	Web      Web
	Defaults Defaults
	Pool     map[string]*PoolSpec
	Job      map[string]*JobSpec
	Notifier map[string]*Notifier
}

func New

func New(fn string) (cfg *Config, err error)

func (*Config) Validate

func (cfg *Config) Validate() (err error)

type Defaults

type Defaults struct {
	Keyfile        string
	ConnectTimeout int    `gcfg:"connect-timeout"`
	ReadTimeout    int    `gcfg:"read-timeout"`
	SudoCommand    string `gcfg:"sudo-command"`
	User           string
	Notifier       string
	MaxRunHistory  int `gcfg:"max-run-history"`
}

type General

type General struct {
	User string
}

type JobSpec

type JobSpec struct {
	Name           string
	Command        []string
	Description    string
	Schedule       string
	ScheduleInst   sched.Sched `json:"-"`
	Keyfile        string
	Host           string
	Pool           string
	PoolMode       string
	PoolInst       *PoolSpec `json:"-"`
	DefaultUser    string
	Upload         string
	Sudo           bool
	SudoCommand    string `gcfg:"sudo-command"`
	ConnectTimeout int    `gcfg:"connect-timeout"`
	ReadTimeout    int    `gcfg:"read-timeout"`
	MaxRunHistory  int    `gcfg:"max-run-history"`
	RunOnStart     bool   `gcfg:"run-on-start"`
	FailsToNotify  int    `gcfg:"fails-to-notify"`
	Notifier       string
}

func (*JobSpec) ParseSchedule

func (job *JobSpec) ParseSchedule() error

type Notifier

type Notifier struct {
	Name        string
	Path        string
	Args        []string `gcfg:"arg"`
	EdgeTrigger bool     `gcfg:"edge-trigger"`
	Always      bool
}

type PoolSpec

type PoolSpec struct {
	Name    string
	Host    []string
	Dynamic bool
}

type Web

type Web struct {
	Listen string
}

Jump to

Keyboard shortcuts

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