Documentation ¶
Index ¶
- func DataplaneCallbacksToXdsCallbacks(callbacks DataplaneCallbacks) util_xds.Callbacks
- func NewNackBackoff(backoff time.Duration) util_xds.Callbacks
- type DataplaneCallbacks
- type DataplaneInsightSink
- type DataplaneInsightSinkFactoryFunc
- type DataplaneInsightStore
- type DataplaneLifecycle
- func (d *DataplaneLifecycle) OnProxyConnected(streamID core_xds.StreamID, proxyKey core_model.ResourceKey, ...) error
- func (d *DataplaneLifecycle) OnProxyDisconnected(ctx context.Context, streamID core_xds.StreamID, ...)
- func (d *DataplaneLifecycle) OnProxyReconnected(streamID core_xds.StreamID, proxyKey core_model.ResourceKey, ...) error
- type DataplaneMetadataTracker
- func (d *DataplaneMetadataTracker) Metadata(dpKey core_model.ResourceKey) *core_xds.DataplaneMetadata
- func (d *DataplaneMetadataTracker) OnProxyConnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, ...) error
- func (d *DataplaneMetadataTracker) OnProxyDisconnected(_ context.Context, _ core_xds.StreamID, dpKey core_model.ResourceKey)
- func (d *DataplaneMetadataTracker) OnProxyReconnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, ...) error
- type DataplaneStatusTracker
- type NewDataplaneWatchdogFunc
- type NoopDataplaneCallbacks
- func (n *NoopDataplaneCallbacks) OnProxyConnected(core_xds.StreamID, core_model.ResourceKey, context.Context, ...) error
- func (n *NoopDataplaneCallbacks) OnProxyDisconnected(context.Context, core_xds.StreamID, core_model.ResourceKey)
- func (n *NoopDataplaneCallbacks) OnProxyReconnected(core_xds.StreamID, core_model.ResourceKey, context.Context, ...) error
- type SubscriptionStatusAccessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataplaneCallbacksToXdsCallbacks ¶
func DataplaneCallbacksToXdsCallbacks(callbacks DataplaneCallbacks) util_xds.Callbacks
Types ¶
type DataplaneCallbacks ¶
type DataplaneCallbacks interface { // OnProxyConnected is executed when proxy is connected after it was disconnected before. OnProxyConnected(streamID core_xds.StreamID, dpKey core_model.ResourceKey, ctx context.Context, metadata core_xds.DataplaneMetadata) error // OnProxyReconnected is executed when proxy is already connected, but there is another stream. // This can happen when there is a delay with closing the old connection from the proxy to the control plane. OnProxyReconnected(streamID core_xds.StreamID, dpKey core_model.ResourceKey, ctx context.Context, metadata core_xds.DataplaneMetadata) error // OnProxyDisconnected is executed only when the last stream of the proxy disconnects. OnProxyDisconnected(ctx context.Context, streamID core_xds.StreamID, dpKey core_model.ResourceKey) }
DataplaneCallbacks are XDS callbacks that keep the context of Dubbo Dataplane. In the ideal world we could assume that one Dataplane has one xDS stream. Due to race network latencies etc. there might be a situation when one Dataplane has many xDS streams for the short period of time. Those callbacks helps us to deal with such situation.
Keep in mind that it does not solve many xDS streams across many instances of the Control Plane. If there are many instances of the Control Plane and Dataplane reconnects, there might be an old stream in one instance of CP and a new stream in a new instance of CP.
func NewDataplaneSyncTracker ¶
func NewDataplaneSyncTracker(factoryFunc NewDataplaneWatchdogFunc) DataplaneCallbacks
type DataplaneInsightSink ¶
type DataplaneInsightSink interface {
Start(stop <-chan struct{})
}
func NewDataplaneInsightSink ¶
func NewDataplaneInsightSink( dataplaneType core_model.ResourceType, accessor SubscriptionStatusAccessor, newTicker func() *time.Ticker, generationTicker func() *time.Ticker, flushBackoff time.Duration, store DataplaneInsightStore, ) DataplaneInsightSink
type DataplaneInsightSinkFactoryFunc ¶
type DataplaneInsightSinkFactoryFunc = func(core_model.ResourceType, SubscriptionStatusAccessor) DataplaneInsightSink
type DataplaneInsightStore ¶
type DataplaneInsightStore interface { // Upsert creates or updates the subscription, storing it with // the key dataplaneID. dataplaneType gives the resource type of // the dataplane proxy that has subscribed. Upsert(ctx context.Context, dataplaneType core_model.ResourceType, dataplaneID core_model.ResourceKey, subscription *mesh_proto.DiscoverySubscription) error }
func NewDataplaneInsightStore ¶
func NewDataplaneInsightStore(resManager manager.ResourceManager) DataplaneInsightStore
type DataplaneLifecycle ¶
type DataplaneLifecycle struct {
// contains filtered or unexported fields
}
func NewDataplaneLifecycle ¶
func NewDataplaneLifecycle( appCtx context.Context, resManager manager.ResourceManager, deregistrationDelay time.Duration, cpInstanceID string, ) *DataplaneLifecycle
func (*DataplaneLifecycle) OnProxyConnected ¶
func (d *DataplaneLifecycle) OnProxyConnected(streamID core_xds.StreamID, proxyKey core_model.ResourceKey, ctx context.Context, md core_xds.DataplaneMetadata) error
func (*DataplaneLifecycle) OnProxyDisconnected ¶
func (d *DataplaneLifecycle) OnProxyDisconnected(ctx context.Context, streamID core_xds.StreamID, proxyKey core_model.ResourceKey)
func (*DataplaneLifecycle) OnProxyReconnected ¶
func (d *DataplaneLifecycle) OnProxyReconnected(streamID core_xds.StreamID, proxyKey core_model.ResourceKey, ctx context.Context, md core_xds.DataplaneMetadata) error
type DataplaneMetadataTracker ¶
func NewDataplaneMetadataTracker ¶
func NewDataplaneMetadataTracker() *DataplaneMetadataTracker
func (*DataplaneMetadataTracker) Metadata ¶
func (d *DataplaneMetadataTracker) Metadata(dpKey core_model.ResourceKey) *core_xds.DataplaneMetadata
func (*DataplaneMetadataTracker) OnProxyConnected ¶
func (d *DataplaneMetadataTracker) OnProxyConnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, metadata core_xds.DataplaneMetadata) error
func (*DataplaneMetadataTracker) OnProxyDisconnected ¶
func (d *DataplaneMetadataTracker) OnProxyDisconnected(_ context.Context, _ core_xds.StreamID, dpKey core_model.ResourceKey)
func (*DataplaneMetadataTracker) OnProxyReconnected ¶
func (d *DataplaneMetadataTracker) OnProxyReconnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, metadata core_xds.DataplaneMetadata) error
type DataplaneStatusTracker ¶
type DataplaneStatusTracker interface { util_xds.Callbacks GetStatusAccessor(streamID int64) (SubscriptionStatusAccessor, bool) }
func NewDataplaneStatusTracker ¶
func NewDataplaneStatusTracker( runtimeInfo core_runtime.RuntimeInfo, createStatusSink DataplaneInsightSinkFactoryFunc, ) DataplaneStatusTracker
type NewDataplaneWatchdogFunc ¶
type NewDataplaneWatchdogFunc func(key core_model.ResourceKey) util_watchdog.Watchdog
type NoopDataplaneCallbacks ¶
type NoopDataplaneCallbacks struct{}
NoopDataplaneCallbacks are empty callbacks that helps to implement DataplaneCallbacks without need to implement every function.
func (*NoopDataplaneCallbacks) OnProxyConnected ¶
func (n *NoopDataplaneCallbacks) OnProxyConnected(core_xds.StreamID, core_model.ResourceKey, context.Context, core_xds.DataplaneMetadata) error
func (*NoopDataplaneCallbacks) OnProxyDisconnected ¶
func (n *NoopDataplaneCallbacks) OnProxyDisconnected(context.Context, core_xds.StreamID, core_model.ResourceKey)
func (*NoopDataplaneCallbacks) OnProxyReconnected ¶
func (n *NoopDataplaneCallbacks) OnProxyReconnected(core_xds.StreamID, core_model.ResourceKey, context.Context, core_xds.DataplaneMetadata) error
type SubscriptionStatusAccessor ¶
type SubscriptionStatusAccessor interface {
GetStatus() (core_model.ResourceKey, *mesh_proto.DiscoverySubscription)
}