func NewController(
	clusterName string,
	getter v1.EndpointsGetter,
	informer coreinformers.EndpointsInformer,
	sync func(context.Context, *corev1.Endpoints) error,
	delete func(context.Context, string, string) error,
) *Controller {
	logger := klogr.New().WithName("EndpointsController")
	c := &Controller{
		clusterName:     clusterName,
		log:             logger,
		getter:          getter,
		lister:          informer.Lister(),
		listerSynced:    informer.Informer().HasSynced,
		queue:           queue.NewNamedRateLimitingQueue(queue.DefaultControllerRateLimiter(), "endpoints"),
		syncEndpoints:   sync,
		deleteEndpoints: delete,
	}
	informer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{
		AddFunc:    c.add,
		UpdateFunc: c.update,
		DeleteFunc: c.delete,
	})
	return c
}
NewController creates a new endpoints controller
package endpoints
import (
	"context"
	"fmt"
	"reflect"
	"time"
	"github.com/aeraki-framework/aeraki/lazyxds/pkg/utils/log"
	"github.com/go-logr/logr"
	corev1 "k8s.io/api/core/v1"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	utilruntime "k8s.io/apimachinery/pkg/util/runtime"
	"k8s.io/apimachinery/pkg/util/wait"
	coreinformers "k8s.io/client-go/informers/core/v1"
	"k8s.io/client-go/kubernetes/typed/core/v1"
	corelisters "k8s.io/client-go/listers/core/v1"
	"k8s.io/client-go/tools/cache"
	queue "k8s.io/client-go/util/workqueue"
	"k8s.io/klog/v2/klogr"
)
type Controller struct {
	clusterName     string
	log             logr.Logger
	getter          v1.EndpointsGetter
	lister          corelisters.EndpointsLister
	listerSynced    cache.InformerSynced
	queue           queue.RateLimitingInterface
	syncEndpoints   func(context.Context, *corev1.Endpoints) error
	deleteEndpoints func(context.Context, string, string) error
}