Documentation ¶
Index ¶
- func GetAllGroupNames() []string
- func GetAllGroupsSorted() []services.ServiceOrGroup
- func GetAllServiceNames() []string
- func GetAllServicesSorted() []services.ServiceOrGroup
- func GetBasePath() string
- func GetServiceMap() map[string]*services.ServiceConfig
- func GetServiceOrGroup(name string) (services.ServiceOrGroup, error)
- func GetServicesOrGroups(names []string) ([]services.ServiceOrGroup, error)
- func InitEmptyConfig()
- func LoadSharedConfig(configPath string, edwardVersion string, logger common.Logger) 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 GetAllGroupNames ¶
func GetAllGroupNames() []string
GetAllGroupNames returns a slice of the names of all groups
func GetAllGroupsSorted ¶
func GetAllGroupsSorted() []services.ServiceOrGroup
GetAllGroupsSorted returns a slice of all groups, sorted by name
func GetAllServiceNames ¶
func GetAllServiceNames() []string
GetAllServiceNames returns a slice of the names of all services
func GetAllServicesSorted ¶
func GetAllServicesSorted() []services.ServiceOrGroup
GetAllServicesSorted returns a slice of all services, sorted by name
func GetBasePath ¶
func GetBasePath() string
GetBasePath returns the base directory for the current shared config
func GetServiceMap ¶
func GetServiceMap() map[string]*services.ServiceConfig
GetServiceMap returns the shared map of Services
func GetServiceOrGroup ¶
func GetServiceOrGroup(name string) (services.ServiceOrGroup, error)
GetServiceOrGroup returns the service/group matching the provided name
func GetServicesOrGroups ¶
func GetServicesOrGroups(names []string) ([]services.ServiceOrGroup, error)
GetServicesOrGroups returns services and groups matching any of the provided names
func InitEmptyConfig ¶
func InitEmptyConfig()
InitEmptyConfig initializes the shared maps in an empty state
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