summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkballou <kballou@devnulllabs.io>2015-04-14 16:55:12 -0600
committerkballou <kballou@devnulllabs.io>2015-04-17 15:19:50 -0600
commit7d18972112a7d940333f9ef17a5ae1383da0a57c (patch)
treecbfaca924a083ffb5b6046aa8efeb28ebcfbc9dd
parent0e17c69ad8a2dc11fb4e35f06fccc9eb861d18b6 (diff)
downloadgohadoopxml-7d18972112a7d940333f9ef17a5ae1383da0a57c.tar.gz
gohadoopxml-7d18972112a7d940333f9ef17a5ae1383da0a57c.tar.xz
Add example usage to readme
-rw-r--r--README.markdown24
1 files changed, 24 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 23563f9..f2e0be6 100644
--- a/README.markdown
+++ b/README.markdown
@@ -3,6 +3,30 @@
This simple library allows users to read and extract Hadoop configuration
properties.
+## Example Usage ##
+
+The following is an example of how to use this library:
+
+ package main
+
+ import (
+ "fmt"
+ "github.com/kennyballou/gohadoopxml"
+ "log"
+ "os"
+ )
+
+ func main() {
+ configuration, err := gohadoopxml.ParseXML(os.Args[1])
+ if err != nil {
+ log.Panic("Error occurred while parsing xml")
+ }
+
+ for _, p := range configuration.Properties {
+ fmt.Printf("%s -> %s\n", p.Name, p.Value)
+ }
+ }
+
## License ##
This code is licensed and distributed, as-is without warranty and in the hopes