repo

package
v0.0.0-...-9f02593 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterRepository

type ClusterRepository struct {
	repo.CommonRepository
}

ClusterRepository defines the database repository for the cluster server tables

func (*ClusterRepository) DeleteAlarmDefinitionsNotIn

func (r *ClusterRepository) DeleteAlarmDefinitionsNotIn(ctx context.Context, ids []any, alarmDictionaryID uuid.UUID) (int64, error)

DeleteAlarmDefinitionsNotIn deletes all alarm definitions identified by the primary key that are not in the list of IDs. The Where expression also uses the column "alarm_dictionary_id" to filter the records

func (*ClusterRepository) FindStaleAlarmDictionaries

func (r *ClusterRepository) FindStaleAlarmDictionaries(ctx context.Context, dataSourceID uuid.UUID, generationID int) ([]commonmodels.AlarmDictionary, error)

FindStaleAlarmDictionaries returns the list of AlarmDictionary records that have a matching "data_source_id" and a "generation_id"

func (*ClusterRepository) GetAlarmDefinitionsByAlarmDictionaryID

func (r *ClusterRepository) GetAlarmDefinitionsByAlarmDictionaryID(ctx context.Context, alarmDictionaryID uuid.UUID) ([]commonmodels.AlarmDefinition, error)

GetAlarmDefinitionsByAlarmDictionaryID returns the list of AlarmDefinition records that have a matching "alarm_dictionary_id"

func (*ClusterRepository) GetAlarmDictionaries

func (r *ClusterRepository) GetAlarmDictionaries(ctx context.Context) ([]commonmodels.AlarmDictionary, error)

GetAlarmDictionaries returns the list of AlarmDictionary records or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetAlarmDictionary

func (r *ClusterRepository) GetAlarmDictionary(ctx context.Context, id uuid.UUID) (*commonmodels.AlarmDictionary, error)

GetAlarmDictionary returns an AlarmDictionary record matching the specified UUID value or ErrNotFound if no record matched;

func (*ClusterRepository) GetClusterResource

func (r *ClusterRepository) GetClusterResource(ctx context.Context, id uuid.UUID) (*models.ClusterResource, error)

GetClusterResource returns a ClusterResource record matching the specified UUID value or ErrNotFound if no record matched; otherwise an error

func (*ClusterRepository) GetClusterResourceType

func (r *ClusterRepository) GetClusterResourceType(ctx context.Context, id uuid.UUID) (*models.ClusterResourceType, error)

GetClusterResourceType returns a ClusterResourceType record matching the specified UUID value or ErrNotFound if no record matched; otherwise an error

func (*ClusterRepository) GetClusterResourceTypes

func (r *ClusterRepository) GetClusterResourceTypes(ctx context.Context) ([]models.ClusterResourceType, error)

GetClusterResourceTypes returns the list of ClusterResourceType records or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetClusterResources

func (r *ClusterRepository) GetClusterResources(ctx context.Context) ([]models.ClusterResource, error)

GetClusterResources returns the list of ClusterResource records or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetClusterResourcesNotIn

func (r *ClusterRepository) GetClusterResourcesNotIn(ctx context.Context, keys []any) ([]models.ClusterResource, error)

GetClusterResourcesNotIn returns the list of ClusterResource records not matching the list of keys provided, or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetNodeCluster

func (r *ClusterRepository) GetNodeCluster(ctx context.Context, id uuid.UUID) (*models.NodeCluster, error)

GetNodeCluster returns a NodeCluster record matching the specified UUID value or ErrNotFound if no record matched; otherwise an error

func (*ClusterRepository) GetNodeClusterByName

func (r *ClusterRepository) GetNodeClusterByName(ctx context.Context, name string) (*models.NodeCluster, error)

GetNodeClusterByName returns a NodeCluster record matching the specified name or ErrNotFound if no record matched; otherwise an error

func (*ClusterRepository) GetNodeClusterResourceIDs

func (r *ClusterRepository) GetNodeClusterResourceIDs(ctx context.Context, clusters ...any) ([]models.ClusterResourceIDs, error)

GetNodeClusterResourceIDs returns an array of ClusterResourceIDs which contains the list of ClusterResourceID values for each NodeCluster in the database. If the `clusters` parameter is set, then we scope the response to only those clusters.

func (*ClusterRepository) GetNodeClusterResources

func (r *ClusterRepository) GetNodeClusterResources(ctx context.Context, nodeClusterID uuid.UUID) ([]models.ClusterResource, error)

GetNodeClusterResources returns the list of ClusterResource records that have a matching "cluster_name" attribute or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetNodeClusterType

func (r *ClusterRepository) GetNodeClusterType(ctx context.Context, id uuid.UUID) (*models.NodeClusterType, error)

GetNodeClusterType returns a NodeClusterType record matching the specified UUID value or ErrNotFound if no record matched; otherwise an error

func (*ClusterRepository) GetNodeClusterTypeAlarmDictionary

func (r *ClusterRepository) GetNodeClusterTypeAlarmDictionary(ctx context.Context, nodeClusterTypeID uuid.UUID) ([]commonmodels.AlarmDictionary, error)

GetNodeClusterTypeAlarmDictionary returns the list of AlarmDictionary records that have a matching "node_cluster_type_id"

func (*ClusterRepository) GetNodeClusterTypes

func (r *ClusterRepository) GetNodeClusterTypes(ctx context.Context) ([]models.NodeClusterType, error)

GetNodeClusterTypes returns the list of NodeClusterType records or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetNodeClusters

func (r *ClusterRepository) GetNodeClusters(ctx context.Context) ([]models.NodeCluster, error)

GetNodeClusters returns the list of NodeCluster records or an empty list if none exist; otherwise an error

func (*ClusterRepository) GetNodeClustersNotIn

func (r *ClusterRepository) GetNodeClustersNotIn(ctx context.Context, keys []any) ([]models.NodeCluster, error)

GetNodeClustersNotIn returns the list of NodeCluster records not matching the list of keys provided, or an empty list if none exist; otherwise an error

func (*ClusterRepository) SetNodeClusterID

func (r *ClusterRepository) SetNodeClusterID(ctx context.Context, nodeClusterName string, nodeClusterID uuid.UUID) (int, error)

SetNodeClusterID sets the nodeClusterID value on cluster resources that may have arrived out of order

func (*ClusterRepository) UpsertAlarmDefinitions

func (r *ClusterRepository) UpsertAlarmDefinitions(ctx context.Context, records []commonmodels.AlarmDefinition) ([]commonmodels.AlarmDefinition, error)

UpsertAlarmDefinitions inserts or updates alarm definition records

type RepositoryInterface

type RepositoryInterface interface {
	repo.RepositoryInterface
	GetNodeClusterTypes(context.Context) ([]models.NodeClusterType, error)
	GetNodeClusterType(context.Context, uuid.UUID) (*models.NodeClusterType, error)
	GetNodeClusters(context.Context) ([]models.NodeCluster, error)
	GetNodeClustersNotIn(context.Context, []any) ([]models.NodeCluster, error)
	GetNodeCluster(context.Context, uuid.UUID) (*models.NodeCluster, error)
	GetNodeClusterByName(context.Context, string) (*models.NodeCluster, error)
	GetNodeClusterResources(context.Context, uuid.UUID) ([]models.ClusterResource, error)
	GetNodeClusterResourceIDs(context.Context, ...any) ([]models.ClusterResourceIDs, error)
	GetClusterResourceTypes(context.Context) ([]models.ClusterResourceType, error)
	GetClusterResourceType(context.Context, uuid.UUID) (*models.ClusterResourceType, error)
	GetClusterResources(context.Context) ([]models.ClusterResource, error)
	GetClusterResourcesNotIn(context.Context, []any) ([]models.ClusterResource, error)
	GetClusterResource(context.Context, uuid.UUID) (*models.ClusterResource, error)
	UpsertAlarmDefinitions(context.Context, []commonmodels.AlarmDefinition) ([]commonmodels.AlarmDefinition, error)
	DeleteAlarmDefinitionsNotIn(context.Context, []any, uuid.UUID) (int64, error)
	GetAlarmDefinitionsByAlarmDictionaryID(context.Context, uuid.UUID) ([]commonmodels.AlarmDefinition, error)
	FindStaleAlarmDictionaries(context.Context, uuid.UUID, int) ([]commonmodels.AlarmDictionary, error)
	GetNodeClusterTypeAlarmDictionary(context.Context, uuid.UUID) ([]commonmodels.AlarmDictionary, error)
	GetAlarmDictionaries(context.Context) ([]commonmodels.AlarmDictionary, error)
	GetAlarmDictionary(context.Context, uuid.UUID) (*commonmodels.AlarmDictionary, error)
	SetNodeClusterID(context.Context, string, uuid.UUID) (int, error)
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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