func (s *Chart) Remove(namespace internal.Namespace, name internal.ChartName, ver semver.Version) error {
	nv, err := s.nameVersion(name, ver)
	if err != nil {
		return errors.Wrap(err, "while getting nameVersion from deleted entity")
	}
	resp, err := s.kv.Delete(context.TODO(), s.key(namespace, nv))
	if err != nil {
		return errors.Wrap(err, "while calling database")
	}
	switch resp.Deleted {
	case 1:
	case 0:
		return notFoundError{}
	default:
		return errors.New("more than one element matching requested id, should never happen")
	}
	return nil
}
Remove is removing chart with given name and version from storage
package etcd
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"strings"
	"github.com/Masterminds/semver"
	"github.com/pkg/errors"
	"go.etcd.io/etcd/clientv3"
	"go.etcd.io/etcd/clientv3/namespace"
	"helm.sh/helm/v3/pkg/chart"
	"github.com/kyma-project/helm-broker/internal"
)
func NewChart(cli clientv3.KV) (*Chart, error) {
	prefixParts := append(entityNamespacePrefixParts(), string(entityNamespaceChart))
	kv := namespace.NewKV(cli, strings.Join(prefixParts, entityNamespaceSeparator))
	d := &Chart{
		generic: generic{
			kv: kv,
		},
	}
	return d, nil
}
type Chart struct {
	generic
}
func (s *Chart) Upsert(namespace internal.Namespace, c *chart.Chart) (replaced bool, err error) {
	nv, err := s.nameVersionFromChart(c)
	if err != nil {
		return false, err
	}
	encoded, err := s.encodeChart(c)
	if err != nil {
		return false, errors.Wrap(err, "while encoding chart")
	}
	resp, err := s.kv.Put(context.TODO(), s.key(namespace, nv), encoded, clientv3.WithPrevKV())
	if err != nil {
		return false, errors.Wrap(err, "while calling database")
	}
	if resp.PrevKv != nil {
		return true, nil
	}
	return false, nil
}
func (s *Chart) Get(namespace internal.Namespace, name internal.ChartName, ver semver.Version) (*chart.Chart, error) {
	nv, err := s.nameVersion(name, ver)
	if err != nil {
		return nil, err
	}
	resp, err := s.kv.Get(context.TODO(), s.key(namespace, nv))
	if err != nil {
		return nil, errors.Wrap(err, "while calling database")
	}
	switch resp.Count {
	case 1:
	case 0:
		return nil, notFoundError{}
	default:
		return nil, errors.New("more than one element matching requested id, should never happen")
	}
	c, err := s.decodeChart(resp.Kvs[0].Value)
	if err != nil {
		return nil, errors.Wrap(err, "while decoding single DSO")
	}
	return c, nil
}