Documentation ¶
Index ¶
- Constants
- Variables
- func PermanentError(err error) bool
- func ResourceNotExist(err error) bool
- func WatchEndpoints(clientset kubernetes.Interface, w Watcher, stopChan <-chan struct{})
- func WatchServices(clientset kubernetes.Interface, w Watcher, stopChan <-chan struct{})
- type EndpointsReader
- type EndpointsRequest
- type EndpointsWriter
- type RequestType
- type ServiceReader
- type ServiceRequest
- type ServiceWriter
- type Watcher
Constants ¶
View Source
const ( RequestTypeAdd RequestType = iota RequestTypeUpdate RequestTypeDelete CrossClusterServiceLabelKey = "fair.com/cross-cluster" CrossClusterServiceLocalLabelValue = "follower" CrossClusterServiceRemoteLabelValue = "true" )
View Source
const ( K8Endpoints = "endpoints" K8Services = "services" )
Variables ¶
View Source
var ( CrossClusterLocalLabel = fmt.Sprintf("%s=%s", CrossClusterServiceLabelKey, CrossClusterServiceLocalLabelValue) CrossClusterRemoteLabel = fmt.Sprintf("%s=%s", CrossClusterServiceLabelKey, CrossClusterServiceRemoteLabelValue) // Ideally the local filter and the remote filter will be in a consistent format, but the watcher for the remote filter // requires an options func LocalFilter = metav1.ListOptions{ LabelSelector: CrossClusterLocalLabel, } RemoteFilter = func(options *metav1.ListOptions) { options.LabelSelector = CrossClusterRemoteLabel } RequestTypeMap = map[RequestType]string{ RequestTypeAdd: "add", RequestTypeUpdate: "update", RequestTypeDelete: "delete", } )
Functions ¶
func PermanentError ¶
func ResourceNotExist ¶
func WatchEndpoints ¶
func WatchEndpoints(clientset kubernetes.Interface, w Watcher, stopChan <-chan struct{})
WatchEndpoints watches for endpoint update and delete events
func WatchServices ¶
func WatchServices(clientset kubernetes.Interface, w Watcher, stopChan <-chan struct{})
WatchServices watches for service add, update, and delete events
Types ¶
type EndpointsReader ¶
type EndpointsReader struct {
Events chan *EndpointsRequest
}
func NewEndpointsReader ¶
func NewEndpointsReader(events chan *EndpointsRequest) *EndpointsReader
func (*EndpointsReader) Add ¶
func (e *EndpointsReader) Add(obj interface{})
func (*EndpointsReader) Delete ¶
func (e *EndpointsReader) Delete(obj interface{})
func (*EndpointsReader) Update ¶
func (e *EndpointsReader) Update(_, newObj interface{})
type EndpointsRequest ¶
type EndpointsRequest struct { Type RequestType RemoteEndpoints *v1.Endpoints LocalEndpoints *v1.Endpoints }
type EndpointsWriter ¶
type EndpointsWriter struct { Events chan *EndpointsRequest Client kubernetes.Interface }
func NewEndpointsWriter ¶
func NewEndpointsWriter(clientset kubernetes.Interface, events chan *EndpointsRequest) *EndpointsWriter
func (*EndpointsWriter) Run ¶
func (e *EndpointsWriter) Run()
type RequestType ¶
type RequestType int
type ServiceReader ¶
type ServiceReader struct {
Events chan *ServiceRequest
}
func NewServiceReader ¶
func NewServiceReader(events chan *ServiceRequest) *ServiceReader
func (*ServiceReader) Add ¶
func (s *ServiceReader) Add(obj interface{})
func (*ServiceReader) Delete ¶
func (s *ServiceReader) Delete(obj interface{})
func (*ServiceReader) Update ¶
func (s *ServiceReader) Update(_, newObj interface{})
type ServiceRequest ¶
type ServiceRequest struct { Type RequestType RemoteService *v1.Service LocalService *v1.Service }
type ServiceWriter ¶
type ServiceWriter struct { Events chan *ServiceRequest Client kubernetes.Interface }
func NewServiceWriter ¶
func NewServiceWriter(clientset kubernetes.Interface, events chan *ServiceRequest) *ServiceWriter
func (*ServiceWriter) Run ¶
func (s *ServiceWriter) Run()
Click to show internal directories.
Click to hide internal directories.