Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toqueteos/minietcd
:cloud: Super small and "dumb" read-only client in Go for coreos/etcd (v2).
https://github.com/toqueteos/minietcd
etcd go golang v2
Last synced: 4 days ago
JSON representation
:cloud: Super small and "dumb" read-only client in Go for coreos/etcd (v2).
- Host: GitHub
- URL: https://github.com/toqueteos/minietcd
- Owner: toqueteos
- License: mit
- Created: 2016-02-22T11:42:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T15:00:03.000Z (over 7 years ago)
- Last Synced: 2024-06-20T16:37:26.012Z (7 months ago)
- Topics: etcd, go, golang, v2
- Language: Go
- Homepage: https://godoc.org/github.com/toqueteos/minietcd
- Size: 6.84 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# minietcd [![Travis badge](https://travis-ci.org/toqueteos/minietcd.svg?branch=master)](https://travis-ci.org/toqueteos/minietcd) [![GoDoc](http://godoc.org/github.com/toqueteos/minietcd?status.png)](http://godoc.org/github.com/toqueteos/minietcd)
Super small and _"dumb"_ read-only client for [coreos/etcd](https://github.com/coreos/etcd).
Intented only for v2 protocol as of right now.
## Rationale
One of the main points of Go **was** compiler speed.
Since Go v1.5 this is not true anymore.
Now, consider CoreOS team decision to move both etcd's client and server code
into the same repository, things get even worse.minietcd's use case is simple: get keys from etcd, do it simple, do it fast (in
terms of compiling speed).I know there's a lot of stuff this library doesn't cover but it's intentional.
## Installation
Use: `go get github.com/toqueteos/minietcd`
## Example
```go
package mainimport (
"fmt"
"log"
"os""github.com/toqueteos/minietcd"
)const (
Endpoint = "127.0.0.1:4001"
Root = "foo"
)func main() {
conn := minietcd.New()
conn.SetLoggingOutput(os.Stderr) // optional, os.Stdout by defaultif err := conn.Dial(Endpoint); err != nil {
log.Fatalf("failed to connect to endpoint %q, error %q\n", Endpoint, err)
}keys, err := conn.Keys(Root)
if err != nil {
log.Fatalf("failed to get %q keys with error %q\n", Root, err)
}for k, v := range keys {
fmt.Println(k, v)
}
}
```