config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsulFactoryDataDir = "iterator::Data"
View Source
var ConsulStorageEnabled bool

Functions

func RenderConfig

func RenderConfig(config *InitConfig, ymlConfigPath string) error

Types

type Condition

type Condition struct {
	TerraformScheduling string
	NotifyOnFailure     bool
	ResolvedSignal      string
	IgnoreResolved      bool
	Labels              map[string]string
}

type Config

type Config struct {
	ListenAddr string             `yaml:"listen_address"`
	Verbose    bool               `yaml:"verbose"`
	TLSKey     string             `yaml:"tls_key"`
	TLSCrt     string             `yaml:"tls_crt"`
	Commands   []*command.Command `yaml:"commands"`
}

Config represents the configuration for this program

func ReadConfig

func ReadConfig(configFile string) (*Config, error)

readConfig reads configuration from supported means (cli flags, config file), validates parameters and returns a Config struct.

func (*Config) HasCommand

func (c *Config) HasCommand(other *command.Command) bool

HasCommand returns true if the config contains the given Command

type ConsulConfig

type ConsulConfig struct {
	Address string
}

type InitCommand

type InitCommand struct {
	Cmd                 string            `yaml:"cmd"`
	Args                []string          `yaml:"args,omitempty"`
	MatchLabels         map[string]string `yaml:"match_labels,omitempty"`
	NotifyOnFailure     bool              `yaml:"notify_on_failure"`
	ResolvedSignal      string            `yaml:"resolved_signal,omitempty"`
	IgnoreResolved      bool              `yaml:"ignore_resolved,omitempty"`
	Max                 int               `yaml:"max,omitempty"`
	TerraformScheduling string            `yaml:"terraform_scheduling,omitempty"`
}

type InitConfig

type InitConfig struct {
	Server *Server
	Tasks  []*Task
}

func LoadConfig

func LoadConfig(configPath string) (*InitConfig, error)

type Server

type Server struct {
	DataDir         string
	LogDir          string
	LogLevel        string
	Listen          string
	Address         string
	TerraformDriver string
	Consul          ConsulConfig
}

type Task

type Task struct {
	Name            string
	Description     string
	Source          string
	TerraformDriver string
	Condition       Condition
}

type YAMLConfig

type YAMLConfig struct {
	ListenAddress string        `yaml:"listen_address"`
	Verbose       bool          `yaml:"verbose"`
	TLSKey        string        `yaml:"tls_key,omitempty"`
	TLSCrt        string        `yaml:"tls_crt,omitempty"`
	Commands      []InitCommand `yaml:"commands"`
}

Jump to

Keyboard shortcuts

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