Documentation ¶
Overview ¶
Package common - define a common set of services for both local/remote chains
Index ¶
- func AppendStrings2Path(path *connection.Path, strs ...string) *connection.Path
- func ClientConnection(ctx context.Context) *connection.Connection
- func ConnectionMonitor(ctx context.Context) connectionmonitor.MonitorServer
- func Endpoint(ctx context.Context) *registry.NSERegistration
- func EndpointConnection(ctx context.Context) *connection.Connection
- func Forwarder(ctx context.Context) *model.Forwarder
- func IgnoredEndpoints(ctx context.Context) map[registry.EndpointNSMName]*registry.NSERegistration
- func Log(ctx context.Context) logrus.FieldLogger
- func ModelConnection(ctx context.Context) *model.ClientConnection
- func NewCompositeService(factoryName string, services ...networkservice.NetworkServiceServer) networkservice.NetworkServiceServer
- func NewCrossConnectService() networkservice.NetworkServiceServer
- func NewExcludedPrefixesService() networkservice.NetworkServiceServer
- func NewExcludedPrefixesServiceFromPath(configPath string) networkservice.NetworkServiceServer
- func NewMonitorService(monitor connectionmonitor.MonitorServer) networkservice.NetworkServiceServer
- func NewRequestValidator() networkservice.NetworkServiceServer
- func Next(ctx context.Context) networkservice.NetworkServiceServer
- func OriginalSpan(ctx context.Context) spanhelper.SpanHelper
- func ProcessClose(ctx context.Context, connection *connection.Connection) (*empty.Empty, error)
- func ProcessNext(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error)
- func RemoteMechanisms(ctx context.Context) []*connection.Mechanism
- func SpanHelperFromConnection(ctx context.Context, clientConnection *model.ClientConnection, ...) spanhelper.SpanHelper
- func Strings2Path(strs ...string) *connection.Path
- func WithClientConnection(parent context.Context, connection *connection.Connection) context.Context
- func WithConnectionMonitor(parent context.Context, monitorServer connectionmonitor.MonitorServer) context.Context
- func WithEndpoint(parent context.Context, endpoint *registry.NSERegistration) context.Context
- func WithEndpointConnection(parent context.Context, connection *connection.Connection) context.Context
- func WithForwarder(parent context.Context, dp *model.Forwarder) context.Context
- func WithIgnoredEndpoints(parent context.Context, ...) context.Context
- func WithLog(parent context.Context, log logrus.FieldLogger) context.Context
- func WithModelConnection(parent context.Context, connection *model.ClientConnection) context.Context
- func WithNext(parent context.Context, next networkservice.NetworkServiceServer) context.Context
- func WithOriginalSpan(parent context.Context, span spanhelper.SpanHelper) context.Context
- func WithRemoteMechanisms(parent context.Context, mechanisms []*connection.Mechanism) context.Context
- func WithWorkspaceName(parent context.Context, name string) context.Context
- func WorkspaceName(ctx context.Context) string
- type CompositeNetworkService
- type ContextKeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendStrings2Path ¶
func AppendStrings2Path(path *connection.Path, strs ...string) *connection.Path
AppendStrings2Path is a utility function to append PathSegments to a Path from a list of Names
func ClientConnection ¶
func ClientConnection(ctx context.Context) *connection.Connection
ClientConnection -
Returns a ClientConnection from: ctx context.Context If any is present, otherwise nil
func ConnectionMonitor ¶
func ConnectionMonitor(ctx context.Context) connectionmonitor.MonitorServer
ConnectionMonitor -
Returns a ConnectionMonitor from: ctx context.Context If any is present, otherwise nil
func Endpoint ¶
func Endpoint(ctx context.Context) *registry.NSERegistration
Endpoint - Return selected endpoint object
func EndpointConnection ¶
func EndpointConnection(ctx context.Context) *connection.Connection
EndpointConnection - Return endpoint connection object
func IgnoredEndpoints ¶
func IgnoredEndpoints(ctx context.Context) map[registry.EndpointNSMName]*registry.NSERegistration
IgnoredEndpoints - Return a map of ignored endpoints or empty map. key == endpointname + ":" + NetworkServiceManager.Url
func ModelConnection ¶
func ModelConnection(ctx context.Context) *model.ClientConnection
ModelConnection -
Returns a ModelConnection from: ctx context.Context If any is present, otherwise nil
func NewCompositeService ¶
func NewCompositeService(factoryName string, services ...networkservice.NetworkServiceServer) networkservice.NetworkServiceServer
NewCompositeService creates a new composed endpoint
func NewCrossConnectService ¶
func NewCrossConnectService() networkservice.NetworkServiceServer
NewCrossConnectService - creates a service to create a cross connect
func NewExcludedPrefixesService ¶
func NewExcludedPrefixesService() networkservice.NetworkServiceServer
NewExcludedPrefixesService - creates a service to select endpoint.
func NewExcludedPrefixesServiceFromPath ¶
func NewExcludedPrefixesServiceFromPath(configPath string) networkservice.NetworkServiceServer
NewExcludedPrefixesService - creates a service to select endpoint.
func NewMonitorService ¶
func NewMonitorService(monitor connectionmonitor.MonitorServer) networkservice.NetworkServiceServer
NewMonitorService - Perform updates to workspace monitoring services.
func NewRequestValidator ¶
func NewRequestValidator() networkservice.NetworkServiceServer
NewRequestValidator - creates a service to verify request
func Next ¶
func Next(ctx context.Context) networkservice.NetworkServiceServer
Next -
Returns the Next networkservice.NetworkServiceServer to be called in the chain from the context.Context
func OriginalSpan ¶
func OriginalSpan(ctx context.Context) spanhelper.SpanHelper
OriginalSpan - Return forwarder
func ProcessClose ¶
func ProcessClose(ctx context.Context, connection *connection.Connection) (*empty.Empty, error)
ProcessClose - perform a next close operation on chain if defined
func ProcessNext ¶
func ProcessNext(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error)
ProcessNext - performs a next operation on chain if defined.
func RemoteMechanisms ¶
func RemoteMechanisms(ctx context.Context) []*connection.Mechanism
RemoteMechanisms -
Returns a Mechanism from: ctx context.Context If any is present, otherwise nil
func SpanHelperFromConnection ¶
func SpanHelperFromConnection(ctx context.Context, clientConnection *model.ClientConnection, operation string) spanhelper.SpanHelper
SpanHelperFromConnection - construct new span helper with span from context is present or span from connection object
func Strings2Path ¶
func Strings2Path(strs ...string) *connection.Path
Strings2Path is a utility function to create a Path from a list of NSMgr names
func WithClientConnection ¶
func WithClientConnection(parent context.Context, connection *connection.Connection) context.Context
WithClientConnection -
Wraps 'parent' in a new Context that has the ClientConnection provided in: connection *connection.Connection using Context.Value(...) and returns the result. Note: any previously existing ClientConnection will be overwritten. Recommended use: in any Request or Close call that creates a ClientConnection, call: ctx = WithClientConnection(ctx) to ensure that the ctx has a ClientConnection In any Request or Close call that consumes a ClientConnection, call: connectionMap := ClientConnection(ctx) to retrieve the ClientConnection from the context.Context
func WithConnectionMonitor ¶
func WithConnectionMonitor(parent context.Context, monitorServer connectionmonitor.MonitorServer) context.Context
WithConnectionMonitor -
Wraps 'parent' in a new Context that has the local connection Monitor using Context.Value(...) and returns the result. Note: any previously existing ConnectionMonitor will be overwritten.
func WithEndpoint ¶
WithEndpoint -
Wraps 'parent' in a new Context that has the endpoint selected using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithEndpointConnection ¶
func WithEndpointConnection(parent context.Context, connection *connection.Connection) context.Context
WithEndpointConnection -
Wraps 'parent' in a new Context that has endpoint connection object using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithForwarder ¶
WithForwarder -
Wraps 'parent' in a new Context that has the forwarder selected using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithIgnoredEndpoints ¶
func WithIgnoredEndpoints(parent context.Context, endpoints map[registry.EndpointNSMName]*registry.NSERegistration) context.Context
WithIgnoredEndpoints -
Wraps 'parent' in a new Context that has the map of ignored endpoints using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithModelConnection ¶
func WithModelConnection(parent context.Context, connection *model.ClientConnection) context.Context
WithModelConnection -
Wraps 'parent' in a new Context that has the model connection using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithNext ¶
func WithNext(parent context.Context, next networkservice.NetworkServiceServer) context.Context
WithNext -
Wraps 'parent' in a new Context that has the Next networkservice.NetworkServiceServer to be called in the chain Should only be set in CompositeNetworkService.Request/Close
func WithOriginalSpan ¶
func WithOriginalSpan(parent context.Context, span spanhelper.SpanHelper) context.Context
WithOriginalSpan -
Wraps 'parent' in a new Context that has the original opentracing Span. using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithRemoteMechanisms ¶
func WithRemoteMechanisms(parent context.Context, mechanisms []*connection.Mechanism) context.Context
WithRemoteMechanisms -
Wraps 'parent' in a new Context that has the remote mechanisms using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WithWorkspaceName ¶
WithWorkspaceName -
Wraps 'parent' in a new Context that has the workspace name; using Context.Value(...) and returns the result. Note: any previously existing value will be overwritten.
func WorkspaceName ¶
WorkspaceName - Return a workspace name
Types ¶
type CompositeNetworkService ¶
type CompositeNetworkService struct {
// contains filtered or unexported fields
}
CompositeNetworkService is the base service composition struct
func (*CompositeNetworkService) Close ¶
func (cns *CompositeNetworkService) Close(ctx context.Context, connection *connection.Connection) (*empty.Empty, error)
Close implements a dummy close handler
func (*CompositeNetworkService) Request ¶
func (cns *CompositeNetworkService) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error)
Request implements a dummy request handler