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 }
Config - configuration for network service client
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
func (*FullMeshNetworkServiceClient) Request ¶
func (fmnsc *FullMeshNetworkServiceClient) Request(request *networkservice.NetworkServiceRequest) error
Request - Blocks on listening for NSE add/delete events TODO: That NSM Find client seems unreliable; reports lost/new NSEs with delay. 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 ¶
func (snsc *SimpleNetworkServiceClient) Request(request *networkservice.NetworkServiceRequest) error
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.