config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrDefault

func GetOrDefault(entity map[string]string, key string, defaultValue string) (val string)

*

  • GetOrDefault gets the value or the specified default value if not found or empty

func GetProjectDirectory

func GetProjectDirectory() string

*

  • Get the project root directory by searching for the envcli config

func GetProjectOrWorkingDirectory added in v0.4.2

func GetProjectOrWorkingDirectory() string

*

  • GetProjectOrWorkingDirectory returns either the project directory, if one can be found or the working directory

func GetPropertyConfigEntry

func GetPropertyConfigEntry(varName string) string

*

  • Gets a property in the property config

func GetWorkingDirectory

func GetWorkingDirectory() string

*

  • Get the working directory

func InArray

func InArray(val interface{}, array interface{}) (exists bool, index int)

*

  • Checks if a object is part of a array

func SavePropertyConfig

func SavePropertyConfig(cfg PropertyConfigurationFile) error

*

  • Save the global config

func SavePropertyConfigFile

func SavePropertyConfigFile(configFile string, cfg PropertyConfigurationFile) error

*

  • Save the global config file

func SetPropertyConfigEntry

func SetPropertyConfigEntry(varName string, varValue string)

*

  • Sets a property in the property config

func UnsetPropertyConfigEntry

func UnsetPropertyConfigEntry(varName string)

*

  • Gets a property in the property config

Types

type CachingEntry

type CachingEntry struct {

	/**
	 * Name of the caching entry
	 */
	Name string `yaml:"name",default:""`

	/**
	 * Directory inside of the container that should be mounted on the host within the cache directory
	 */
	ContainerDirectory string `yaml:"directory",default:""`
}

type ConfigurationLoader

type ConfigurationLoader struct {
}

*

  • ConfigurationLoader contains all methods to load/save configuration files

type ProjectConfigrationFile

type ProjectConfigrationFile struct {
	Images []RunConfigurationEntry
}

*

  • ProjectConfigrationFile is the schema for configuration files, that hold multiple command specifications

func LoadProjectConfig

func LoadProjectConfig(configFile string) (ProjectConfigrationFile, error)

*

  • Load the project config

func MergeConfigurations

func MergeConfigurations(configProject ProjectConfigrationFile, configGlobal ProjectConfigrationFile) ProjectConfigrationFile

*

  • Merge two configurations and keep the origin in the Scope

type PropertyConfigurationFile

type PropertyConfigurationFile struct {
	Properties map[string]string
}

*

  • The EnvCLI Configuration

func LoadPropertyConfig

func LoadPropertyConfig() (PropertyConfigurationFile, error)

*

  • Load the property config

func LoadPropertyConfigFile

func LoadPropertyConfigFile(configFile string) (PropertyConfigurationFile, error)

*

  • Load the property config file

type RunConfigurationEntry

type RunConfigurationEntry struct {
	// name of the container
	Name string

	// description for the  container
	Description string

	// the commands provided by the image
	Provides []string

	// container image
	Image string

	// target directory to mount your project inside of the container
	Directory string `default:"/project"`

	// overwrite the default entrypoint
	Entrypoint string `default:"original"`

	// wrap the executed command inside of the container into a shell (ex. if you use globs)
	Shell string `default:"none"`

	// commands that should run in the container before the actual command is executed
	BeforeScript []string `yaml:"before_script"`

	// allows a container to access the container runtime on the host
	ContainerRuntimeAccess bool `yaml:"containerRuntimeAccess"`

	// Caching of container-directories
	Caching []CachingEntry `yaml:"cache"`

	// the command scope (internal use only) - global or project
	Scope string
}

*

  • RunConfigurationEntry holds the configuration for a single command

func GetCommandConfiguration

func GetCommandConfiguration(commandName string, currentDirectory string) (RunConfigurationEntry, error)

*

  • GetCommandConfiguration gets the configuration entry for a specified command in the specified directory

Jump to

Keyboard shortcuts

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