store

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMapLister

type ConfigMapLister struct {
	cache.Store
}

ConfigMapLister makes a Store that lists Configmaps.

func (*ConfigMapLister) ByKey

func (cml *ConfigMapLister) ByKey(key string) (*apiv1.ConfigMap, error)

ByKey returns the ConfigMap matching key in the local ConfigMap Store.

type Dummy

type Dummy struct {
	GetIngressAnnotationsResponse *annotations.Ingress
	GetServiceAnnotationsResponse *annotations.Service

	GetServiceFunc            func(string) (*corev1.Service, error)
	ListNodesFunc             func() []*corev1.Node
	GetNodeInstanceIDFunc     func(*corev1.Node) (string, error)
	GetClusterInstanceIDsFunc func() ([]string, error)

	GetServiceEndpointsFunc func(string) (*corev1.Endpoints, error)
	// contains filtered or unexported fields
}

func NewDummy

func NewDummy() *Dummy

func (*Dummy) GetClusterInstanceIDs

func (d *Dummy) GetClusterInstanceIDs() ([]string, error)

GetClusterInstanceIDs is the mock for dummy store

func (Dummy) GetConfig

func (d Dummy) GetConfig() *config.Configuration

GetConfig ...

func (Dummy) GetConfigMap

func (d Dummy) GetConfigMap(key string) (*corev1.ConfigMap, error)

GetConfigMap ...

func (Dummy) GetIngress

func (d Dummy) GetIngress(key string) (*extensions.Ingress, error)

GetIngress ...

func (Dummy) GetIngressAnnotations

func (d Dummy) GetIngressAnnotations(key string) (*annotations.Ingress, error)

GetIngressAnnotations ...

func (*Dummy) GetInstanceIDFromPodIP

func (d *Dummy) GetInstanceIDFromPodIP(s string) (string, error)

GetInstanceIDFromPodIP ...

func (*Dummy) GetNodeInstanceID

func (d *Dummy) GetNodeInstanceID(node *corev1.Node) (string, error)

GetInstanceIDFromPodIP ...

func (Dummy) GetService

func (d Dummy) GetService(key string) (*corev1.Service, error)

GetService ...

func (Dummy) GetServiceAnnotations

func (d Dummy) GetServiceAnnotations(key string, ingress *annotations.Ingress) (*annotations.Service, error)

GetServiceAnnotations ...

func (Dummy) GetServiceEndpoints

func (d Dummy) GetServiceEndpoints(key string) (*corev1.Endpoints, error)

GetServiceEndpoints ...

func (Dummy) ListIngresses

func (d Dummy) ListIngresses() []*extensions.Ingress

ListIngresses ...

func (Dummy) ListNodes

func (d Dummy) ListNodes() []*corev1.Node

ListNodes ...

func (Dummy) Run

func (d Dummy) Run(stopCh chan struct{})

Run ...

func (*Dummy) SetConfig

func (d *Dummy) SetConfig(c *config.Configuration)

SetConfig ...

type EndpointLister

type EndpointLister struct {
	cache.Store
}

EndpointLister makes a Store that lists Endpoints.

func (*EndpointLister) ByKey

func (s *EndpointLister) ByKey(key string) (*apiv1.Endpoints, error)

ByKey returns the Endpoints of the Service matching key in the local Endpoint Store.

type Informer

Informer defines the required SharedIndexInformers that interact with the API server.

type IngressAnnotationsLister

type IngressAnnotationsLister struct {
	cache.Store
}

IngressAnnotationsLister makes a Store that lists annotations in Ingress rules.

func (IngressAnnotationsLister) ByKey

ByKey returns the Ingress annotations matching key in the local Ingress annotations Store.

type IngressLister

type IngressLister struct {
	cache.Store
}

IngressLister makes a Store that lists Ingress.

func (IngressLister) ByKey

func (il IngressLister) ByKey(key string) (*extensions.Ingress, error)

ByKey returns the Ingress matching key in the local Ingress Store.

type Lister

type Lister struct {
	Ingress           IngressLister
	Service           ServiceLister
	Endpoint          EndpointLister
	Node              NodeLister
	Pod               PodLister
	IngressAnnotation IngressAnnotationsLister
	ServiceAnnotation ServiceAnnotationsLister
}

Lister contains object listers (stores).

type MockStorer

type MockStorer struct {
	mock.Mock
}

MockStorer is an autogenerated mock type for the Storer type

func (*MockStorer) GetClusterInstanceIDs

func (_m *MockStorer) GetClusterInstanceIDs() ([]string, error)

GetClusterInstanceIDs provides a mock function with given fields:

func (*MockStorer) GetConfig

func (_m *MockStorer) GetConfig() *config.Configuration

GetConfig provides a mock function with given fields:

func (*MockStorer) GetIngressAnnotations

func (_m *MockStorer) GetIngressAnnotations(key string) (*annotations.Ingress, error)

GetIngressAnnotations provides a mock function with given fields: key

func (*MockStorer) GetInstanceIDFromPodIP

func (_m *MockStorer) GetInstanceIDFromPodIP(_a0 string) (string, error)

GetInstanceIDFromPodIP provides a mock function with given fields: _a0

func (*MockStorer) GetNodeInstanceID

func (_m *MockStorer) GetNodeInstanceID(node *v1.Node) (string, error)

GetNodeInstanceID provides a mock function with given fields: node

func (*MockStorer) GetService

func (_m *MockStorer) GetService(key string) (*v1.Service, error)

GetService provides a mock function with given fields: key

func (*MockStorer) GetServiceAnnotations

func (_m *MockStorer) GetServiceAnnotations(key string, ingress *annotations.Ingress) (*annotations.Service, error)

GetServiceAnnotations provides a mock function with given fields: key, ingress

func (*MockStorer) GetServiceEndpoints

func (_m *MockStorer) GetServiceEndpoints(key string) (*v1.Endpoints, error)

GetServiceEndpoints provides a mock function with given fields: key

func (*MockStorer) ListNodes

func (_m *MockStorer) ListNodes() []*v1.Node

ListNodes provides a mock function with given fields:

type NodeLister

type NodeLister struct {
	cache.Store
}

NodeLister makes a Store that lists Nodes.

func (*NodeLister) ByKey

func (nl *NodeLister) ByKey(key string) (*apiv1.Node, error)

ByKey returns the Node matching key in the local Node Store.

type NotExistsError

type NotExistsError string

NotExistsError is returned when an object does not exist in a local store.

func (NotExistsError) Error

func (e NotExistsError) Error() string

Error implements the error interface.

type PodLister

type PodLister struct {
	cache.Store
}

PodLister makes a Store that lists Pods.

type ServiceAnnotationsLister

type ServiceAnnotationsLister struct {
	cache.Store
}

ServiceAnnotationsLister makes a Store that lists annotations in Service rules.

func (ServiceAnnotationsLister) ByKey

ByKey returns the Service annotations matching key in the local Service annotations Store.

type ServiceLister

type ServiceLister struct {
	cache.Store
}

ServiceLister makes a Store that lists Services.

func (*ServiceLister) ByKey

func (sl *ServiceLister) ByKey(key string) (*apiv1.Service, error)

ByKey returns the Service matching key in the local Service Store.

type Storer

type Storer interface {
	// GetService returns the Service matching key.
	GetService(key string) (*corev1.Service, error)

	// GetServiceEndpoints returns the Endpoints of a Service matching key.
	GetServiceEndpoints(key string) (*corev1.Endpoints, error)

	// GetServiceAnnotations returns the parsed annotations of an Service matching key. if ingress is non-nil, merges ingress annotations into the service.
	GetServiceAnnotations(key string, ingress *annotations.Ingress) (*annotations.Service, error)

	// ListNodes returns a list of all Nodes in the store.
	ListNodes() []*corev1.Node

	// GetIngressAnnotations returns the parsed annotations of an Ingress matching key.
	GetIngressAnnotations(key string) (*annotations.Ingress, error)

	// GetConfig returns the controller configuration
	GetConfig() *config.Configuration

	// GetInstanceIDFromPodIP gets the instance id of the node running a pod
	GetInstanceIDFromPodIP(string) (string, error)

	// GetNodeInstanceID gets the instance id of node
	GetNodeInstanceID(node *corev1.Node) (string, error)

	// GetClusterInstanceIDs gets id of all instances inside cluster
	GetClusterInstanceIDs() ([]string, error)
}

Storer is the interface that wraps the required methods to gather information about ingresses, services, secrets and ingress annotations.

func New

func New(mgr manager.Manager, cfg *config.Configuration) (Storer, error)

New creates a new object store to be used in the ingress controller

Jump to

Keyboard shortcuts

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