Documentation ¶
Index ¶
- Variables
- type KtoCSource
- func (t *KtoCSource) BroadcastListener(stopCh <-chan struct{}, syncPeriod time.Duration)
- func (t *KtoCSource) Delete(key string, _ interface{}) error
- func (t *KtoCSource) Informer() cache.SharedIndexInformer
- func (t *KtoCSource) Lock()
- func (t *KtoCSource) Run(ch <-chan struct{})
- func (t *KtoCSource) Unlock()
- func (t *KtoCSource) Upsert(key string, raw interface{}) error
- type KtoCSyncer
- type SyncJob
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var ( ProtocolHTTP = constants.ProtocolHTTP ProtocolGRPC = constants.ProtocolGRPC )
Functions ¶
This section is empty.
Types ¶
type KtoCSource ¶ added in v1.2.1
type KtoCSource struct {
// contains filtered or unexported fields
}
KtoCSource implements controller.Resource to sync RegisteredInstances resource types from K8S.
func NewKtoCSource ¶ added in v1.2.1
func NewKtoCSource(controller connector.ConnectController, syncer Syncer, ctx context.Context, msgBroker *messaging.Broker, kubeClient kubernetes.Interface, discClient connector.ServiceDiscoveryClient) *KtoCSource
func (*KtoCSource) BroadcastListener ¶ added in v1.2.1
func (t *KtoCSource) BroadcastListener(stopCh <-chan struct{}, syncPeriod time.Duration)
BroadcastListener listens for broadcast messages from the message broker
func (*KtoCSource) Delete ¶ added in v1.2.1
func (t *KtoCSource) Delete(key string, _ interface{}) error
Delete implements the controller.Resource interface.
func (*KtoCSource) Informer ¶ added in v1.2.1
func (t *KtoCSource) Informer() cache.SharedIndexInformer
Informer implements the controller.Resource interface.
func (*KtoCSource) Lock ¶ added in v1.2.1
func (t *KtoCSource) Lock()
func (*KtoCSource) Run ¶ added in v1.2.1
func (t *KtoCSource) Run(ch <-chan struct{})
Run implements the controller.Backgrounder interface.
func (*KtoCSource) Unlock ¶ added in v1.2.1
func (t *KtoCSource) Unlock()
func (*KtoCSource) Upsert ¶ added in v1.2.1
func (t *KtoCSource) Upsert(key string, raw interface{}) error
Upsert implements the controller.Resource interface.
type KtoCSyncer ¶ added in v1.2.1
type KtoCSyncer struct {
// contains filtered or unexported fields
}
KtoCSyncer is a Syncer that takes the set of registrations and registers them with cloud. It also watches cloud for changes to the services and ensures the local set of registrations represents the source of truth, overwriting any external changes to the services.
func NewKtoCSyncer ¶ added in v1.2.1
func NewKtoCSyncer(controller connector.ConnectController, discClient connector.ServiceDiscoveryClient) *KtoCSyncer
func (*KtoCSyncer) Lock ¶ added in v1.2.1
func (s *KtoCSyncer) Lock()
func (*KtoCSyncer) Run ¶ added in v1.2.1
func (s *KtoCSyncer) Run(ctx context.Context)
Run is the long-running runloop for reconciling the local set of services to register with the remote state.
func (*KtoCSyncer) Sync ¶ added in v1.2.1
func (s *KtoCSyncer) Sync(rs []*connector.CatalogRegistration)
Sync implements Syncer.
func (*KtoCSyncer) Unlock ¶ added in v1.2.1
func (s *KtoCSyncer) Unlock()
type SyncJob ¶ added in v1.2.1
type SyncJob struct {
// contains filtered or unexported fields
}
SyncJob is the job to sync
func (*SyncJob) GetDoneCh ¶ added in v1.2.1
func (job *SyncJob) GetDoneCh() <-chan struct{}
GetDoneCh returns the channel, which when closed, indicates the job has been finished.
type Syncer ¶
type Syncer interface { // Sync is called to sync the full set of registrations. Sync([]*connector.CatalogRegistration) }
Syncer is responsible for syncing a set of cloud catalog registrations. An external system manages the set of registrations and periodically updates the Syncer. The Syncer should keep the remote system in sync with the given set of registrations.