Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NsmServerSocketEnv is the name of the env variable to define NSM server socket NsmServerSocketEnv = "NSM_SERVER_SOCKET" // NsmClientSocketEnv is the name of the env variable to define NSM client socket NsmClientSocketEnv = "NSM_CLIENT_SOCKET" // WorkspaceEnv is the name of the env variable to define workspace directory WorkspaceEnv = "WORKSPACE" )
View Source
const (
NamespaceEnv = "NSM_NAMESPACE"
)
Variables ¶
This section is empty.
Functions ¶
func GetNamespace ¶
func GetNamespace() string
func NewMechanism ¶
NewMechanism creates a new mechanism with passed type and description.
Types ¶
type NSConfiguration ¶
type NSConfiguration struct { NsmServerSocket string NsmClientSocket string Workspace string AdvertiseNseName string OutgoingNscName string AdvertiseNseLabels string OutgoingNscLabels string NscInterfaceName string MechanismType string IPAddress string Routes []string PodName string Namespace string }
NSConfiguration contains the full configuration used in the SDK
func FromEnv ¶
func FromEnv() *NSConfiguration
FromEnv creates a new NSConfiguration and fills all unset options from the env variables
func FromNSUrl ¶
func FromNSUrl(url *tools.NSUrl) *NSConfiguration
func (*NSConfiguration) FromEnv ¶
func (configuration *NSConfiguration) FromEnv() *NSConfiguration
FromEnv fills all unset options from the env variables
func (*NSConfiguration) FromNSUrl ¶
func (configuration *NSConfiguration) FromNSUrl(url *tools.NSUrl) *NSConfiguration
type NsmConnection ¶
type NsmConnection struct { sync.RWMutex Context context.Context Configuration *NSConfiguration GrpcClient *grpc.ClientConn NsClient networkservice.NetworkServiceClient }
NsmConnection is a NSM manager connection
func NewNSMConnection ¶
func NewNSMConnection(ctx context.Context, configuration *NSConfiguration) (*NsmConnection, error)
NewNSMConnection creates a NsmConnection
func (*NsmConnection) Close ¶
func (nsmc *NsmConnection) Close() error
Close terminates the connection
Click to show internal directories.
Click to hide internal directories.