client

package
v1.1.5 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: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                    string
	RequestTimeout          time.Duration
	ConnectTo               url.URL
	MaxTokenLifetime        time.Duration
	APIClient               *nsm.APIClient
	MonitorConnectionClient networkservice.MonitorConnectionClient
}

Config - configuration for network service client

func (*Config) IsValid

func (c *Config) IsValid() error

IsValid - check if configuration is valid

type FullMeshNetworkServiceClient

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

func (*FullMeshNetworkServiceClient) Close

func (fmnsc *FullMeshNetworkServiceClient) Close() error

Close - Note: adding further clients once closed must be avoided TODO: improve code to support parallel closing of connections (seems to require a lot of redesign)

func (*FullMeshNetworkServiceClient) Request

Request - Blocks on listening for NSE add/delete events Note: NSM Find client is unreliable; might report NSE create/update with delay and might miss to report NSE delete completely. TODO: When scaled-in all LBs left the system as was, then scaled back LBs, old proxies were not notified about new LB NSEs. While a new proxy (e.g. after deleting an old POD) got the notification (NSM 1.11.1). Check how this is supposed to work!!!

type NetworkServiceClient

type NetworkServiceClient interface {
	Request(request *networkservice.NetworkServiceRequest) error
	Close() error
}

func NewFullMeshNetworkServiceClient

func NewFullMeshNetworkServiceClient(ctx context.Context, config *Config, additionalFunctionality ...networkservice.NetworkServiceClient) NetworkServiceClient

NewFullMeshNetworkServiceClient - Creates FullMeshNetworkServiceClient that upon invoking Request blocks and starts monitoring Network Service Endpoints belonging to the Network Service of the request. Connects to each new Network Service Endpoint, and closes connection when a known endpoint disappears.

func NewSimpleNetworkServiceClient

func NewSimpleNetworkServiceClient(ctx context.Context, config *Config, client networkservice.NetworkServiceClient) NetworkServiceClient

NewSimpleNetworkServiceClient - Wwraps NetworkServiceClient using nsm retry.Client

type SimpleNetworkServiceClient

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

TODO: Consider removing SimpleNetworkServiceClient and replacing it with an nsm retry client in fullMeshClient.

func (*SimpleNetworkServiceClient) Close

func (snsc *SimpleNetworkServiceClient) Close() error

Close - Closes established nsm connection or cancels pending Request()

Note: The context passed when creating SimpleNetworkServiceClient might be closed by the time Close() gets called. Therefore check if context is still usable, otherwise use background context.

func (*SimpleNetworkServiceClient) Request

Request - SimpleNetworkServiceClient is a retry.Client. Thus Request() blocks as it keeps trying to establish the connection, while the request is cloned at each attempt.

Jump to

Keyboard shortcuts

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