func (s *Instance) GetAll() ([]*internal.Instance, error) {
	out := []*internal.Instance{}
	for _, instance := range s.storage {
		out = append(out, instance)
	}
	return out, nil
}
GetAll returns collection of Instance objects from storage
package memory
import (
	"github.com/pkg/errors"
	"github.com/kyma-project/helm-broker/internal"
)
func NewInstance() *Instance {
	return &Instance{
		storage: make(map[internal.InstanceID]*internal.Instance),
	}
}
type Instance struct {
	threadSafeStorage
	storage map[internal.InstanceID]*internal.Instance
}
func (s *Instance) Upsert(i *internal.Instance) (replaced bool, err error) {
	defer unlock(s.lockW())
	if i == nil {
		return false, errors.New("entity may not be nil")
	}
	if i.ID.IsZero() {
		return false, errors.New("instance id must be set")
	}
	if _, found := s.storage[i.ID]; found {
		s.storage[i.ID] = i
		return true, nil
	}
	s.storage[i.ID] = i
	return false, nil
}
func (s *Instance) Insert(i *internal.Instance) error {
	defer unlock(s.lockW())
	if i == nil {
		return errors.New("entity may not be nil")
	}
	if i.ID.IsZero() {
		return errors.New("instance id must be set")
	}
	if _, found := s.storage[i.ID]; found {
		return alreadyExistsError{}
	}
	s.storage[i.ID] = i
	return nil
}
func (s *Instance) Get(id internal.InstanceID) (*internal.Instance, error) {
	defer unlock(s.lockR())
	i, found := s.storage[id]
	if !found {
		return nil, notFoundError{}
	}
	return i, nil
}