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 }
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 }