istiov2

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRefreshInterval = time.Second * 30
)
View Source
const (
	PilotV2Registry = "pilotv2"
)

Variables

View Source
var (
	//PodName is the name of the pod that mesher runs in
	PodName string
	//PodNamespace is the namespace which the pod belongs to
	PodNamespace string
	//InstanceIP is the IP of the pod(the IP of the first network adaptor)
	InstanceIP string
)

Functions

func NewDiscoveryService

func NewDiscoveryService(options registry.Options) registry.ServiceDiscovery

NewDiscoveryService creates the new ServiceDiscovery instance

Types

type CacheManager

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

CacheManager manages the caches for istio pilot results.

func NewCacheManager

func NewCacheManager(xdsClient *istioinfra.XdsClient) (*CacheManager, error)

NewCacheManager creates the CacheManager instance.

func (*CacheManager) AutoSync

func (cm *CacheManager) AutoSync()

AutoSync fetches and updates the cluster and endpoint info periodically

func (*CacheManager) MakeIPIndex

func (cm *CacheManager) MakeIPIndex() error

MakeIPIndex caches the cluster info with address as the key

type EndpointCache

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

EndpointCache caches the clusters' endpoint and tags

func (*EndpointCache) Delete

func (c *EndpointCache) Delete(clusterName string)

Delete removes the cached instances of the specified cluster

func (*EndpointCache) GetWithTags

func (c *EndpointCache) GetWithTags(serviceName string, tags map[string]string) []*registry.MicroServiceInstance

GetWithTags returns the instances of the service, filtered with tags

func (*EndpointCache) Set

func (c *EndpointCache) Set(clusterName string, subset EndpointSubset)

Set updates the cluster's instance info

type EndpointSubset

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

EndpointSubset stores the tags and instances of a service

type ServiceDiscovery

type ServiceDiscovery struct {
	Name string
	// contains filtered or unexported fields
}

ServiceDiscovery is the discovery service for istio pilot with xDS v2 API

func (*ServiceDiscovery) AutoSync

func (discovery *ServiceDiscovery) AutoSync()

AutoSync updates the services' info periodically in the background

func (*ServiceDiscovery) Close

func (discovery *ServiceDiscovery) Close() error

Close closes the discovery service

func (*ServiceDiscovery) FindMicroServiceInstances

func (discovery *ServiceDiscovery) FindMicroServiceInstances(consumerID, microServiceName string, tags utiltags.Tags) ([]*registry.MicroServiceInstance, error)

FindMicroServiceInstances returns the micro service's instances filtered with tags

func (*ServiceDiscovery) GetAllMicroServices

func (discovery *ServiceDiscovery) GetAllMicroServices() ([]*registry.MicroService, error)

GetAllMicroServices returns all the micro services, which is mapped from xDS clusters

func (*ServiceDiscovery) GetMicroService

func (discovery *ServiceDiscovery) GetMicroService(microServiceID string) (*registry.MicroService, error)

GetMicroService returns the micro service info

func (*ServiceDiscovery) GetMicroServiceID

func (discovery *ServiceDiscovery) GetMicroServiceID(appID, microServiceName, version, env string) (string, error)

GetMicroServiceID returns the id of the micro service

func (*ServiceDiscovery) GetMicroServiceInstances

func (discovery *ServiceDiscovery) GetMicroServiceInstances(consumerID, providerID string) ([]*registry.MicroServiceInstance, error)

GetMicroServiceInstances returns the instances of the micro service

Jump to

Keyboard shortcuts

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