database

package
v0.0.0-...-cb52b78 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteClustersCache

func DeleteClustersCache(uid string)

func NewBatchWithRetry

func NewBatchWithRetry(ctx context.Context, dao *DAO, syncResponse *model.SyncResponse) batchWithRetry

func ReadClustersCache

func ReadClustersCache(uid string) (interface{}, bool)

func UpdateClustersCache

func UpdateClustersCache(uid string, data interface{})

Types

type DAO

type DAO struct {
	// contains filtered or unexported fields
}

Database Access Object. Use a DAO instance so we can replace the pool object in the unit tests.

func NewDAO

func NewDAO(p pgxpoolmock.PgxPool) DAO

Creates new DAO instance.

func (*DAO) ClusterTotals

func (dao *DAO) ClusterTotals(ctx context.Context, clusterName string) (resources int, edges int, e error)

Query resource and edge count for a cluster. Used for data validation.

func (*DAO) DeleteClusterAndResources

func (dao *DAO) DeleteClusterAndResources(ctx context.Context, clusterName string, deleteClusterNode bool)

func (*DAO) DeleteClusterResourcesTxn

func (dao *DAO) DeleteClusterResourcesTxn(ctx context.Context, clusterName string) error

func (*DAO) DeleteClusterTxn

func (dao *DAO) DeleteClusterTxn(ctx context.Context, clusterUID string) error

func (*DAO) GetManagedClusters

func (dao *DAO) GetManagedClusters(ctx context.Context) ([]string, error)

Query database for managed clusters:

func (*DAO) InitializeTables

func (dao *DAO) InitializeTables(ctx context.Context)

func (*DAO) ResyncData

func (dao *DAO) ResyncData(ctx context.Context, event model.SyncEvent,
	clusterName string, syncResponse *model.SyncResponse) error

Reset data for the cluster to the incoming state.

func (*DAO) SyncData

func (dao *DAO) SyncData(ctx context.Context, event model.SyncEvent,
	clusterName string, syncResponse *model.SyncResponse) error

func (*DAO) UpsertCluster

func (dao *DAO) UpsertCluster(ctx context.Context, resource model.Resource)

Jump to

Keyboard shortcuts

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