Documentation ¶
Index ¶
- type CleansedDetailConfig
- type CleansedYamlConfig
- type DetailConfig
- type YamlConfig
- func (yc *YamlConfig) AddConfig(name string, rawName string)
- func (yc *YamlConfig) GetConfigFileName(configId string) string
- func (yc *YamlConfig) ReadYamlFile(fs afero.Fs, configSubPath string, apiId string) error
- func (yc *YamlConfig) UpdateConfig(entityId string, entityName string, configId string, isNonUniqueNameApi bool, ...)
- func (yc *YamlConfig) WriteYamlFile(fs afero.Fs, path string, name string) error
- type YamlCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleansedDetailConfig ¶ added in v1.8.0
type CleansedDetailConfig struct {
Name string `yaml:"name"`
}
CleansedDetailConfig sets the default properties to be set replace in each json file
type CleansedYamlConfig ¶ added in v1.8.0
type CleansedYamlConfig struct { Config []map[string]string `yaml:"config"` Detail map[string][]CleansedDetailConfig `yaml:",inline"` }
CleansedYamlConfig defines the structure for the config file for each API
type DetailConfig ¶
type DetailConfig struct { Name string `yaml:"name"` Id string `yaml:"id"` ConfigFileName string `yaml:"configFileName"` IsDownloaded bool `yaml:"isDownloaded"` }
DetailConfig contains name and meta data for each API and entity
type YamlConfig ¶
type YamlConfig struct { Config []map[string]string Detail map[string][]DetailConfig EnvironmentName string // contains filtered or unexported fields }
YamlConfig defines the structure for the config file for each API including meta data
func NewYamlConfig ¶
func NewYamlConfig(environmentName string) *YamlConfig
NewYamlConfig return a new yaml struct with Config and Detail as fields
func (*YamlConfig) AddConfig ¶
func (yc *YamlConfig) AddConfig(name string, rawName string)
AddConfig allows to add new configs to the yaml file
func (*YamlConfig) GetConfigFileName ¶ added in v1.8.0
func (yc *YamlConfig) GetConfigFileName(configId string) string
func (*YamlConfig) ReadYamlFile ¶ added in v1.8.0
ReadYamlFile reads an potentially existing config yaml
func (*YamlConfig) UpdateConfig ¶ added in v1.8.0
func (yc *YamlConfig) UpdateConfig(entityId string, entityName string, configId string, isNonUniqueNameApi bool, jsonFileName string)
UpdateConfig allows updating configs in the yaml file
func (*YamlConfig) WriteYamlFile ¶ added in v1.8.0
WriteYamlFile transforms the struct into a physical file on disk
type YamlCreator ¶
type YamlCreator interface { ReadYamlFile(fs afero.Fs, configSubPath string, apiId string) error WriteYamlFile(fs afero.Fs, path string, name string) error AddConfig(name string, rawName string) UpdateConfig(entityId string, entityName string, configId string, isNonUniqueNameApi bool, jsonFileName string) GetConfigFileName(configId string) string }
YamlCreator implements method to create the yaml configuration file