factory

package
v3.6.2-1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2017 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package factory contains code used to create the router controller.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventQueueTrapper

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

EventQueueTrapper is a Store implementation that catches failures in the underlying EventQueue and calls the trapper function.

func NewEventQueueTrapper

func NewEventQueueTrapper(queue *oscache.EventQueue, trapper TrapperFunc) *EventQueueTrapper

NewEventQueueTrapper returns a new EventQueueTrapper.

func (*EventQueueTrapper) Add

func (t *EventQueueTrapper) Add(obj interface{}) error

Add enqueues a watch.Added event for the given state.

func (*EventQueueTrapper) Delete

func (t *EventQueueTrapper) Delete(obj interface{}) error

Delete enqueues a watch.Delete event for the given object.

func (*EventQueueTrapper) Get

func (t *EventQueueTrapper) Get(obj interface{}) (item interface{}, exists bool, err error)

Get returns the requested item, or sets exists=false.

func (*EventQueueTrapper) GetByKey

func (t *EventQueueTrapper) GetByKey(key string) (item interface{}, exists bool, err error)

GetByKey returns the requested item, or sets exists=false.

func (*EventQueueTrapper) List

func (t *EventQueueTrapper) List() []interface{}

List returns a list of all enqueued items.

func (*EventQueueTrapper) ListConsumed

func (t *EventQueueTrapper) ListConsumed() bool

ListConsumed indicates whether the items queued by a List/Relist operation have been consumed.

func (*EventQueueTrapper) ListCount

func (t *EventQueueTrapper) ListCount() int

ListCount returns how many objects were queued by the most recent List operation.

func (*EventQueueTrapper) ListKeys

func (t *EventQueueTrapper) ListKeys() []string

ListKeys returns all enqueued keys.

func (*EventQueueTrapper) ListSuccessfulAtLeastOnce

func (t *EventQueueTrapper) ListSuccessfulAtLeastOnce() bool

ListSuccessfulAtLeastOnce indicates whether a List operation was successfully completed regardless of whether any items were queued.

func (*EventQueueTrapper) Pop

func (t *EventQueueTrapper) Pop() (watch.EventType, interface{}, error)

Pop gets the event and object at the head of the queue. If the event is a delete event, Pop deletes the key from the underlying cache.

func (*EventQueueTrapper) Replace

func (t *EventQueueTrapper) Replace(objects []interface{}, resourceVersion string) error

Replace initializes 'eq' with the state contained in the given map and populates the queue with a watch.Modified event for each of the replaced objects. The backing store takes ownership of keyToObjs; you should not reference the map again after calling this function.

func (*EventQueueTrapper) Resync

func (t *EventQueueTrapper) Resync() error

Resync will touch all objects to put them into the processing queue

func (*EventQueueTrapper) Update

func (t *EventQueueTrapper) Update(obj interface{}) error

Update enqueues a watch.Modified event for the given state.

type RouterControllerFactory

type RouterControllerFactory struct {
	KClient        kcoreclient.EndpointsGetter
	OSClient       osclient.RoutesNamespacer
	IngressClient  kextensionsclient.IngressesGetter
	SecretClient   kcoreclient.SecretsGetter
	NodeClient     kcoreclient.NodesGetter
	Namespaces     controller.NamespaceLister
	ResyncInterval time.Duration
	Namespace      string
	Labels         labels.Selector
	Fields         fields.Selector
}

RouterControllerFactory initializes and manages the watches that drive a router controller. It supports optional scoping on Namespace, Labels, and Fields of routes. If Namespace is empty, it means "all namespaces".

func NewDefaultRouterControllerFactory added in v1.0.6

func NewDefaultRouterControllerFactory(oc osclient.RoutesNamespacer, kc kclientset.Interface) *RouterControllerFactory

NewDefaultRouterControllerFactory initializes a default router controller factory.

func (*RouterControllerFactory) Create

func (factory *RouterControllerFactory) Create(plugin router.Plugin, watchNodes, enableIngress bool) *controller.RouterController

Create begins listing and watching against the API server for the desired route and endpoint resources. It spawns child goroutines that cannot be terminated.

func (*RouterControllerFactory) CreateNotifier added in v1.0.6

func (factory *RouterControllerFactory) CreateNotifier(changed func()) RoutesByHost

CreateNotifier begins listing and watching against the API server for the desired route and endpoint resources. It spawns child goroutines that cannot be terminated. It is a more efficient store of a route system.

type RoutesByHost added in v1.0.6

type RoutesByHost interface {
	Hosts() []string
	Route(host string) (*routeapi.Route, bool)
	Endpoints(namespace, name string) *kapi.Endpoints
}

type TrapperFunc

type TrapperFunc func()

TrapperFunc defines the signature for a EventQueueTrapperFunc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL