more work done

This commit is contained in:
ston1th 2021-03-06 16:51:36 +01:00
commit 6fda229a8e
23 changed files with 384 additions and 177 deletions

View file

@ -5,13 +5,16 @@ import (
"errors"
"strings"
"git.giftfish.de/ston1th/vipman/pkg/cluster"
"git.giftfish.de/ston1th/haproxy-lb/pkg/cluster"
//"go.etcd.io/etcd/clientv3"
"github.com/coreos/etcd/clientv3"
"github.com/go-logr/logr"
)
var ErrKeyNotFound = errors.New("key not found")
var (
ErrKeyNotFound = errors.New("etcd: key not found")
ErrPrefixNotFound = errors.New("etcd: prefix not found")
)
type Cluster struct {
logr.Logger
@ -59,7 +62,7 @@ func (c *Cluster) GetPrefix(k string) (m map[string][]byte, err error) {
return
}
if len(r.Kvs) == 0 {
err = ErrKeyNotFound
err = ErrPrefixNotFound
return
}
m = make(map[string][]byte)