func New(addrs []string, options *store.Config) (store.Store, error) {
	s := &Etcd{}
	var (
		entries []string
		err     error
	)
	entries = store.CreateEndpoints(addrs, "http")
	cfg := &etcd.Config{
		Endpoints:               entries,
		Transport:               etcd.DefaultTransport,
		HeaderTimeoutPerRequest: 3 * time.Second,
	}
	if options != nil {
		if options.TLS != nil {
			setTLS(cfg, options.TLS, addrs)
		}
		if options.ConnectionTimeout != 0 {
			setTimeout(cfg, options.ConnectionTimeout)
		}
		if options.Username != "" {
			setCredentials(cfg, options.Username, options.Password)
		}
	}
	c, err := etcd.New(*cfg)
	if err != nil {
		log.Fatal(err)
	}
	s.client = etcd.NewKeysAPI(c)
	if options != nil && options.SyncPeriod != 0 {
		go func() {
			for {
				_ = c.AutoSync(context.Background(), options.SyncPeriod)
			}
		}()
	}
	return s, nil
}
New creates a new Etcd client given a list
of endpoints and an optional tls config
package etcd
import (
	"context"
	"crypto/tls"
	"errors"
	"log"
	"net"
	"net/http"
	"strings"
	"sync"
	"time"
	"github.com/abronan/valkeyrie"
	"github.com/abronan/valkeyrie/store"
	etcd "go.etcd.io/etcd/client/v2"
)
const (
	lockSuffix = "___lock"
)
var (
	ErrAbortTryLock = errors.New("lock operation aborted")
)
type Etcd struct {
	client etcd.KeysAPI
}
type etcdLock struct {
	lock   sync.Mutex
	client etcd.KeysAPI
	stopLock  chan struct{}
	stopRenew chan struct{}
	mutexKey string
	writeKey string
	value    string
	last     *etcd.Response
	ttl      time.Duration
}
const (
	defaultLockTTL    = 20 * time.Second
	defaultUpdateTime = 5 * time.Second
)
func Register() {
	valkeyrie.AddStore(store.ETCD, New)
}