database

package
v0.0.0-...-b534984 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 33

Documentation

Index

Constants

View Source
const (
	MaintenanceManifestDequeueQueryForCluster = `` /* 136-byte string literal not displayed */
	MaintenanceManifestQueryForCluster        = `SELECT * FROM MaintenanceManifests doc WHERE doc.clusterResourceID = @clusterResourceID`
	MaintenanceManifestQueueOverallQuery      = `` /* 148-byte string literal not displayed */
	MaintenanceManifestQueueLengthQuery       = `` /* 161-byte string literal not displayed */
)
View Source
const (
	OpenShiftClustersDequeueQuery               = `` /* 207-byte string literal not displayed */
	OpenShiftClustersQueueLengthQuery           = `` /* 220-byte string literal not displayed */
	OpenShiftClustersGetQuery                   = `SELECT * FROM OpenShiftClusters doc WHERE doc.key = @key`
	OpenshiftClustersPrefixQuery                = `SELECT * FROM OpenShiftClusters doc WHERE STARTSWITH(doc.key, @prefix)`
	OpenshiftClustersClientIdQuery              = `SELECT * FROM OpenShiftClusters doc WHERE doc.clientIdKey = @clientID`
	OpenshiftClustersResourceGroupQuery         = `SELECT * FROM OpenShiftClusters doc WHERE doc.clusterResourceGroupIdKey = @resourceGroupID`
	OpenshiftClustersClusterResourceIDOnlyQuery = `` /* 137-byte string literal not displayed */
)
View Source
const (
	ClusterManagerConfigurationsGetQuery = `SELECT * FROM ClusterManagerConfigurations doc WHERE doc.key = @key`
)
View Source
const (
	SubscriptionsDequeueQuery string = `SELECT * FROM Subscriptions doc WHERE (doc.deleting ?? false) AND (doc.leaseExpires ?? 0) < GetCurrentTimestamp() / 1000`
)

Variables

This section is empty.

Functions

func EmitMIMOMetrics

func EmitMIMOMetrics(ctx context.Context, log *logrus.Entry, dbMaintenanceManifests MaintenanceManifests, m metrics.Emitter)

func EmitOpenShiftClustersMetrics

func EmitOpenShiftClustersMetrics(ctx context.Context, log *logrus.Entry, dbOpenShiftClusters OpenShiftClusters, m metrics.Emitter)

func NewDatabaseClient

func NewDatabaseClient(log *logrus.Entry, _env env.Core, authorizer cosmosdb.Authorizer, m metrics.Emitter, aead encryption.AEAD, databaseAccountName string) (cosmosdb.DatabaseClient, error)

func NewDatabaseClientFromEnv

func NewDatabaseClientFromEnv(ctx context.Context, _env env.Core, log *logrus.Entry, m metrics.Emitter, aead encryption.AEAD) (cosmosdb.DatabaseClient, error)

NewDatabaseClient creates a CosmosDB database client from the environment configuration.

func NewJSONHandle

func NewJSONHandle(aead encryption.AEAD) (*codec.JsonHandle, error)

func NewTokenAuthorizer

func NewTokenAuthorizer(ctx context.Context, log *logrus.Entry, cred azcore.TokenCredential, databaseAccountName string, scopes []string) (cosmosdb.Authorizer, error)

Types

type AsyncOperations

AsyncOperations is the database interface for AsyncOperationDocuments

func NewAsyncOperations

func NewAsyncOperations(ctx context.Context, isLocalDevelopmentMode bool, dbc cosmosdb.DatabaseClient, dbName string) (AsyncOperations, error)

NewAsyncOperations returns a new AsyncOperations

func NewAsyncOperationsWithProvidedClient

func NewAsyncOperationsWithProvidedClient(client cosmosdb.AsyncOperationDocumentClient, uuidGenerator uuid.Generator) AsyncOperations

type Billing

Billing is the database interface for BillingDocuments

func NewBilling

func NewBilling(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (Billing, error)

NewBilling returns a new Billing

func NewBillingWithProvidedClient

func NewBillingWithProvidedClient(client cosmosdb.BillingDocumentClient) Billing

type DatabaseGroupWithAsyncOperations

type DatabaseGroupWithAsyncOperations interface {
	AsyncOperations() (AsyncOperations, error)
}

type DatabaseGroupWithBilling

type DatabaseGroupWithBilling interface {
	Billing() (Billing, error)
}

type DatabaseGroupWithMaintenanceManifests

type DatabaseGroupWithMaintenanceManifests interface {
	MaintenanceManifests() (MaintenanceManifests, error)
}

type DatabaseGroupWithMonitors

type DatabaseGroupWithMonitors interface {
	Monitors() (Monitors, error)
}

type DatabaseGroupWithOpenShiftClusters

type DatabaseGroupWithOpenShiftClusters interface {
	OpenShiftClusters() (OpenShiftClusters, error)
}

type DatabaseGroupWithOpenShiftVersions

type DatabaseGroupWithOpenShiftVersions interface {
	OpenShiftVersions() (OpenShiftVersions, error)
}

type DatabaseGroupWithPlatformWorkloadIdentityRoleSets

type DatabaseGroupWithPlatformWorkloadIdentityRoleSets interface {
	PlatformWorkloadIdentityRoleSets() (PlatformWorkloadIdentityRoleSets, error)
}

type DatabaseGroupWithPortal

type DatabaseGroupWithPortal interface {
	Portal() (Portal, error)
}

type DatabaseGroupWithSubscriptions

type DatabaseGroupWithSubscriptions interface {
	Subscriptions() (Subscriptions, error)
}

type Gateway

func NewGateway

func NewGateway(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (Gateway, error)

func NewGatewayWithProvidedClient

func NewGatewayWithProvidedClient(client cosmosdb.GatewayDocumentClient, uuidGenerator uuid.Generator) Gateway

type MaintenanceManifestDocumentMutator

type MaintenanceManifestDocumentMutator func(*api.MaintenanceManifestDocument) error

type MaintenanceManifests

func NewMaintenanceManifests

func NewMaintenanceManifests(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (MaintenanceManifests, error)

func NewMaintenanceManifestsWithProvidedClient

func NewMaintenanceManifestsWithProvidedClient(client cosmosdb.MaintenanceManifestDocumentClient, collectionClient cosmosdb.CollectionClient, uuid string, uuidGenerator uuid.Generator) MaintenanceManifests

type Monitors

type Monitors interface {
	Create(context.Context, *api.MonitorDocument) (*api.MonitorDocument, error)
	PatchWithLease(context.Context, string, func(*api.MonitorDocument) error) (*api.MonitorDocument, error)
	TryLease(context.Context) (*api.MonitorDocument, error)
	ListBuckets(context.Context) ([]int, error)
	ListMonitors(context.Context) (*api.MonitorDocuments, error)
	MonitorHeartbeat(context.Context) error
}

Monitors is the database interface for MonitorDocuments

func NewMonitors

func NewMonitors(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (Monitors, error)

NewMonitors returns a new Monitors

type OpenShiftClusterDocumentMutator

type OpenShiftClusterDocumentMutator func(*api.OpenShiftClusterDocument) error

type OpenShiftClusters

type OpenShiftClusters interface {
	Create(context.Context, *api.OpenShiftClusterDocument) (*api.OpenShiftClusterDocument, error)
	Get(context.Context, string) (*api.OpenShiftClusterDocument, error)
	QueueLength(context.Context, string) (int, error)
	Patch(context.Context, string, OpenShiftClusterDocumentMutator) (*api.OpenShiftClusterDocument, error)
	PatchWithLease(context.Context, string, OpenShiftClusterDocumentMutator) (*api.OpenShiftClusterDocument, error)
	Update(context.Context, *api.OpenShiftClusterDocument) (*api.OpenShiftClusterDocument, error)
	Delete(context.Context, *api.OpenShiftClusterDocument) error
	ChangeFeed() cosmosdb.OpenShiftClusterDocumentIterator
	List(string) cosmosdb.OpenShiftClusterDocumentIterator
	ListAll(context.Context) (*api.OpenShiftClusterDocuments, error)
	ListByPrefix(string, string, string) (cosmosdb.OpenShiftClusterDocumentIterator, error)
	Dequeue(context.Context) (*api.OpenShiftClusterDocument, error)
	Lease(context.Context, string) (*api.OpenShiftClusterDocument, error)
	EndLease(context.Context, string, api.ProvisioningState, api.ProvisioningState, *string) (*api.OpenShiftClusterDocument, error)
	GetByClientID(ctx context.Context, partitionKey, clientID string) (*api.OpenShiftClusterDocuments, error)
	GetByClusterResourceGroupID(ctx context.Context, partitionKey, resourceGroupID string) (*api.OpenShiftClusterDocuments, error)
	GetAllResourceIDs(ctx context.Context, continuation string) (cosmosdb.OpenShiftClusterDocumentIterator, error)
	DoDequeue(ctx context.Context, doc *api.OpenShiftClusterDocument) (*api.OpenShiftClusterDocument, error)
	NewUUID() string
}

OpenShiftClusters is the database interface for OpenShiftClusterDocuments

func NewOpenShiftClusters

func NewOpenShiftClusters(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (OpenShiftClusters, error)

NewOpenShiftClusters returns a new OpenShiftClusters

func NewOpenShiftClustersWithProvidedClient

func NewOpenShiftClustersWithProvidedClient(client cosmosdb.OpenShiftClusterDocumentClient, collectionClient cosmosdb.CollectionClient, uuid string, uuidGenerator uuid.Generator) OpenShiftClusters

type Portal

Portal is the database interface for PortalDocuments

func NewPortal

func NewPortal(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (Portal, error)

NewPortal returns a new Portal

func NewPortalWithProvidedClient

func NewPortalWithProvidedClient(client cosmosdb.PortalDocumentClient, uuidGenerator uuid.Generator) Portal

type Subscriptions

Subscriptions is the database interface for SubscriptionDocuments

func NewSubscriptions

func NewSubscriptions(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (Subscriptions, error)

NewSubscriptions returns a new Subscriptions

func NewSubscriptionsWithProvidedClient

func NewSubscriptionsWithProvidedClient(client cosmosdb.SubscriptionDocumentClient, uuid string) Subscriptions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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