summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0789351)
raw | patch | inline | side by side (parent: 0789351)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 12 May 2015 20:40:49 +0000 (22:40 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 12 May 2015 20:40:49 +0000 (22:40 +0200) |
client/client.go | patch | blob | history |
diff --git a/client/client.go b/client/client.go
index 331501909ea8378104a13c189a3123332854ecc6..cae54437a1880aa8891090d08856559eaea98773 100644 (file)
--- a/client/client.go
+++ b/client/client.go
}
fmt.Printf("%v\n", res)
+or execute queries:
+
+ q, err := client.QueryString("FETCH %s %s", client.Identifier(typ), name)
+ if err != nil {
+ // handle error
+ }
+ res, err := c.Query(q)
+ if err != nil {
+ // handle error
+ }
+
+ // res is one of the object types defined in the sysdb package.
+ switch typ {
+ case "host":
+ host := res.(*sysdb.Host)
+ // do something
+ // ...
+ }
+
Each client maintains multiple connections to a SysDB server allowing to
handle multiple requests in parallel. The SysDB server is able to handle that
easily making it a cheap approach. The low-level Dial function creates a