ServiceBackend interface (#369)

* Add ServiceBackend interface

This adds a ServiceBackend interface that is shared between etcd/etcd3
(later) and kubernetes, leading to a massive reduction in code. When
returning the specific records from their backend.

Fixes #273
This commit is contained in:
Miek Gieben 2016-10-30 15:54:16 +00:00 committed by GitHub
parent 81d5baee28
commit 27d893cf33
15 changed files with 273 additions and 503 deletions

View file

@ -28,17 +28,16 @@ func init() {
func newEtcdMiddleware() *Etcd {
ctxt, _ = context.WithTimeout(context.Background(), etcdTimeout)
etcdCfg := etcdc.Config{
Endpoints: []string{"http://localhost:2379"},
}
cli, _ := etcdc.New(etcdCfg)
endpoints := []string{"http://localhost:2379"}
client, _ := newEtcdClient(endpoints, "", "", "")
return &Etcd{
Proxy: proxy.New([]string{"8.8.8.8:53"}),
PathPrefix: "skydns",
Ctx: context.Background(),
Inflight: &singleflight.Group{},
Zones: []string{"skydns.test.", "skydns_extra.test.", "in-addr.arpa."},
Client: etcdc.NewKeysAPI(cli),
Client: client,
}
}