Documentation
¶
Index ¶
- Constants
- type AlarmsDataSource
- type ClusterDataSource
- type Collector
- type DataSource
- type K8SDataSource
- func (d *K8SDataSource) GetGenerationID() int
- func (d *K8SDataSource) GetID() uuid.UUID
- func (d *K8SDataSource) HandleAsyncEvent(ctx context.Context, obj interface{}, eventType async.AsyncEventType) (uuid.UUID, error)
- func (d *K8SDataSource) HandleSyncComplete(ctx context.Context, objectType runtime.Object, keys []uuid.UUID) error
- func (d *K8SDataSource) IncrGenerationID() int
- func (d *K8SDataSource) Init(uuid uuid.UUID, generationID int, ...)
- func (d *K8SDataSource) MakeClusterResourceType(resource *models.ClusterResource) (*models.ClusterResourceType, error)
- func (d *K8SDataSource) MakeNodeClusterType(resource *models.NodeCluster) (*models.NodeClusterType, error)
- func (d *K8SDataSource) Name() string
- func (d *K8SDataSource) Watch(ctx context.Context) error
- type NotificationHandler
- type NotificationTransformer
- type WatchableDataSource
Constants ¶
const ( NodeClusterTypeUUIDNamespace = "b9b24e78-5764-461b-8a0b-55bbe189d3d9" ClusterResourceUUIDNamespace = "75d74e65-f51f-4195-94ea-e4495b940a8f" ClusterResourceTypeUUIDNamespace = "be370c55-e9fc-4094-81c3-83d6be4a6a14" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlarmsDataSource ¶
type AlarmsDataSource struct {
// contains filtered or unexported fields
}
AlarmsDataSource is the struct that holds the alarms data source
func (*AlarmsDataSource) GetGenerationID ¶
func (d *AlarmsDataSource) GetGenerationID() int
GetGenerationID retrieves the current generation id for this data source
func (*AlarmsDataSource) GetID ¶
func (d *AlarmsDataSource) GetID() uuid.UUID
GetID returns the data source ID for this data source
func (*AlarmsDataSource) IncrGenerationID ¶
func (d *AlarmsDataSource) IncrGenerationID() int
IncrGenerationID increments the current generation id for this data source
func (*AlarmsDataSource) Init ¶
func (d *AlarmsDataSource) Init(uuid uuid.UUID, generationID int, _ chan<- *async.AsyncChangeEvent)
Init initializes the data source with its configuration data
func (*AlarmsDataSource) Name ¶
func (d *AlarmsDataSource) Name() string
Name returns the name of this data source
type ClusterDataSource ¶
type ClusterDataSource interface { DataSource MakeNodeClusterType(resource *models.NodeCluster) (*models.NodeClusterType, error) MakeClusterResourceType(resource *models.ClusterResource) (*models.ClusterResourceType, error) }
ClusterDataSource defines an interface of a data source capable of getting handling Cluster resources.
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector defines the attributes required by the collector implementation.
func NewCollector ¶
func NewCollector(repo *repo.ClusterRepository, notificationHandler NotificationHandler, dataSources []DataSource) *Collector
NewCollector creates a new collector instance
type DataSource ¶
type DataSource interface { Name() string GetID() uuid.UUID Init(dataSourceID uuid.UUID, generationID int, asyncEventChannel chan<- *async.AsyncChangeEvent) GetGenerationID() int IncrGenerationID() int }
DataSource represents the operations required to be supported by any objects implementing a data collection backend.
func NewAlarmsDataSource ¶
func NewAlarmsDataSource() (DataSource, error)
NewAlarmsDataSource creates a new AlarmsDataSource
func NewK8SDataSource ¶
func NewK8SDataSource(cloudID uuid.UUID, extensions []string) (DataSource, error)
NewK8SDataSource creates a new instance of an K8S data source collector whose purpose is to collect data from the Kubernetes API to be included in the node cluster, node cluster type, cluster resource and cluster resource type tables.
type K8SDataSource ¶
type K8SDataSource struct {
// contains filtered or unexported fields
}
K8SDataSource defines an instance of a data source collector that interacts with the Kubernetes API
func (*K8SDataSource) GetGenerationID ¶
func (d *K8SDataSource) GetGenerationID() int
GetGenerationID retrieves the current generation id for this data source.
func (*K8SDataSource) GetID ¶
func (d *K8SDataSource) GetID() uuid.UUID
GetID returns the data source ID for this data source
func (*K8SDataSource) HandleAsyncEvent ¶
func (d *K8SDataSource) HandleAsyncEvent(ctx context.Context, obj interface{}, eventType async.AsyncEventType) (uuid.UUID, error)
HandleAsyncEvent handles an add/update/delete to an object received by from the Reflector.
func (*K8SDataSource) HandleSyncComplete ¶
func (d *K8SDataSource) HandleSyncComplete(ctx context.Context, objectType runtime.Object, keys []uuid.UUID) error
HandleSyncComplete handles the end of a sync operation by sending an event down to the Collector.
func (*K8SDataSource) IncrGenerationID ¶
func (d *K8SDataSource) IncrGenerationID() int
IncrGenerationID increments the current generation id for this data source.
func (*K8SDataSource) Init ¶
func (d *K8SDataSource) Init(uuid uuid.UUID, generationID int, asyncEventChannel chan<- *async.AsyncChangeEvent)
Init initializes the data source with its configuration data; including the ID, the GenerationID, and its extension values if provided.
func (*K8SDataSource) MakeClusterResourceType ¶
func (d *K8SDataSource) MakeClusterResourceType(resource *models.ClusterResource) (*models.ClusterResourceType, error)
MakeClusterResourceType creates an instance of a ResourceType from a Resource object.
func (*K8SDataSource) MakeNodeClusterType ¶
func (d *K8SDataSource) MakeNodeClusterType(resource *models.NodeCluster) (*models.NodeClusterType, error)
MakeNodeClusterType creates an instance of a NodeClusterType from a NodeCluster object.
func (*K8SDataSource) Name ¶
func (d *K8SDataSource) Name() string
Name returns the name of this data source
type NotificationHandler ¶
type NotificationHandler interface {
Notify(ctx context.Context, event *notifier.Notification)
}
NotificationHandler defines an interface over which notifications are published.
type NotificationTransformer ¶
type NotificationTransformer struct { }
NotificationTransformer is responsible for transforming notification to add subscription-specific details before being published to the subscriber.
func NewNotificationTransformer ¶
func NewNotificationTransformer() *NotificationTransformer
NewNotificationTransformer creates a new NotificationTransformer
func (*NotificationTransformer) Transform ¶
func (t *NotificationTransformer) Transform(subscription *notifier.SubscriptionInfo, notification *notifier.Notification) (*notifier.Notification, error)
Transform provides a mechanism to augment a notification with subscription-specific information. If no transformation is possible or necessary, then the original notification is returned.
type WatchableDataSource ¶
WatchableDataSource defines an interface of a data source capable of watching for async events.