memory

package
v0.0.0-...-a142011 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceDiscovery

type ServiceDiscovery struct {
	model.NetworkGatewaysHandler

	WantGetProxyServiceTargets []model.ServiceTarget
	InstancesError             error
	Controller                 model.Controller
	ClusterID                  cluster.ID

	// XDSUpdater will push EDS changes to the ADS model.
	XdsUpdater model.XDSUpdater
	// contains filtered or unexported fields
}

ServiceDiscovery is a mock discovery interface

func NewServiceDiscovery

func NewServiceDiscovery(services ...*model.Service) *ServiceDiscovery

NewServiceDiscovery builds an in-memory ServiceDiscovery

func (*ServiceDiscovery) AddEndpoint

func (sd *ServiceDiscovery) AddEndpoint(service host.Name, servicePortName string, servicePort int, address string, port int) *model.ServiceInstance

AddEndpoint adds an endpoint to a service.

func (*ServiceDiscovery) AddGateways

func (sd *ServiceDiscovery) AddGateways(gws ...model.NetworkGateway)

func (*ServiceDiscovery) AddHTTPService

func (sd *ServiceDiscovery) AddHTTPService(name, vip string, port int)

AddHTTPService is a helper to add a service of type http, named 'http-main', with the specified vip and port.

func (*ServiceDiscovery) AddInstance

func (sd *ServiceDiscovery) AddInstance(instance *model.ServiceInstance)

AddInstance adds an in-memory instance and notifies the XDS updater

func (*ServiceDiscovery) AddService

func (sd *ServiceDiscovery) AddService(svc *model.Service)

AddService adds an in-memory service and notifies

func (*ServiceDiscovery) AddServiceInfo

func (sd *ServiceDiscovery) AddServiceInfo(infos ...*model.ServiceInfo)

func (*ServiceDiscovery) AddWorkload

func (sd *ServiceDiscovery) AddWorkload(ip string, labels labels.Instance)

func (*ServiceDiscovery) AddWorkloadInfo

func (sd *ServiceDiscovery) AddWorkloadInfo(infos ...*model.WorkloadInfo)

func (*ServiceDiscovery) AdditionalPodSubscriptions

func (sd *ServiceDiscovery) AdditionalPodSubscriptions(
	*model.Proxy,
	sets.String,
	sets.String,
) sets.String

func (*ServiceDiscovery) AddressInformation

func (sd *ServiceDiscovery) AddressInformation(requests sets.String) ([]model.AddressInfo, sets.String)

func (*ServiceDiscovery) AppendServiceHandler

func (sd *ServiceDiscovery) AppendServiceHandler(f model.ServiceHandler)

AppendServiceHandler appends a service handler to the controller

func (*ServiceDiscovery) AppendWorkloadHandler

func (sd *ServiceDiscovery) AppendWorkloadHandler(func(*model.WorkloadInstance, model.Event))

Memory does not support workload handlers; everything is done in terms of instances

func (*ServiceDiscovery) GetProxyServiceTargets

func (sd *ServiceDiscovery) GetProxyServiceTargets(node *model.Proxy) []model.ServiceTarget

GetProxyServiceTargets returns service instances associated with a node, resulting in 'in' services.

func (*ServiceDiscovery) GetProxyWorkloadLabels

func (sd *ServiceDiscovery) GetProxyWorkloadLabels(proxy *model.Proxy) labels.Instance

func (*ServiceDiscovery) GetService

func (sd *ServiceDiscovery) GetService(hostname host.Name) *model.Service

GetService implements discovery interface Each call to GetService() should return a new *model.Service

func (*ServiceDiscovery) HasSynced

func (sd *ServiceDiscovery) HasSynced() bool

HasSynced always returns true

func (*ServiceDiscovery) MCSServices

func (sd *ServiceDiscovery) MCSServices() []model.MCSServiceInfo

func (*ServiceDiscovery) NetworkGateways

func (sd *ServiceDiscovery) NetworkGateways() []model.NetworkGateway

func (*ServiceDiscovery) Policies

func (*ServiceDiscovery) RemoveService

func (sd *ServiceDiscovery) RemoveService(name host.Name)

RemoveService removes an in-memory service.

func (*ServiceDiscovery) RemoveServiceInfo

func (sd *ServiceDiscovery) RemoveServiceInfo(info *model.ServiceInfo)

func (*ServiceDiscovery) RemoveWorkloadInfo

func (sd *ServiceDiscovery) RemoveWorkloadInfo(info *model.WorkloadInfo)

func (*ServiceDiscovery) Run

func (sd *ServiceDiscovery) Run(<-chan struct{})

Run will run the controller

func (*ServiceDiscovery) Services

func (sd *ServiceDiscovery) Services() []*model.Service

Services implements discovery interface Each call to Services() should return a list of new *model.Service

func (*ServiceDiscovery) ServicesForWaypoint

func (sd *ServiceDiscovery) ServicesForWaypoint(model.WaypointKey) []model.ServiceInfo

func (*ServiceDiscovery) ServicesWithWaypoint

func (sd *ServiceDiscovery) ServicesWithWaypoint(string) []model.ServiceWaypointInfo

func (*ServiceDiscovery) SetEndpoints

func (sd *ServiceDiscovery) SetEndpoints(service string, namespace string, endpoints []*model.IstioEndpoint)

SetEndpoints update the list of endpoints for a service, similar with K8S controller.

func (*ServiceDiscovery) Waypoint

func (sd *ServiceDiscovery) Waypoint(string, string) []netip.Addr

func (*ServiceDiscovery) WorkloadsForWaypoint

func (sd *ServiceDiscovery) WorkloadsForWaypoint(model.WaypointKey) []model.WorkloadInfo

Jump to

Keyboard shortcuts

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