client

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: 17 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// ConnectTimeout - a default connection timeout
	ConnectTimeout = 15 * time.Second
	// ConnectionRetry - A number of retries for establish a network service, default == 10
	ConnectionRetry = 10
	// RequestDelay - A delay between attempts, default = 5sec
	RequestDelay = time.Second * 5
)
View Source
const (
	// AnnotationEnv - AnnotationEnv is the name of the env varioable to configure
	// Multiple Client List instance
	AnnotationEnv = "NS_NETWORKSERVICEMESH_IO"
	// NSMConnectRetries - Specify how many time we could retry to do a connection retrying.
	NSMConnectRetries = "NSM_CLIENT_CONNECT_RETRIES"
	// NamespaceEnv - NamespaceEnv is the namespace a container is running in
	NamespaceEnv = "NSM_NAMESPACE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NsmClient

type NsmClient struct {
	*common.NsmConnection
	ClientNetworkService string
	ClientLabels         map[string]string
	OutgoingConnections  []*connection.Connection
	NscInterfaceName     string
	// contains filtered or unexported fields
}

NsmClient is the NSM client struct

func NewNSMClient

func NewNSMClient(ctx context.Context, configuration *common.NSConfiguration) (*NsmClient, error)

NewNSMClient creates the NsmClient

func (*NsmClient) Close

func (nsmc *NsmClient) Close(ctx context.Context, outgoingConnection *connection.Connection) error

Close will terminate a particular connection

func (*NsmClient) Connect

func (nsmc *NsmClient) Connect(ctx context.Context, name, mechanism, description string) (*connection.Connection, error)

Connect with no retry and delay

func (*NsmClient) ConnectRetry

func (nsmc *NsmClient) ConnectRetry(ctx context.Context, name, mechanism, description string, retryCount int, retryDelay time.Duration) (*connection.Connection, error)

func (*NsmClient) ConnectToEndpoint

func (nsmc *NsmClient) ConnectToEndpoint(ctx context.Context, remoteIp, destEndpointName, destEndpointManager, name, mechanism, description string, routes []string) (*connection.Connection, error)

func (*NsmClient) ConnectToEndpointRetry

func (nsmc *NsmClient) ConnectToEndpointRetry(ctx context.Context, remoteIp, destEndpointName, destEndpointManager, name, mechanism, description string, routes []string, retryCount int, retryDelay time.Duration) (*connection.Connection, error)

Connect implements the business logic

func (*NsmClient) Destroy

func (nsmc *NsmClient) Destroy(ctx context.Context) error

Destroy - Destroy stops the whole module

type NsmClientList

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

NsmClientList represents a set of clients

func NewNSMClientList

func NewNSMClientList(ctx context.Context, configuration *common.NSConfiguration) (*NsmClientList, error)

NewNSMClientList creates a new list of clients

func (*NsmClientList) Close

func (nsmcl *NsmClientList) Close(ctx context.Context) error

Close terminates all connections establised by Connect

func (*NsmClientList) Connect

func (nsmcl *NsmClientList) Connect(ctx context.Context, name, mechanism, description string) error

Connect will create new interfaces with the specified name and mechanism

func (*NsmClientList) ConnectRetry

func (nsmcl *NsmClientList) ConnectRetry(ctx context.Context, name, mechanism, description string, retryCount int, retryDelay time.Duration) error

Connect will create new interfaces with the specified name and mechanism

func (*NsmClientList) Destroy

func (nsmcl *NsmClientList) Destroy(ctx context.Context) error

Destroy terminates all clients

Jump to

Keyboard shortcuts

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