Documentation

Overview

    Package contour contains the translation business logic that listens to Kubernetes ResourceEventHandler events and translates those into additions/deletions in caches connected to the Envoy xDS gRPC API server.

    Package contour contains the translation business logic that listens to Kubernetes ResourceEventHandler events and translates those into additions/deletions in caches connected to the Envoy xDS gRPC API server.

    Index

    Examples

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type Cond

    type Cond struct {
    	// contains filtered or unexported fields
    }

      Cond implements a condition variable, a rendezvous point for goroutines waiting for or announcing the ocurence of an event.

      Unlike sync.Cond, Cond communciates with waiters via channels registered by the waiters. This permits goroutines to wait on Cond events using select.

      Example
      Output:
      
      

      func (*Cond) Notify

      func (c *Cond) Notify(hints ...string)

        Notify notifies all interested waiters that an event has ocured.

        func (*Cond) Register

        func (c *Cond) Register(ch chan int, last int, hints ...string)

          Register registers ch to receive a value when Notify is called. The value of last is the count of the times Notify has been called on this Cond. It functions of a sequence counter, if the value of last supplied to Register is less than the Conds internal counter, then the caller has missed at least one notification and will fire immediately.

          Sends by the broadcaster to ch must not block, therefore ch must have a capacity of at least 1.

          type EventHandler

          type EventHandler struct {
          	Builder  dag.Builder
          	Observer dag.Observer
          
          	HoldoffDelay, HoldoffMaxDelay time.Duration
          
          	StatusUpdater k8s.StatusUpdater
          
          	logrus.FieldLogger
          
          	// IsLeader will become ready to read when this EventHandler becomes
          	// the leader. If IsLeader is not readable, or nil, status events will
          	// be suppressed.
          	IsLeader chan struct{}
          
          	// Sequence is a channel that receives a incrementing sequence number
          	// for each update processed. The updates may be processed immediately, or
          	// delayed by a holdoff timer. In each case a non blocking send to Sequence
          	// will be made once the resource update is received (note
          	// that the DAG is not guaranteed to be called each time).
          	Sequence chan int
          	// contains filtered or unexported fields
          }

            EventHandler implements cache.ResourceEventHandler, filters k8s events towards a dag.Builder and calls through to the Observer to notify it that a new DAG is available.

            func (*EventHandler) OnAdd

            func (e *EventHandler) OnAdd(obj interface{})

            func (*EventHandler) OnDelete

            func (e *EventHandler) OnDelete(obj interface{})

            func (*EventHandler) OnUpdate

            func (e *EventHandler) OnUpdate(oldObj, newObj interface{})

            func (*EventHandler) Start

            func (e *EventHandler) Start() func(<-chan struct{}) error

              Start initializes the EventHandler and returns a function suitable for registration with a workgroup.Group.

              func (*EventHandler) UpdateNow

              func (e *EventHandler) UpdateNow()

                UpdateNow enqueues a DAG update subject to the holdoff timer.

                type EventRecorder

                type EventRecorder struct {
                	Next    cache.ResourceEventHandler
                	Counter *prometheus.CounterVec
                }

                  EventRecorder records the count and kind of events forwarded to another ResourceEventHandler.

                  func (*EventRecorder) OnAdd

                  func (e *EventRecorder) OnAdd(obj interface{})

                  func (*EventRecorder) OnDelete

                  func (e *EventRecorder) OnDelete(obj interface{})

                  func (*EventRecorder) OnUpdate

                  func (e *EventRecorder) OnUpdate(oldObj, newObj interface{})

                  type Observer

                  type Observer interface {
                  	Refresh()
                  }

                    Observer is an interface for receiving notifications.

                    func ComposeObservers

                    func ComposeObservers(observers ...Observer) Observer

                      ComposeObservers returns a new Observer that calls each of its arguments in turn.

                      type ObserverFunc

                      type ObserverFunc func()

                        ObserverFunc is a function that implements the Observer interface by calling itself. It can be nil.

                        func (ObserverFunc) Refresh

                        func (f ObserverFunc) Refresh()

                        type RebuildMetricsObserver

                        type RebuildMetricsObserver struct {
                        	// Metrics to emit.
                        	Metrics *metrics.Metrics
                        
                        	// IsLeader will become ready to read when this EventHandler becomes
                        	// the leader. If IsLeader is not readable, or nil, status events will
                        	// be suppressed.
                        	IsLeader chan struct{}
                        
                        	// NextObserver contains the stack of dag.Observers that act on DAG rebuilds.
                        	NextObserver dag.Observer
                        }

                          RebuildMetricsObserver is a dag.Observer that emits metrics for DAG rebuilds.

                          func (*RebuildMetricsObserver) OnChange

                          func (m *RebuildMetricsObserver) OnChange(d *dag.DAG)