func multiDecompose(sources []client.HTTPClient) (interface{}, error) {
	ksmCache := &multiCache{}
	for _, source := range sources {
		ksm := source.(*ksm)
		ksmCache.Endpoints = append(ksmCache.Endpoints, ksm.endpoint)
		if ksmCache.NodeIP == "" {
			ksmCache.NodeIP = ksm.nodeIP
		}
	}
	return ksmCache, nil
}
multiDecompose implements the MultiDecomposer function signature
package client
import (
	"net/http"
	"net/url"
	"time"
	"github.com/newrelic/nri-kubernetes/v2/src/client"
)
const cachedKey = "ksm-client"
type cache struct {
	Endpoint url.URL
	NodeIP   string
}
func compose(source interface{}, cacher *client.DiscoveryCacher, timeout time.Duration) (client.HTTPClient, error) {
	cached := source.(*cache)
	return &ksm{
		nodeIP:   cached.NodeIP,
		endpoint: cached.Endpoint,
		httpClient: &http.Client{
			Timeout: timeout,
		},
		logger: cacher.Logger,
	}, nil
}
func decompose(source client.HTTPClient) (interface{}, error) {
	ksm := source.(*ksm)
	return &cache{
		Endpoint: ksm.endpoint,
		NodeIP:   ksm.nodeIP,
	}, nil
}
func NewDiscoveryCacher(discoverer client.Discoverer, config client.DiscoveryCacherConfig) client.Discoverer {
	return &client.DiscoveryCacher{
		DiscoveryCacherConfig: config,
		CachedDataPtr:         &cache{},
		StorageKey:            cachedKey,
		Discoverer:            discoverer,
		Compose:               compose,
		Decompose:             decompose,
	}
}
type multiCache struct {
	Endpoints []url.URL
	NodeIP    string
}
func multiCompose(source interface{}, cacher *client.MultiDiscoveryCacher, timeout time.Duration) ([]client.HTTPClient, error) {
	cached := source.(*multiCache)
	var ksmClients []client.HTTPClient
	for _, endpoint := range cached.Endpoints {
		ksmClient := &ksm{
			nodeIP:   cached.NodeIP,
			endpoint: endpoint,
			httpClient: &http.Client{
				Timeout: timeout,
			},
			logger: cacher.Logger,
		}
		ksmClients = append(ksmClients, ksmClient)
	}
	return ksmClients, nil
}