Documentation
¶
Overview ¶
Package heal provides a chain element that carries out proper nsm healing from client to endpoint
Code generated by "-output connection_info_map.gen.go -type connectionInfoMap<string,*connectionInfo> -output connection_info_map.gen.go -type connectionInfoMap<string,*connectionInfo>"; DO NOT EDIT.
Code generated by "-output context_wrapper_map.gen.go -type ctxWrapperMap<string,*ctxWrapper> -output context_wrapper_map.gen.go -type ctxWrapperMap<string,*ctxWrapper>"; DO NOT EDIT.
Package heal provides a chain element that carries out proper nsm healing from client to endpoint
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(ctx context.Context, cc networkservice.MonitorConnectionClient) networkservice.NetworkServiceClient
NewClient - creates a new networkservice.NetworkServiceClient chain element that monitors its connections' state
and calls heal server in case connection breaks if heal server is present in the chain - ctx - context for the lifecycle of the *Client* itself. Cancel when discarding the client. - cc - MonitorConnectionClient that will be used to watch for connection confirmations and breakages.
func NewServer ¶
func NewServer(ctx context.Context, opts ...Option) networkservice.NetworkServiceServer
NewServer - creates a new networkservice.NetworkServiceServer chain element that implements the healing algorithm
Types ¶
type OnRestore ¶
type OnRestore int
OnRestore is an action that should be performed on restore request
type Option ¶
type Option func(healOpts *healOptions)
Option is an option pattern for heal server
func WithOnHeal ¶
func WithOnHeal(onHeal *networkservice.NetworkServiceClient) Option
WithOnHeal - sets client used 'onHeal'. * If we detect we need to heal, onHeal.Request is used to heal. * If we can't heal connection, onHeal.Close will be called. * If onHeal is nil, then we simply set onHeal to this client chain element. Since networkservice.NetworkServiceClient is an interface (and thus a pointer) *networkservice.NetworkServiceClient is a double pointer. Meaning it points to a place that points to a place that implements networkservice.NetworkServiceClient. This is done because when we use heal.NewClient as part of a chain, we may not *have* a pointer to this chain.
func WithOnRestore ¶
WithOnRestore sets on restore action. Default `OnRestoreHeal`. IMPORTANT: should be set `OnRestoreIgnore` for the Forwarder, because it results in NSMgr doesn't understanding that Request is coming from Forwarder (https://github.com/networkservicemesh/sdk/issues/970).
func WithRestoreTimeout ¶
WithRestoreTimeout sets restore timeout. Default `1m`.