func WithConfigYaml(configPath string) CoreOpt {
	return func(c *core) error {
		configBytes, err := ioutil.ReadFile(configPath)
		if err != nil {
			return errors.Wrap(err, `failed to read config file`)
		}

		c.config = new(config.Config)

		if err = yaml.Unmarshal(configBytes, c.config); err != nil {
			return errors.Wrap(err, `failed to parse YAML`)
		}
		return nil
	}
}
// WithConfigYaml allows to pass path to YAML configuration file
WithConfigYaml allows to pass path to YAML configuration file
// WithConfigYaml allows to pass path to YAML configuration file
func WithConfigYaml(configPath string) CoreOpt {
	return func(c *core) error {
		configBytes, err := ioutil.ReadFile(configPath)
		if err != nil {
			return errors.Wrap(err, `failed to read config file`)
		}
		c.config = new(config.Config)
		if err = yaml.Unmarshal(configBytes, c.config); err != nil {
			return errors.Wrap(err, `failed to parse YAML`)
		}
		return nil
	}
}
func WithConfigYaml ( configPath string ) CoreOpt { return func ( c * core ) error { configBytes , err := ioutil . ReadFile ( configPath ) if err != nil { return errors . Wrap ( err , `failed to read config file` ) } c . config = new ( config . Config ) if err = yaml . Unmarshal ( configBytes , c . config ) ; err != nil { return errors . Wrap ( err , `failed to parse YAML` ) } return nil } }
WithConfigYaml allows to pass path to YAML configuration file
WithConfigYaml allows to pass path to YAML configuration file