Codebase list golang-github-go-kit-kit / 577aab1
Do not export what is not needed to be exported Olivier Bregeras 8 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2121 }
2222
2323 type client struct {
24 etcd.KeysAPI
25 Ctx context.Context
24 keysAPI etcd.KeysAPI
25 ctx context.Context
2626 }
2727
2828 type ClientOptions struct {
105105
106106 // GetEntries implements the etcd Client interface.
107107 func (c *client) GetEntries(key string) ([]string, error) {
108 resp, err := c.Get(c.Ctx, key, &etcd.GetOptions{Recursive: true})
108 resp, err := c.keysAPI.Get(c.ctx, key, &etcd.GetOptions{Recursive: true})
109109 if err != nil {
110110 return nil, err
111111 }
119119
120120 // WatchPrefix implements the etcd Client interface.
121121 func (c *client) WatchPrefix(prefix string, responseChan chan *etcd.Response) {
122 watch := c.Watcher(prefix, &etcd.WatcherOptions{AfterIndex: 0, Recursive: true})
122 watch := c.keysAPI.Watcher(prefix, &etcd.WatcherOptions{AfterIndex: 0, Recursive: true})
123123 for {
124 res, err := watch.Next(c.Ctx)
124 res, err := watch.Next(c.ctx)
125125 if err != nil {
126126 return
127127 }