type EndpointsAdapter … // NewEndpointsAdapter returns a new EndpointsAdapter. func NewEndpointsAdapter(endpointClient corev1client.EndpointsGetter, endpointSliceClient discoveryclient.EndpointSlicesGetter) EndpointsAdapter { … } // Get takes the name and namespace of the Endpoints resource, and returns a // corresponding Endpoints object if it exists, and an error if there is any. func (adapter *EndpointsAdapter) Get(namespace, name string, getOpts metav1.GetOptions) (*corev1.Endpoints, error) { … } // Create accepts a namespace and Endpoints object and creates the Endpoints // object and matching EndpointSlice. The created Endpoints object or an error will be // returned. func (adapter *EndpointsAdapter) Create(namespace string, endpoints *corev1.Endpoints) (*corev1.Endpoints, error) { … } // Update accepts a namespace and Endpoints object and updates it and its // matching EndpointSlice. The updated Endpoints object or an error will be returned. func (adapter *EndpointsAdapter) Update(namespace string, endpoints *corev1.Endpoints) (*corev1.Endpoints, error) { … } // EnsureEndpointSliceFromEndpoints accepts a namespace and Endpoints resource // and creates or updates a corresponding EndpointSlice. An error will be returned // if it fails to sync the EndpointSlice. func (adapter *EndpointsAdapter) EnsureEndpointSliceFromEndpoints(namespace string, endpoints *corev1.Endpoints) error { … } // endpointSliceFromEndpoints generates an EndpointSlice from an Endpoints // resource. func endpointSliceFromEndpoints(endpoints *corev1.Endpoints) *discovery.EndpointSlice { … } // getEndpointsFromAddresses returns a list of Endpoints from addresses that // match the provided address type. func getEndpointsFromAddresses(addresses []corev1.EndpointAddress, addressType discovery.AddressType, ready bool) []discovery.Endpoint { … } // endpointFromAddress generates an Endpoint from an EndpointAddress resource. func endpointFromAddress(address corev1.EndpointAddress, ready bool) discovery.Endpoint { … } // allAddressesIPv6 returns true if all provided addresses are IPv6. func allAddressesIPv6(addresses []corev1.EndpointAddress) bool { … } // setSkipMirrorTrue sets endpointslice.kubernetes.io/skip-mirror to true. It // returns true if this has resulted in a change to the Endpoints resource. func setSkipMirrorTrue(e *corev1.Endpoints) bool { … }