doc: update readme with example

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
Noah Watkins 2014-05-26 11:14:12 -07:00
parent c4f0d8cbf2
commit 8659a52379
1 changed files with 16 additions and 0 deletions

View File

@ -10,3 +10,19 @@ The native RADOS library and development headers are expected to be installed.
Detailed documentation is available at
<http://godoc.org/github.com/noahdesu/go-rados>.
## Example
Connect to a cluster and list the pools:
```go
conn, _ := rados.NewConn()
conn.ReadDefaultConfigFile()
conn.Connect()
pools, _ := conn.ListPools()
fmt.Println(len(pools), pools)
```
will print:
3 [data metadata rbd]