registry

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package registry implements handler's methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExplicitProxyServiceMapper

type ExplicitProxyServiceMapper func(*pipy.Proxy) ([]service.MeshService, error)

ExplicitProxyServiceMapper is a custom ProxyServiceMapper implementation.

func (ExplicitProxyServiceMapper) ListProxyServices

func (e ExplicitProxyServiceMapper) ListProxyServices(p *pipy.Proxy) ([]service.MeshService, error)

ListProxyServices executes the given mapping.

type KubeProxyServiceMapper

type KubeProxyServiceMapper struct {
	KubeController k8s.Controller
}

KubeProxyServiceMapper maps an Sidecar instance to services in a Kubernetes cluster.

func (*KubeProxyServiceMapper) ListProxyServices

func (k *KubeProxyServiceMapper) ListProxyServices(p *pipy.Proxy) ([]service.MeshService, error)

ListProxyServices maps an Pipy instance to a number of Kubernetes services.

type ProxyRegistry

type ProxyRegistry struct {
	ProxyServiceMapper

	// Fire a inform to update proxies
	UpdateProxies func()
	// contains filtered or unexported fields
}

ProxyRegistry keeps track of Sidecar proxies as they connect and disconnect from the control plane.

func NewProxyRegistry

func NewProxyRegistry(mapper ProxyServiceMapper, msgBroker *messaging.Broker) *ProxyRegistry

NewProxyRegistry initializes a new empty *ProxyRegistry.

func (*ProxyRegistry) GetConnectedProxy

func (pr *ProxyRegistry) GetConnectedProxy(uuid string) *pipy.Proxy

GetConnectedProxy loads a connected proxy from the registry.

func (*ProxyRegistry) GetConnectedProxyCount

func (pr *ProxyRegistry) GetConnectedProxyCount() int

GetConnectedProxyCount counts the number of connected proxies TODO(steeling): switch to a regular map with mutex so we can get the count without iterating the entire list.

func (*ProxyRegistry) ListConnectedProxies

func (pr *ProxyRegistry) ListConnectedProxies() map[string]models.Proxy

ListConnectedProxies lists the Pipy proxies already connected and the time they first connected.

func (*ProxyRegistry) RangeConnectedProxy

func (pr *ProxyRegistry) RangeConnectedProxy(f func(key, value interface{}) bool)

RangeConnectedProxy calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.

func (*ProxyRegistry) RegisterProxy

func (pr *ProxyRegistry) RegisterProxy(proxy *pipy.Proxy) *pipy.Proxy

RegisterProxy registers a newly connected proxy.

func (*ProxyRegistry) ReleaseCertificateHandler

func (pr *ProxyRegistry) ReleaseCertificateHandler(certManager certificateReleaser, stop <-chan struct{})

ReleaseCertificateHandler releases certificates based on podDelete events

func (*ProxyRegistry) UnregisterProxy

func (pr *ProxyRegistry) UnregisterProxy(p *pipy.Proxy)

UnregisterProxy unregisters the given proxy from the catalog.

type ProxyServiceMapper

type ProxyServiceMapper interface {
	ListProxyServices(*pipy.Proxy) ([]service.MeshService, error)
}

ProxyServiceMapper knows how to map Sidecar instances to services.

Jump to

Keyboard shortcuts

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