config

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigWorkersDefault int = 2

Functions

This section is empty.

Types

type Config

type Config struct {
	DeclaredTasks     []YamlTask  `yaml:"tasks"`
	MaxWorkers        int         `yaml:"workers"`
	Logfile           string      `yaml:"logfile"`
	Connections       Connections `yaml:"connections"`
	DefaultConnection Connection
}

func (*Config) ConfigureConnections

func (c *Config) ConfigureConnections()

func (*Config) ConfigureWorkers

func (c *Config) ConfigureWorkers()

func (Config) Tasks added in v0.6.1

func (c Config) Tasks() ([]tasks.Task, error)

type ConfigBuilder

type ConfigBuilder struct {
	// contains filtered or unexported fields
}

func NewBuilder added in v0.6.1

func NewBuilder() *ConfigBuilder

func (*ConfigBuilder) Build

func (cb *ConfigBuilder) Build() (Config, error)

func (*ConfigBuilder) FromYAML

func (cb *ConfigBuilder) FromYAML(yamlFilename string) *ConfigBuilder

func (*ConfigBuilder) WithDefaultConnection

func (cb *ConfigBuilder) WithDefaultConnection(cnx Connection) *ConfigBuilder

func (*ConfigBuilder) WithLogfile

func (cb *ConfigBuilder) WithLogfile(filename string) *ConfigBuilder

func (*ConfigBuilder) WithMaxWorkers

func (cb *ConfigBuilder) WithMaxWorkers(value int) *ConfigBuilder

func (*ConfigBuilder) WithTask

func (cb *ConfigBuilder) WithTask(task YamlTask) *ConfigBuilder

func (*ConfigBuilder) WithYAML

func (cb *ConfigBuilder) WithYAML(yamlString string) *ConfigBuilder

type Connection added in v0.6.2

type Connection struct {
	Name     string `yaml:"name"`
	URI      string `yaml:"uri"`
	Service  string `yaml:"service"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Dbname   string `yaml:"dbname"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

func (Connection) CombinedURI added in v0.6.2

func (c Connection) CombinedURI() string

type Connections added in v0.6.2

type Connections []Connection

func (Connections) GetURIByName added in v0.6.2

func (c Connections) GetURIByName(name string) (string, error)

type YamlLoader added in v0.6.1

type YamlLoader struct {
	From    string `yaml:"from"`
	Command string `yaml:"command"`
}

type YamlTask

type YamlTask struct {
	ID         int        `yaml:"id"`
	Type       string     `yaml:"type,omitempty"`
	Name       string     `yaml:"name,omitempty"`
	Command    string     `yaml:"command"`
	File       string     `yaml:"file"`
	URI        string     `yaml:"uri,omitempty"`
	Connection string     `yaml:"connection,omitempty"`
	Depends    []int      `yaml:"depends_on,omitempty"`
	Loader     YamlLoader `yaml:"loaded,omitempty"`
}

func (YamlTask) Normalize added in v0.6.1

func (t YamlTask) Normalize(cnx Connections) (tasks.Task, error)

Jump to

Keyboard shortcuts

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