config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoader added in v0.2.0

func NewLoader() *configLoader

NewLoader returns a new config loader that is able to locate and load configuration from a config file

Types

type CommandDefinition

type CommandDefinition struct {
	RequireEnvVars  *bool
	IsTemplate      *bool
	Template        *string
	EntryPoint      *string
	Command         *string
	Name            *string
	UniqueNames     *bool
	Image           *string
	Network         *string
	IsInteractive   *bool
	Volumes         *[]string
	EnvVars         *[]string
	Ports           *[]string
	AddGroups       *bool
	Impersonate     *bool
	WorkDir         *string
	RemoveContainer *bool
	ReplaceArgs     *[][]string
	AdditionalArgs  *[]string
}

CommandDefinition gives public access to the fields by accessor functions

func (*CommandDefinition) GetAddGroups

func (c *CommandDefinition) GetAddGroups() (bool, bool)

GetAddGroups returns value of IsInteractive and an boolean indicating if value is set.

func (*CommandDefinition) GetAdditionalArgs added in v0.2.0

func (c *CommandDefinition) GetAdditionalArgs() ([]string, bool)

GetAdditionalArgs returns value of AdditionalArgs and an boolean indicating if value is set.

func (*CommandDefinition) GetCommand added in v0.2.0

func (c *CommandDefinition) GetCommand() (string, bool)

GetCommand returns value of Command (CMD) and an boolean indicating if value is set.

func (*CommandDefinition) GetEntryPoint

func (c *CommandDefinition) GetEntryPoint() (string, bool)

GetEntryPoint returns entrypoint and an boolean indicating if value is set.

func (*CommandDefinition) GetEnvVars

func (c *CommandDefinition) GetEnvVars() ([]string, bool)

GetEnvVars returns value of EnvVars and an boolean indicating if value is set.

func (*CommandDefinition) GetImage

func (c *CommandDefinition) GetImage() (string, bool)

GetImage returns value of Image and an boolean indicating if value is set.

func (*CommandDefinition) GetImpersonate

func (c *CommandDefinition) GetImpersonate() (bool, bool)

GetImpersonate returns value of Impersonate and an boolean indicating if value is set.

func (*CommandDefinition) GetIsInteractive

func (c *CommandDefinition) GetIsInteractive() (bool, bool)

GetIsInteractive returns value of IsInteractive and an boolean indicating if value is set.

func (*CommandDefinition) GetIsTemplate

func (c *CommandDefinition) GetIsTemplate() (bool, bool)

GetIsTemplate returns value of IsTemplate and an boolean indicating if value is set.

func (*CommandDefinition) GetName

func (c *CommandDefinition) GetName() (string, bool)

GetName returns value of Name and an boolean indicating if value is set.

func (*CommandDefinition) GetNetwork

func (c *CommandDefinition) GetNetwork() (string, bool)

GetNetwork returns value of Network and an boolean indicating if value is set.

func (*CommandDefinition) GetPorts

func (c *CommandDefinition) GetPorts() ([]string, bool)

GetPorts returns value of Ports and an boolean indicating if value is set.

func (*CommandDefinition) GetRemoveContainer

func (c *CommandDefinition) GetRemoveContainer() (bool, bool)

GetRemoveContainer returns value of RemoveContainer and an boolean indicating if value is set.

func (*CommandDefinition) GetReplaceArgs added in v0.2.0

func (c *CommandDefinition) GetReplaceArgs() ([][]string, bool)

GetReplaceArgs returns value of ReplaceArgs and an boolean indicating if value is set.

func (*CommandDefinition) GetRequireEnvVars added in v0.2.0

func (c *CommandDefinition) GetRequireEnvVars() (bool, bool)

GetRequireEnvVars returns value of RequireEnvVars and an boolean indicating if value is set.

func (*CommandDefinition) GetTemplate

func (c *CommandDefinition) GetTemplate() (string, bool)

GetTemplate returns value of Template and an boolean indicating if value is set.

func (*CommandDefinition) GetUniqueNames added in v0.2.0

func (c *CommandDefinition) GetUniqueNames() (bool, bool)

GetUniqueNames returns value of UniqueNames and an boolean indicating if value is set.

func (*CommandDefinition) GetVolumes

func (c *CommandDefinition) GetVolumes() ([]string, bool)

GetVolumes returns value of Volumes and an boolean indicating if value is set.

func (*CommandDefinition) GetWorkDir

func (c *CommandDefinition) GetWorkDir() (string, bool)

GetWorkDir returns value of Impersonate and an boolean indicating if value is set.

func (*CommandDefinition) HasName

func (c *CommandDefinition) HasName() bool

HasName indicates if the command definition has Name

func (*CommandDefinition) HasTemplate

func (c *CommandDefinition) HasTemplate() bool

HasTemplate indicates if the command definition has a template set

type Configuration

type Configuration ConfigurationDefinition

Configuration is the data model for a configuration file

func Parse

func Parse(filepath string) (*Configuration, error)

Parse parses a toml configuration file into Configuration data model

func (*Configuration) FindCommandByName

func (c *Configuration) FindCommandByName(commandName string) (*CommandDefinition, error)

FindCommandByName finds a command by the given name

func (*Configuration) GetConfigurationFilePath

func (c *Configuration) GetConfigurationFilePath() string

GetConfigurationFilePath returns the path the configuration was load from. this is for debugging purpose.

func (*Configuration) SetConfigurationFilePath

func (c *Configuration) SetConfigurationFilePath(configFilePath string)

SetConfigurationFilePath sets the filepath the configuration was load from. this is for debugging purpose.

type ConfigurationDefinition

type ConfigurationDefinition struct {
	Command []CommandDefinition
	Version string

	Logging bool
	// contains filtered or unexported fields
}

ConfigurationDefinition defines the fields/types of the configuration file

Jump to

Keyboard shortcuts

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