config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExecutableGo = "go"

	ForwarderKubernetes = "kubernetes"
	ForwarderSSH        = "ssh"
)
View Source
const (
	// Filename is the name of the YAML configuration file
	Filename = "launcher.yaml"
)

Variables

View Source
var (
	// AvailableForwarders lists all ready-to-use forwarders
	AvailableForwarders = map[string]bool{
		ForwarderKubernetes: true,
		ForwarderSSH:        true,
	}
)
View Source
var (
	Filepath = fmt.Sprintf("%s/%s", os.Getenv("HOME"), Filename)
)

Functions

func CheckConfigFileExists

func CheckConfigFileExists() error

CheckConfigFileExists ensures that config file is present before going further

Types

type Application

type Application struct {
	Name       string   `yaml:"name"`
	Path       string   `yaml:"path"`
	Executable string   `yaml:"executable"`
	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"`
}

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

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