registryserver

package
v1.0.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ProxyNsmdK8sAddressEnv      = "PROXY_NSMD_K8S_ADDRESS"
	ProxyNsmdK8sAddressDefaults = "pnsmgr-svc:5005"
)

Default values and environment variables of proxy connection

View Source
const (
	// ForwardingTimeout - Timeout waiting for Proxy NseRegistryClient
	ForwardingTimeout = 15 * time.Second
	// ProxyRegistryReconnectInterval - reconnect interval to Proxy NSMD-K8S if connection refused
	ProxyRegistryReconnectInterval = 15 * time.Second
)
View Source
const PodNameEnv = utils.EnvVar("POD_NAME")
View Source
const PodUidEnv = utils.EnvVar("POD_UID")

Variables

This section is empty.

Functions

func FindNetworkServiceWithCache

func FindNetworkServiceWithCache(cache RegistryCache, networkServiceName string) (*registry.FindNetworkServiceResponse, error)

FindNetworkServiceWithCache returns network service with name from registry cache

func New

func New(ctx context.Context, clientset *nsmClientset.Clientset, nsmName string) *grpc.Server

New - construct a registration server

Types

type RegistryCache

type RegistryCache interface {
	AddNetworkService(ns *v1.NetworkService) (*v1.NetworkService, error)
	GetNetworkService(name string) (*v1.NetworkService, error)

	CreateOrUpdateNetworkServiceManager(nsm *v1.NetworkServiceManager) (*v1.NetworkServiceManager, error)
	GetNetworkServiceManager(name string) (*v1.NetworkServiceManager, error)

	AddNetworkServiceEndpoint(nse *v1.NetworkServiceEndpoint) (*v1.NetworkServiceEndpoint, error)
	DeleteNetworkServiceEndpoint(endpointName string) error
	GetEndpointsByNs(networkServiceName string) []*v1.NetworkServiceEndpoint
	GetEndpointsByNsm(nsmName string) []*v1.NetworkServiceEndpoint

	Start() error
	Stop()
}

func NewRegistryCache

func NewRegistryCache(cs *nsmClientset.Clientset, conf *ResourceFilterConfig) RegistryCache

NewRegistryCache creates new registry cache

type ResourceFilterConfig

type ResourceFilterConfig struct {
	NetworkServiceEndpointFilterPolicy resourcecache.CacheFilterPolicy
	NetworkServiceManagerPolicy        resourcecache.CacheFilterPolicy
	NetworkServiceFilterPolicy         resourcecache.CacheFilterPolicy
}

ResourceFilterConfig means filter resource config for nsm custom resources

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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