Update valkeyrie to v1.0.0
This commit is contained in:
parent
d578ed7327
commit
d531963f95
18 changed files with 254 additions and 289 deletions
|
@ -12,9 +12,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-check/check"
|
||||
"github.com/kvtools/consul"
|
||||
"github.com/kvtools/valkeyrie"
|
||||
"github.com/kvtools/valkeyrie/store"
|
||||
"github.com/kvtools/valkeyrie/store/consul"
|
||||
"github.com/pmezard/go-difflib/difflib"
|
||||
"github.com/traefik/traefik/v2/integration/try"
|
||||
"github.com/traefik/traefik/v2/pkg/api"
|
||||
|
@ -35,12 +35,11 @@ func (s *ConsulSuite) setupStore(c *check.C) {
|
|||
consulAddr := net.JoinHostPort(s.getComposeServiceIP(c, "consul"), "8500")
|
||||
s.consulURL = fmt.Sprintf("http://%s", consulAddr)
|
||||
|
||||
consul.Register()
|
||||
kv, err := valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.CONSUL,
|
||||
consul.StoreName,
|
||||
[]string{consulAddr},
|
||||
&store.Config{
|
||||
&consul.Config{
|
||||
ConnectionTimeout: 10 * time.Second,
|
||||
},
|
||||
)
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-check/check"
|
||||
"github.com/kvtools/etcdv3"
|
||||
"github.com/kvtools/valkeyrie"
|
||||
"github.com/kvtools/valkeyrie/store"
|
||||
etcdv3 "github.com/kvtools/valkeyrie/store/etcd/v3"
|
||||
"github.com/pmezard/go-difflib/difflib"
|
||||
"github.com/traefik/traefik/v2/integration/try"
|
||||
"github.com/traefik/traefik/v2/pkg/api"
|
||||
|
@ -31,15 +31,13 @@ func (s *EtcdSuite) SetUpSuite(c *check.C) {
|
|||
s.createComposeProject(c, "etcd")
|
||||
s.composeUp(c)
|
||||
|
||||
etcdv3.Register()
|
||||
|
||||
var err error
|
||||
s.etcdAddr = net.JoinHostPort(s.getComposeServiceIP(c, "etcd"), "2379")
|
||||
s.kvClient, err = valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.ETCDV3,
|
||||
etcdv3.StoreName,
|
||||
[]string{s.etcdAddr},
|
||||
&store.Config{
|
||||
&etcdv3.Config{
|
||||
ConnectionTimeout: 10 * time.Second,
|
||||
},
|
||||
)
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/go-check/check"
|
||||
"github.com/kvtools/redis"
|
||||
"github.com/kvtools/valkeyrie"
|
||||
"github.com/kvtools/valkeyrie/store"
|
||||
"github.com/kvtools/valkeyrie/store/redis"
|
||||
"github.com/pmezard/go-difflib/difflib"
|
||||
"github.com/traefik/traefik/v2/integration/try"
|
||||
"github.com/traefik/traefik/v2/pkg/api"
|
||||
|
@ -32,14 +32,12 @@ func (s *RedisSuite) setupStore(c *check.C) {
|
|||
s.composeUp(c)
|
||||
|
||||
s.redisAddr = net.JoinHostPort(s.getComposeServiceIP(c, "redis"), "6379")
|
||||
redis.Register()
|
||||
|
||||
kv, err := valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.REDIS,
|
||||
redis.StoreName,
|
||||
[]string{s.redisAddr},
|
||||
&store.Config{
|
||||
ConnectionTimeout: 10 * time.Second,
|
||||
},
|
||||
&redis.Config{},
|
||||
)
|
||||
if err != nil {
|
||||
c.Fatal("Cannot create store redis")
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
"github.com/go-check/check"
|
||||
"github.com/kvtools/valkeyrie"
|
||||
"github.com/kvtools/valkeyrie/store"
|
||||
"github.com/kvtools/valkeyrie/store/zookeeper"
|
||||
"github.com/kvtools/zookeeper"
|
||||
"github.com/pmezard/go-difflib/difflib"
|
||||
"github.com/traefik/traefik/v2/integration/try"
|
||||
"github.com/traefik/traefik/v2/pkg/api"
|
||||
|
@ -31,16 +31,14 @@ func (s *ZookeeperSuite) setupStore(c *check.C) {
|
|||
s.createComposeProject(c, "zookeeper")
|
||||
s.composeUp(c)
|
||||
|
||||
zookeeper.Register()
|
||||
|
||||
s.zookeeperAddr = net.JoinHostPort(s.getComposeServiceIP(c, "zookeeper"), "2181")
|
||||
|
||||
var err error
|
||||
s.kvClient, err = valkeyrie.NewStore(
|
||||
context.Background(),
|
||||
store.ZK,
|
||||
zookeeper.StoreName,
|
||||
[]string{s.zookeeperAddr},
|
||||
&store.Config{
|
||||
&zookeeper.Config{
|
||||
ConnectionTimeout: 10 * time.Second,
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue