cache

package
v1.4.3-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package cache contains cache logic for pipy ingress controller

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is the type used to represent the cache for the ingress controller

func NewCache

func NewCache(ctx *cctx.ControllerContext) *Cache

NewCache creates a new cache for the ingress controller

func (*Cache) OnAdd

func (c *Cache) OnAdd(obj interface{}) bool

OnAdd is called whenever a new object is added to the store.

func (*Cache) OnDelete

func (c *Cache) OnDelete(obj interface{}) bool

OnDelete is called whenever an object is deleted from the store.

func (*Cache) OnUpdate

func (c *Cache) OnUpdate(oldObj, newObj interface{}) bool

OnUpdate is called whenever an object is updated.

func (*Cache) SyncRoutes

func (c *Cache) SyncRoutes()

SyncRoutes syncs the routes to the repo

type Endpoint

type Endpoint interface {
	String() string
	IP() string
	Port() (int, error)
	NodeName() string
	HostName() string
	ClusterInfo() string
	Equal(Endpoint) bool
}

Endpoint , Endpoint interface

type EndpointChangeTracker

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

EndpointChangeTracker tracks changes in endpoints

func NewEndpointChangeTracker

func NewEndpointChangeTracker(enrichEndpointInfo enrichEndpointFunc, recorder events.EventRecorder) *EndpointChangeTracker

NewEndpointChangeTracker creates a new EndpointChangeTracker

func (*EndpointChangeTracker) Update

func (t *EndpointChangeTracker) Update(previous, current *corev1.Endpoints) bool

Update updates the tracker with the current endpoints

type EndpointsMap

type EndpointsMap map[ServicePortName][]Endpoint

EndpointsMap is a map of service port name to endpoints

func (EndpointsMap) Update

func (em EndpointsMap) Update(changes *EndpointChangeTracker)

Update updates the endpoints map with the changes

type IngressChangeTracker

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

IngressChangeTracker tracks changes to Ingresses

func NewIngressChangeTracker

func NewIngressChangeTracker(client cache.Cache, recorder events.EventRecorder) *IngressChangeTracker

NewIngressChangeTracker creates a new IngressChangeTracker

func (*IngressChangeTracker) Update

func (t *IngressChangeTracker) Update(previous, current *networkingv1.Ingress) bool

Update updates the tracker with the given Ingresses

type IngressMap

type IngressMap map[RouteKey]Route

IngressMap is a map of Ingresses

func (IngressMap) Update

func (im IngressMap) Update(changes *IngressChangeTracker)

Update updates the ingress map with the changes

type MultiClusterEndpointsMap

type MultiClusterEndpointsMap map[ServicePortName][]Endpoint

MultiClusterEndpointsMap is a map of ServicePortName to Endpoint from multiple clusters

func (MultiClusterEndpointsMap) Update

Update updates the MultiClusterEndpointsMap with the changes from the ServiceImportChangeTracker

type Route

type Route interface {
	String() string
	Headers() map[string]string
	Host() string
	Path() string
	Backend() ServicePortName
	Rewrite() []string
	SessionSticky() bool
	LBType() commons.AlgoBalancer
	UpstreamSSLName() string
	UpstreamSSLCert() *route.CertificateSpec
	UpstreamSSLVerify() bool
	Certificate() *route.CertificateSpec
	IsTLS() bool
	IsWildcardHost() bool
	VerifyClient() bool
	VerifyDepth() int
	TrustedCA() *route.CertificateSpec
	Protocol() string
}

Route , Ingress Route interface

type RouteKey

type RouteKey struct {
	ServicePortName
	Host string
	Path string
}

RouteKey is a key for IngressMap

func (*RouteKey) String

func (irk *RouteKey) String() string

String returns a string representation of RouteKey

type ServiceChangeTracker

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

ServiceChangeTracker tracks changes to services

func NewServiceChangeTracker

func NewServiceChangeTracker(enrichServiceInfo enrichServiceInfoFunc, recorder events.EventRecorder, client cache.Cache) *ServiceChangeTracker

NewServiceChangeTracker creates a new ServiceChangeTracker

func (*ServiceChangeTracker) Update

func (t *ServiceChangeTracker) Update(previous, current *corev1.Service) bool

Update updates the tracker with the given service

type ServiceEndpoint

type ServiceEndpoint struct {
	Endpoint        string
	ServicePortName ServicePortName
}

ServiceEndpoint , Service Endpoints interface

type ServiceImportChangeTracker

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

ServiceImportChangeTracker tracks changes to ServiceImport objects

func NewServiceImportChangeTracker

func NewServiceImportChangeTracker(enrichServiceImportInfo enrichServiceImportInfoFunc, enrichEndpointInfo enrichMultiClusterEndpointFunc, recorder events.EventRecorder, client cache.Cache) *ServiceImportChangeTracker

NewServiceImportChangeTracker creates a new ServiceImportChangeTracker

func (*ServiceImportChangeTracker) Update

func (t *ServiceImportChangeTracker) Update(previous, current *mcsv1alpha1.ServiceImport) bool

Update updates the ServiceImportChangeTracker with the latest ServiceImport

type ServiceImportMap

type ServiceImportMap map[ServicePortName]ServicePort

ServiceImportMap is a map of ServicePortName to ServicePort

func (*ServiceImportMap) Update

func (sm *ServiceImportMap) Update(changes *ServiceImportChangeTracker)

Update updates the ServiceImportMap with the latest ServiceImport changes

type ServiceMap

type ServiceMap map[ServicePortName]ServicePort

ServiceMap is a map of ServicePortName to ServicePort

func (*ServiceMap) Update

func (sm *ServiceMap) Update(changes *ServiceChangeTracker)

Update updates the service map with the given service changes

type ServicePort

type ServicePort interface {
	String() string
	Address() string
	Port() int
	Protocol() v1.Protocol
}

ServicePort , Service Port interface

type ServicePortName

type ServicePortName struct {
	types.NamespacedName
	Port     string
	Protocol v1.Protocol
}

ServicePortName , Service Port Name

func (ServicePortName) String

func (spn ServicePortName) String() string

Jump to

Keyboard shortcuts

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