Documentation ¶
Index ¶
- Constants
- type NsmClient
- func (nsmc *NsmClient) Close(ctx context.Context, outgoingConnection *connection.Connection) error
- func (nsmc *NsmClient) Connect(ctx context.Context, name, mechanism, description string) (*connection.Connection, error)
- func (nsmc *NsmClient) ConnectRetry(ctx context.Context, name, mechanism, description string, retryCount int, ...) (*connection.Connection, error)
- func (nsmc *NsmClient) ConnectToEndpoint(ctx context.Context, ...) (*connection.Connection, error)
- func (nsmc *NsmClient) ConnectToEndpointRetry(ctx context.Context, ...) (*connection.Connection, error)
- func (nsmc *NsmClient) Destroy(ctx context.Context) error
- type NsmClientList
- func (nsmcl *NsmClientList) Close(ctx context.Context) error
- func (nsmcl *NsmClientList) Connect(ctx context.Context, name, mechanism, description string) error
- func (nsmcl *NsmClientList) ConnectRetry(ctx context.Context, name, mechanism, description string, retryCount int, ...) error
- func (nsmcl *NsmClientList) Destroy(ctx context.Context) error
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 ¶
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
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
Click to show internal directories.
Click to hide internal directories.