Esempio n. 1
0
func NewDBAccessor() *DBAccessor {
	a := &DBAccessor{}

	yamlFile, _ := helpers.GetYamlContent(FixturePath)
	err := yaml.Unmarshal(yamlFile, a)
	if err != nil {
		fmt.Println("Error parsing user fixture")
	}

	return a
}
Esempio n. 2
0
func NewConfig(kiteName string) (*KiteConfig, error) {
	config := &config{}

	yamlFile, err := helpers.GetYamlContent(CONFIG_PATH)
	if err != nil {
		return nil, err
	}

	err = yaml.Unmarshal(yamlFile, config)
	if err != nil {
		fmt.Println("Error parsing config")
		return nil, err
	}

	kiteConf, ok := config.Kites[kiteName]
	if !ok {
		fmt.Println("No such kite config", kiteName)
		return nil, err
	}

	return &kiteConf, nil
}