func (b *Backend) Get(ctx context.Context, key string) ([]byte, error) {
	if b.cache == nil && b.prefetch {
		err := b.fetchTree(ctx)
		if err != nil {
			return nil, err
		}
	}
	if b.cache != nil {
		return b.fromCache(ctx, key)
	}
	resp, err := b.client.Get(ctx, path.Join(b.prefix, key))
	if err != nil {
		return nil, err
	}
	if len(resp.Kvs) == 0 {
		return nil, backend.ErrNotFound
	}
	return resp.Kvs[0].Value, nil
}
Get loads the given key from etcd.
package etcd
import (
	"context"
	"path"
	"strings"
	"github.com/coreos/etcd/clientv3"
	"github.com/heetch/confita/backend"
)
type Backend struct {
	client   *clientv3.Client
	prefix   string
	prefetch bool
	cache    map[string][]byte
}
func NewBackend(client *clientv3.Client, opts ...Option) *Backend {
	b := Backend{
		client: client,
	}
	for _, opt := range opts {
		opt(&b)
	}
	return &b
}