kuberegistry

package
v0.0.0-...-7466a32 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// KubeRegistry constant string
	KubeRegistry = "kube"
	// DefaultMinResyncPeriod determins the minmum resync period
	DefaultMinResyncPeriod = 1 * time.Second
)

Variables

This section is empty.

Functions

func ResyncPeriod

func ResyncPeriod(options registry.Options) func() time.Duration

ResyncPeriod returns func to calculate time duration of resync

Types

type DiscoveryController

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

DiscoveryController defines discovery controller for kube registry

func NewDiscoveryController

func NewDiscoveryController(
	sInformer coreinformers.ServiceInformer,
	eInformer coreinformers.EndpointsInformer,
	pInformer coreinformers.PodInformer,
	client kubernetes.Interface,
) *DiscoveryController

NewDiscoveryController returns new discovery controller

func (*DiscoveryController) FindEndpoints

func (dc *DiscoveryController) FindEndpoints(service string, tags utiltags.Tags) ([]*registry.MicroServiceInstance, error)

FindEndpoints returns microservice instances of kube registry

func (*DiscoveryController) GetAllServices

func (dc *DiscoveryController) GetAllServices() ([]*registry.MicroService, error)

GetAllServices returns microservice of kube registry

func (*DiscoveryController) Run

func (dc *DiscoveryController) Run(stop <-chan struct{})

Run begins discovery controller

type ServiceDiscovery

type ServiceDiscovery struct {
	Controller *DiscoveryController

	Name string
}

ServiceDiscovery to represent the object of service center to call the APIs of service center

func (*ServiceDiscovery) AutoSync

func (r *ServiceDiscovery) AutoSync()

AutoSync updating the cache manager

func (*ServiceDiscovery) Close

func (r *ServiceDiscovery) Close() error

Close close all websocket connection

func (*ServiceDiscovery) FindMicroServiceInstances

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

FindMicroServiceInstances find micro-service instances

func (*ServiceDiscovery) GetAllMicroServices

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

GetAllMicroServices Get all MicroService information.

func (*ServiceDiscovery) GetMicroService

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

GetMicroService return service

func (*ServiceDiscovery) GetMicroServiceID

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

GetMicroServiceID get microServiceID

func (*ServiceDiscovery) GetMicroServiceInstances

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

GetMicroServiceInstances return instances

Jump to

Keyboard shortcuts

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