config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExecutableGo = "go"

	ForwarderKubernetes = "kubernetes"
	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,
		ForwarderSSH:        true,
		ForwarderSSHRemote:  true,
	}

	// ProxifiedForwarders lists all forwarders that will use the proxy
	ProxifiedForwarders = map[string]bool{
		ForwarderKubernetes: true,
		ForwarderSSH:        true,
	}
)
View Source
var (
	Filepath = fmt.Sprintf("%s/%s", homeDirectory, Filename)

	// MultipleFilepath is the path of the YAML configuration files when
	// you define multiple config files
	MultipleFilepath = fmt.Sprintf("%s/%s", homeDirectory, MultipleFilenamePattern)
)

Functions

func CheckConfigFileExists

func CheckConfigFileExists() error

CheckConfigFileExists ensures that config file is present before going further

func FindMultipleConfigFiles added in v0.0.3

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"`
	Watch      bool     `yaml:"watch"`
	Args       []string `yaml:"args"`
}

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"`
	Projects []*Project `yaml:"projects"`
}

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 added in v0.0.4

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"`
	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

Jump to

Keyboard shortcuts

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