Documentation ¶
Index ¶
- Constants
- func CloseGorm()
- func GetGorm() *gorm.DB
- func GetPostgresConfig(URI string, cert []byte) (*pgx.ConnConfig, error)
- func InitGormInstance(config *DatabaseConfig) error
- func PostgresConnPool(ctx context.Context, databaseURI string, certPath string, size int32) (*pgxpool.Pool, error)
- func PostgresConnection(ctx context.Context, URI string, cert []byte) (*pgx.Conn, error)
- type ComplianceStatus
- type DatabaseConfig
Constants ¶
View Source
const ( // StatusSchema schema for status updates. StatusSchema = "status" // LocalStatusSchema schema for local status updates. LocalStatusSchema = "local_status" // LocalSpecSchema schema for local spec updates. LocalSpecSchema = "local_spec" // EventSchema schema for policy events EventSchema = "event" )
db schemas.
View Source
const ( // ManagedClustersTableName table name of managed clusters. ManagedClustersTableName = "managed_clusters" // ComplianceTableName table name of policy compliance status. ComplianceTableName = "compliance" // MinimalComplianceTable table name of minimal policy compliance status. MinimalComplianceTable = "aggregated_compliance" // LocalPolicySpecTableName table name of local policy spec. LocalPolicySpecTableName = "policies" // SubscriptionStatusesTableName table name of subscription-statuses. SubscriptionStatusesTableName = "subscription_statuses" // SubscriptionReportsTableName table name of subscription-reports. SubscriptionReportsTableName = "subscription_reports" // PlacementRulesTableName table name of placement-rules. PlacementRulesTableName = "placementrules" // PlacementsTableName table name of placements. PlacementsTableName = "placements" // PlacementDecisionsTableName table name of placement-decisions. PlacementDecisionsTableName = "placementdecisions" // LeafHubHeartbeatsTableName table name for LH heartbeats. LeafHubHeartbeatsTableName = "leaf_hub_heartbeats" // HubClusterInfo table name of leaf_hubs. HubClusterInfoTableName = "leaf_hubs" // PolicyEvent table name of leaf_hubs. LocalPolicyEventTableName = "local_policies" LocalRootPolicyEventTableName = "local_root_policies" )
table names.
View Source
const ( // UUID unique type. UUID = "uuid" // Jsonb unique type. Jsonb = "jsonb" // ComplianceType unique type. ComplianceType = "compliance_type" )
unique db types.
View Source
const (
// ErrorNone is default value when no error occurs.
ErrorNone = "none"
)
default values.
View Source
const PostgresDialect = "postgres"
Variables ¶
This section is empty.
Functions ¶
func GetPostgresConfig ¶
func InitGormInstance ¶
func InitGormInstance(config *DatabaseConfig) error
Types ¶
type ComplianceStatus ¶
type ComplianceStatus string
ComplianceStatus represents the possible options for compliance status.
const ( // NonCompliant non compliant state. NonCompliant ComplianceStatus = "non_compliant" // Compliant compliant state. Compliant ComplianceStatus = "compliant" // Unknown unknown compliance state. Unknown ComplianceStatus = "unknown" )
compliance states.
Click to show internal directories.
Click to hide internal directories.