summaryrefslogtreecommitdiff
path: root/gohadoopxml.go
diff options
context:
space:
mode:
Diffstat (limited to 'gohadoopxml.go')
-rw-r--r--gohadoopxml.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/gohadoopxml.go b/gohadoopxml.go
index d6d5721..336a673 100644
--- a/gohadoopxml.go
+++ b/gohadoopxml.go
@@ -2,6 +2,7 @@ package gohadoopxml
import (
"encoding/xml"
+ "errors"
"io/ioutil"
"log"
"os"
@@ -36,6 +37,15 @@ func ParseXML(filename string) (Configuration, error) {
return config, nil
}
+func GetPropertyValue(key string, config Configuration) (string, error) {
+ for _, p := range config.Properties {
+ if key == p.Name {
+ return p.Value, nil
+ }
+ }
+ return "", errors.New("Key not found")
+}
+
func MergeConfigurations(configs ...Configuration) Configuration {
var new_config Configuration
for _, config := range configs {