func (c *CrossCluster) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) ([]msg.Service, error) {
	fqdn := strings.ToLower(state.QName())
	cacheEntries := c.RecordsCache.Lookup(fqdn)
	if len(cacheEntries) == 0 {
		return nil, errNameNotFound
	}
	services := []msg.Service{}
	for _, cacheEntry := range cacheEntries {
		for _, address := range cacheEntry.Addresses {
			services = append(services, msg.Service{
				Host: address,
				TTL:  30,
			})
		}
	}
	return services, nil
}
Services communicates with the backend to retrieve the service definitions. Exact indicates
on exact match should be returned.
package crosscluster
import (
	"context"
	"errors"
	"strings"
	"time"
	"github.com/coredns/coredns/plugin"
	"github.com/coredns/coredns/plugin/etcd/msg"
	"github.com/coredns/coredns/request"
	"github.com/go-logr/logr"
	"github.com/miekg/dns"
	"github.com/vmware-tanzu/cross-cluster-connectivity/pkg/controllers/endpointslicedns"
)
type CrossCluster struct {
	Next plugin.Handler
	RecordsCache *endpointslicedns.DNSCache
	Zones        []string
	Log          logr.Logger
}
var errNotImplemented = errors.New("not implemented")
var errNameNotFound = errors.New("name not found")