Andrea Fazzi 7 лет назад
Родитель
Сommit
5c44d0d308
2 измененных файлов с 12 добавлено и 4 удалено
  1. 2 2
      Godeps/Godeps.json
  2. 10 2
      vendor/gogs.carducci-dante.gov.it/karmen/config/config.go

+ 2 - 2
Godeps/Godeps.json

@@ -62,7 +62,7 @@
 		},
 		{
 			"ImportPath": "gogs.carducci-dante.gov.it/karmen/config",
-			"Rev": "5443db3a69c5a3f2b87ae577344fcad8038935fe"
+			"Rev": "632bbf77a42109536e520b5b80372b1ea2fad826"
 		},
 		{
 			"ImportPath": "gogs.carducci-dante.gov.it/karmen/datasource",
@@ -74,7 +74,7 @@
 		},
 		{
 			"ImportPath": "gogs.carducci-dante.gov.it/karmen/orm",
-			"Rev": "70eb34c0bbc1ab6b0523c862c39d8117601bcb20"
+			"Rev": "f3660887ce37ba6655c4c216f6325ae964082988"
 		},
 		{
 			"ImportPath": "gopkg.in/yaml.v2",

+ 10 - 2
vendor/gogs.carducci-dante.gov.it/karmen/config/config.go

@@ -77,8 +77,8 @@ func init() {
 	Config = new(ConfigT)
 }
 
-// Load loads the config file placed at the given path.
-func Load(path string, config *ConfigT) error {
+// ReadFile reads the config file placed at the given path.
+func ReadFile(path string, config *ConfigT) error {
 	cf, err := ioutil.ReadFile(path)
 	if err != nil {
 		return err
@@ -88,3 +88,11 @@ func Load(path string, config *ConfigT) error {
 	}
 	return nil
 }
+
+// Read reads the config data from the given slice.
+func Read(data []byte, config *ConfigT) error {
+	if err := yaml.Unmarshal(data, config); err != nil {
+		return err
+	}
+	return nil
+}