Documentation ¶
Index ¶
- func GetConfigPath(wd string) string
- func GetConfigPathFromWorkingDirectory() (string, error)
- type Config
- func (c *Config) AddGroups(groups []services.ServiceGroupConfig) error
- func (c *Config) AppendGroups(groups []*services.ServiceGroupConfig) error
- func (c *Config) AppendServices(newServices []*services.ServiceConfig) error
- func (c *Config) NormalizeServicePaths(searchPath string, newServices []*services.ServiceConfig) ([]*services.ServiceConfig, error)
- func (c *Config) RemoveGroup(name string) error
- func (c Config) Save(writer io.Writer) error
- type GroupDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigPath ¶
GetConfigPath identifies the location of edward.json, if any exists
Types ¶
type Config ¶
type Config struct { MinEdwardVersion string `json:"edwardVersion,omitempty"` Imports []string `json:"imports,omitempty"` ImportedGroups []GroupDef `json:"-"` ImportedServices []services.ServiceConfig `json:"-"` Env []string `json:"env,omitempty"` Groups []GroupDef `json:"groups,omitempty"` Services []services.ServiceConfig `json:"services"` ServiceMap map[string]*services.ServiceConfig `json:"-"` GroupMap map[string]*services.ServiceGroupConfig `json:"-"` Logger common.Logger `json:"-"` FilePath string `json:"-"` // contains filtered or unexported fields }
Config defines the structure for the Edward project configuration file
func EmptyConfig ¶
EmptyConfig creates a Config with no services or groups
func LoadConfig ¶
LoadConfig loads configuration from an io.Reader with the working directory explicitly specified
func NewConfig ¶
func NewConfig(newServices []services.ServiceConfig, newGroups []services.ServiceGroupConfig, logger common.Logger) Config
NewConfig creates a Config from slices of services and groups
func (*Config) AddGroups ¶
func (c *Config) AddGroups(groups []services.ServiceGroupConfig) error
AddGroups adds a slice of groups to the Config
func (*Config) AppendGroups ¶
func (c *Config) AppendGroups(groups []*services.ServiceGroupConfig) error
AppendGroups adds groups to an existing config without replacing existing groups
func (*Config) AppendServices ¶
func (c *Config) AppendServices(newServices []*services.ServiceConfig) error
AppendServices adds services to an existing config without replacing existing services
func (*Config) NormalizeServicePaths ¶
func (c *Config) NormalizeServicePaths(searchPath string, newServices []*services.ServiceConfig) ([]*services.ServiceConfig, error)
NormalizeServicePaths will modify the Paths for each of the provided services to be relative to the working directory of this config file
func (*Config) RemoveGroup ¶
type GroupDef ¶
type GroupDef struct { Name string `json:"name"` Aliases []string `json:"aliases,omitempty"` Description string `json:"description,omitempty"` Children []string `json:"children"` Env []string `json:"env,omitempty"` }
GroupDef defines a group based on a list of children specified by name