config

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExecutableGo = "go"

	ForwarderKubernetes       = "kubernetes"
	ForwarderKubernetesRemote = "kubernetes-remote"
	ForwarderProxy            = "proxy"
	ForwarderSSH              = "ssh"
	ForwarderSSHRemote        = "ssh-remote"
)
View Source
const (
	// Filename is the name single YAML configuration file name
	Filename = "monday.yaml"
	// MultipleFilenamePattern is the name pattern for multiple YAML configuration files
	MultipleFilenamePattern = "monday*.yaml"
)

Variables

View Source
var (
	// AvailableForwarders lists all ready-to-use forwarders
	AvailableForwarders = map[string]bool{
		ForwarderKubernetes:       true,
		ForwarderKubernetesRemote: true,
		ForwarderProxy:            true,
		ForwarderSSH:              true,
		ForwarderSSHRemote:        true,
	}

	// ProxifiedForwarders lists all forwarders that will use the proxy
	ProxifiedForwarders = map[string]bool{
		ForwarderKubernetes:       true,
		ForwarderKubernetesRemote: true,
		ForwarderProxy:            true,
		ForwarderSSH:              true,
	}
)
View Source
var (

	// Filepath is the path of the YAML configuration files when you
	// just have a single config file
	Filepath string

	// MultipleFilepath is the path of the YAML configuration files when
	// you define multiple config files
	MultipleFilepath string
)

Functions

func CheckConfigFileExists

func CheckConfigFileExists() error

CheckConfigFileExists ensures that config file is present before going further

func FindMultipleConfigFiles

func FindMultipleConfigFiles() []string

FindMultipleConfigFiles finds if multiple configuration files has been created

Types

type Application

type Application struct {
	Name           string            `yaml:"name"`
	Path           string            `yaml:"path"`
	Executable     string            `yaml:"executable"`
	Args           []string          `yaml:"args"`
	StopExecutable string            `yaml:"stop_executable"`
	StopArgs       []string          `yaml:"stop_args"`
	Hostname       string            `yaml:"hostname"`
	Watch          bool              `yaml:"watch"`
	Env            map[string]string `yaml:"env"`
	Setup          []string          `yaml:"setup"`
}

Application represents application information

func (*Application) GetPath

func (a *Application) GetPath() string

GetPath returns the path dependending on overrided value or not

type Config

type Config struct {
	GoPath     string     `yaml:"gopath"`
	KubeConfig string     `yaml:"kubeconfig"`
	Projects   []*Project `yaml:"projects"`
	Watcher    *Watcher   `yaml:"watcher"`
}

Config represents the root configuration item

func Load

func Load() (*Config, error)

Load method loads the configuration from the YAML configuration file

func (*Config) GetProjectByName

func (c *Config) GetProjectByName(name string) (*Project, error)

GetProjectByName returns a project configuration from its name

func (*Config) GetProjectNames

func (c *Config) GetProjectNames() []string

GetProjectNames returns the project names as a list

type Forward

type Forward struct {
	Name   string        `yaml:"name"`
	Type   string        `yaml:"type"`
	Values ForwardValues `yaml:"values"`
}

func (*Forward) IsProxified

func (f *Forward) IsProxified() bool

IsProxified indicates if the current forward rule will use the proxy

type ForwardValues

type ForwardValues struct {
	Context       string            `yaml:"context"`
	Namespace     string            `yaml:"namespace"`
	Labels        map[string]string `yaml:"labels"`
	Hostname      string            `yaml:"hostname"`
	ProxyHostname string            `yaml:"proxy_hostname"`
	DisableProxy  bool              `yaml:"disable_proxy"`
	Ports         []string          `yaml:"ports"`
	Remote        string            `yaml:"remote"`
	Args          []string          `yaml:"args"`
}

ForwardValues represents the available values for each forward type

type Project

type Project struct {
	Name         string         `yaml:"name"`
	Applications []*Application `yaml:"local"`
	Forwards     []*Forward     `yaml:"forward"`
}

Project represents a project name, that could be a group of multiple projects

type Watcher

type Watcher struct {
	Exclude []string `yaml:"exclude"`
}

Watcher represents the configuration values for the file watcher component

Jump to

Keyboard shortcuts

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