configuration

package
v0.0.0-...-ef44a88 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ignore  = "ignore"
	AsError = "error"
	AsLog   = "log"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Execs *Executables
	Pods  *Pods
	Flows *Flows
}

func Load

func Load(logger *output.Logger, p string) (*Configuration, error)

func (*Configuration) ListExecutables

func (c *Configuration) ListExecutables() []string

func (*Configuration) ListFlows

func (c *Configuration) ListFlows() []string

func (*Configuration) ListPods

func (c *Configuration) ListPods() []string

func (*Configuration) Print

func (c *Configuration) Print(logger *output.Logger)

func (*Configuration) ValidExecutables

func (c *Configuration) ValidExecutables(execs []string) (bool, string)

func (*Configuration) ValidFlows

func (c *Configuration) ValidFlows(flows []string) (bool, string)

func (*Configuration) ValidPods

func (c *Configuration) ValidPods(pods []string) (bool, string)

type Executable

type Executable struct {
	ID          string
	Shortcut    string
	Description string
	Cmd         string
	Env         map[string]string
	Delay       string
	Watch       []string
	StdErr      string `yaml:"std_err"`
}

Executable configuration.

func NewExecutable

func NewExecutable(f string) (*Executable, error)

NewExecutable attempts to load a configuration.

func (*Executable) ToString

func (e *Executable) ToString(log *output.Logger) string

ToString convert to string.

type Executables

type Executables struct {
	Commands  map[string]*Executable
	Shortcuts map[string]*Executable
}

Executables aggregate Executable configurations.

func NewExecutableConfiguration

func NewExecutableConfiguration(log *output.Logger, p string) (*Executables, error)

NewExecutableConfiguration loads Executables configuration.

func (*Executables) Get

func (c *Executables) Get(x string) (*Executable, bool)

Get an Executable by ID or shortcut.

type Flow

type Flow struct {
	ID          string
	Shortcut    string
	Description string
	Executables []string
	Pods        []string
}

Flow is a combination of Executables and Pods

func NewFlow

func NewFlow(f string) (*Flow, error)

NewFlow attempts to load a configuration.

func (*Flow) ToString

func (f *Flow) ToString(log *output.Logger) string

ToString converts to string.

type Flows

type Flows struct {
	Flows     map[string]*Flow
	Shortcuts map[string]*Flow
}

Flows aggregate Flow configurations.

func NewFlowConfiguration

func NewFlowConfiguration(log *output.Logger, p string) (*Flows, error)

NewFlowConfiguration loads Flows configuration.

func (*Flows) Get

func (c *Flows) Get(x string) (*Flow, bool)

Get a Flow by ID or shortcut.

func (*Flows) GetExecutables

func (c *Flows) GetExecutables(x string) []string

GetExecutables get Executables from a Flow by ID or shortcut.

func (*Flows) GetPods

func (c *Flows) GetPods(x string) []string

GetPods get Pods from a Flow by ID or shortcut.

type Pod

type Pod struct {
	ID          string
	Shortcut    string
	Description string
	Service     string
	Namespace   string
	Container   string
	LocalPort   int `yaml:"localPort"`
	PodPort     int `yaml:"podPort"`
}

func NewPod

func NewPod(f string) (*Pod, error)

func (Pod) ToString

func (p Pod) ToString(log *output.Logger) string

type Pods

type Pods struct {
	Pods      map[string]*Pod
	Shortcuts map[string]*Pod
}

func NewPodConfiguration

func NewPodConfiguration(log *output.Logger, p string) (*Pods, error)

func (*Pods) Get

func (c *Pods) Get(x string) (*Pod, bool)

Jump to

Keyboard shortcuts

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