Documentation ¶
Index ¶
- Constants
- func EmitMIMOMetrics(ctx context.Context, log *logrus.Entry, ...)
- func EmitOpenShiftClustersMetrics(ctx context.Context, log *logrus.Entry, dbOpenShiftClusters OpenShiftClusters, ...)
- func NewDatabaseClient(log *logrus.Entry, _env env.Core, authorizer cosmosdb.Authorizer, ...) (cosmosdb.DatabaseClient, error)
- func NewDatabaseClientFromEnv(ctx context.Context, _env env.Core, log *logrus.Entry, m metrics.Emitter, ...) (cosmosdb.DatabaseClient, error)
- func NewJSONHandle(aead encryption.AEAD) (*codec.JsonHandle, error)
- func NewTokenAuthorizer(ctx context.Context, log *logrus.Entry, cred azcore.TokenCredential, ...) (cosmosdb.Authorizer, error)
- type AsyncOperations
- type Billing
- type ClusterManagerConfigurations
- type DatabaseGroup
- type DatabaseGroupWithAsyncOperations
- type DatabaseGroupWithBilling
- type DatabaseGroupWithMaintenanceManifests
- type DatabaseGroupWithMonitors
- type DatabaseGroupWithOpenShiftClusters
- type DatabaseGroupWithOpenShiftVersions
- type DatabaseGroupWithPlatformWorkloadIdentityRoleSets
- type DatabaseGroupWithPortal
- type DatabaseGroupWithSubscriptions
- type Gateway
- type MaintenanceManifestDocumentMutator
- type MaintenanceManifests
- type Monitors
- type OpenShiftClusterDocumentMutator
- type OpenShiftClusters
- type OpenShiftVersions
- type PlatformWorkloadIdentityRoleSets
- func NewPlatformWorkloadIdentityRoleSets(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (PlatformWorkloadIdentityRoleSets, error)
- func NewPlatformWorkloadIdentityRoleSetsWithProvidedClient(client cosmosdb.PlatformWorkloadIdentityRoleSetDocumentClient, ...) PlatformWorkloadIdentityRoleSets
- type Portal
- type Subscriptions
Constants ¶
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 */ )
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 */ )
const (
ClusterManagerConfigurationsGetQuery = `SELECT * FROM ClusterManagerConfigurations doc WHERE doc.key = @key`
)
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 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 ¶
Types ¶
type AsyncOperations ¶
type AsyncOperations interface { Create(context.Context, *api.AsyncOperationDocument) (*api.AsyncOperationDocument, error) Get(context.Context, string) (*api.AsyncOperationDocument, error) Patch(context.Context, string, func(*api.AsyncOperationDocument) error) (*api.AsyncOperationDocument, error) NewUUID() string }
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 ¶
type Billing interface { Create(context.Context, *api.BillingDocument) (*api.BillingDocument, error) Get(context.Context, string) (*api.BillingDocument, error) MarkForDeletion(context.Context, string) (*api.BillingDocument, error) UpdateLastBillingTimestamp(context.Context, string, int) (*api.BillingDocument, error) List(string) cosmosdb.BillingDocumentIterator ListAll(context.Context) (*api.BillingDocuments, error) Delete(context.Context, *api.BillingDocument) error }
Billing is the database interface for BillingDocuments
func NewBilling ¶
NewBilling returns a new Billing
func NewBillingWithProvidedClient ¶
func NewBillingWithProvidedClient(client cosmosdb.BillingDocumentClient) Billing
type ClusterManagerConfigurations ¶
type ClusterManagerConfigurations interface { Create(context.Context, *api.ClusterManagerConfigurationDocument) (*api.ClusterManagerConfigurationDocument, error) Get(context.Context, string) (*api.ClusterManagerConfigurationDocument, error) Update(context.Context, *api.ClusterManagerConfigurationDocument) (*api.ClusterManagerConfigurationDocument, error) Delete(context.Context, *api.ClusterManagerConfigurationDocument) error ChangeFeed() cosmosdb.ClusterManagerConfigurationDocumentIterator NewUUID() string }
func NewClusterManagerConfigurations ¶
func NewClusterManagerConfigurations(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (ClusterManagerConfigurations, error)
func NewClusterManagerConfigurationsWithProvidedClient ¶
func NewClusterManagerConfigurationsWithProvidedClient(client cosmosdb.ClusterManagerConfigurationDocumentClient, collectionClient cosmosdb.CollectionClient, uuid string, uuidGenerator uuid.Generator) ClusterManagerConfigurations
type DatabaseGroup ¶
type DatabaseGroup interface { DatabaseGroupWithOpenShiftClusters DatabaseGroupWithSubscriptions DatabaseGroupWithMonitors DatabaseGroupWithOpenShiftVersions DatabaseGroupWithPlatformWorkloadIdentityRoleSets DatabaseGroupWithAsyncOperations DatabaseGroupWithBilling DatabaseGroupWithPortal DatabaseGroupWithMaintenanceManifests WithOpenShiftClusters(db OpenShiftClusters) DatabaseGroup WithSubscriptions(db Subscriptions) DatabaseGroup WithMonitors(db Monitors) DatabaseGroup WithOpenShiftVersions(db OpenShiftVersions) DatabaseGroup WithPlatformWorkloadIdentityRoleSets(db PlatformWorkloadIdentityRoleSets) DatabaseGroup WithAsyncOperations(db AsyncOperations) DatabaseGroup WithBilling(db Billing) DatabaseGroup WithPortal(db Portal) DatabaseGroup WithMaintenanceManifests(db MaintenanceManifests) DatabaseGroup }
func NewDBGroup ¶
func NewDBGroup() DatabaseGroup
type DatabaseGroupWithAsyncOperations ¶
type DatabaseGroupWithAsyncOperations interface {
AsyncOperations() (AsyncOperations, error)
}
type DatabaseGroupWithMaintenanceManifests ¶
type DatabaseGroupWithMaintenanceManifests interface {
MaintenanceManifests() (MaintenanceManifests, 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 DatabaseGroupWithSubscriptions ¶
type DatabaseGroupWithSubscriptions interface {
Subscriptions() (Subscriptions, error)
}
type Gateway ¶
type Gateway interface { ChangeFeed() cosmosdb.GatewayDocumentIterator Create(context.Context, *api.GatewayDocument) (*api.GatewayDocument, error) Delete(context.Context, *api.GatewayDocument) error Get(context.Context, string) (*api.GatewayDocument, error) Patch(context.Context, string, func(*api.GatewayDocument) error) (*api.GatewayDocument, error) NewUUID() string }
func NewGateway ¶
func NewGatewayWithProvidedClient ¶
func NewGatewayWithProvidedClient(client cosmosdb.GatewayDocumentClient, uuidGenerator uuid.Generator) Gateway
type MaintenanceManifestDocumentMutator ¶
type MaintenanceManifestDocumentMutator func(*api.MaintenanceManifestDocument) error
type MaintenanceManifests ¶
type MaintenanceManifests interface { Create(context.Context, *api.MaintenanceManifestDocument) (*api.MaintenanceManifestDocument, error) GetByClusterResourceID(ctx context.Context, clusterResourceID string, continuation string) (cosmosdb.MaintenanceManifestDocumentIterator, error) GetQueuedByClusterResourceID(ctx context.Context, clusterResourceID string, continuation string) (cosmosdb.MaintenanceManifestDocumentIterator, error) Patch(context.Context, string, string, MaintenanceManifestDocumentMutator) (*api.MaintenanceManifestDocument, error) PatchWithLease(context.Context, string, string, MaintenanceManifestDocumentMutator) (*api.MaintenanceManifestDocument, error) Lease(ctx context.Context, clusterResourceID string, id string) (*api.MaintenanceManifestDocument, error) EndLease(context.Context, string, string, api.MaintenanceManifestState, *string) (*api.MaintenanceManifestDocument, error) Get(context.Context, string, string) (*api.MaintenanceManifestDocument, error) Delete(context.Context, string, string) error QueueLength(context.Context) (int, error) Queued(ctx context.Context, continuation string) (cosmosdb.MaintenanceManifestDocumentIterator, error) NewUUID() string }
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 ¶
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 OpenShiftVersions ¶
type OpenShiftVersions interface { ChangeFeed() cosmosdb.OpenShiftVersionDocumentIterator Create(context.Context, *api.OpenShiftVersionDocument) (*api.OpenShiftVersionDocument, error) Delete(context.Context, *api.OpenShiftVersionDocument) error Get(context.Context, string) (*api.OpenShiftVersionDocument, error) Update(context.Context, *api.OpenShiftVersionDocument) (*api.OpenShiftVersionDocument, error) Patch(context.Context, string, func(*api.OpenShiftVersionDocument) error) (*api.OpenShiftVersionDocument, error) ListAll(context.Context) (*api.OpenShiftVersionDocuments, error) NewUUID() string }
func NewOpenShiftVersions ¶
func NewOpenShiftVersions(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (OpenShiftVersions, error)
func NewOpenShiftVersionsWithProvidedClient ¶
func NewOpenShiftVersionsWithProvidedClient(client cosmosdb.OpenShiftVersionDocumentClient, uuid uuid.Generator) OpenShiftVersions
type PlatformWorkloadIdentityRoleSets ¶
type PlatformWorkloadIdentityRoleSets interface { ChangeFeed() cosmosdb.PlatformWorkloadIdentityRoleSetDocumentIterator Create(context.Context, *api.PlatformWorkloadIdentityRoleSetDocument) (*api.PlatformWorkloadIdentityRoleSetDocument, error) Delete(context.Context, *api.PlatformWorkloadIdentityRoleSetDocument) error Get(context.Context, string) (*api.PlatformWorkloadIdentityRoleSetDocument, error) Update(context.Context, *api.PlatformWorkloadIdentityRoleSetDocument) (*api.PlatformWorkloadIdentityRoleSetDocument, error) Patch(context.Context, string, func(*api.PlatformWorkloadIdentityRoleSetDocument) error) (*api.PlatformWorkloadIdentityRoleSetDocument, error) ListAll(context.Context) (*api.PlatformWorkloadIdentityRoleSetDocuments, error) NewUUID() string }
func NewPlatformWorkloadIdentityRoleSets ¶
func NewPlatformWorkloadIdentityRoleSets(ctx context.Context, dbc cosmosdb.DatabaseClient, dbName string) (PlatformWorkloadIdentityRoleSets, error)
func NewPlatformWorkloadIdentityRoleSetsWithProvidedClient ¶
func NewPlatformWorkloadIdentityRoleSetsWithProvidedClient(client cosmosdb.PlatformWorkloadIdentityRoleSetDocumentClient, uuid uuid.Generator) PlatformWorkloadIdentityRoleSets
type Portal ¶
type Portal interface { Create(context.Context, *api.PortalDocument) (*api.PortalDocument, error) Get(context.Context, string) (*api.PortalDocument, error) Patch(context.Context, string, func(*api.PortalDocument) error) (*api.PortalDocument, error) NewUUID() string }
Portal is the database interface for PortalDocuments
func NewPortalWithProvidedClient ¶
func NewPortalWithProvidedClient(client cosmosdb.PortalDocumentClient, uuidGenerator uuid.Generator) Portal
type Subscriptions ¶
type Subscriptions interface { Create(context.Context, *api.SubscriptionDocument) (*api.SubscriptionDocument, error) Get(context.Context, string) (*api.SubscriptionDocument, error) Update(context.Context, *api.SubscriptionDocument) (*api.SubscriptionDocument, error) ChangeFeed() cosmosdb.SubscriptionDocumentIterator Dequeue(context.Context) (*api.SubscriptionDocument, error) Lease(context.Context, string) (*api.SubscriptionDocument, error) EndLease(context.Context, string, bool, bool) (*api.SubscriptionDocument, error) }
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