ktoc

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

func (*SyncJob) JobName added in v1.2.1

func (job *SyncJob) JobName() string

JobName implementation for this job, for logging purposes

func (*SyncJob) Run added in v1.2.1

func (job *SyncJob) Run()

Run is the logic unit of job

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL