mirror of https://github.com/ceph/go-ceph
doc: update readme with example
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
c4f0d8cbf2
commit
8659a52379
16
README.md
16
README.md
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue