{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package builders\n\n## Constants\n\n```go\nconst (\n\t// DefaultImageCatalogName is the name of the CNPG ImageCatalog resource\n\t// that must exist in the target namespace before a PostgresCluster can be created.\n\tDefaultImageCatalogName = \"postgres-catalog\"\n)\n```\n\n## Types\n\n```go\ntype ClusterResourceBuilder interface {\n\tBuildStackCR(stack *models.Stack) (*corev1alpha1.Stack, error)\n\tGetStackCRHash(stack *models.Stack) (string, error)\n\tBuildStackResourceCR(stackResource *models.StackResource, stackName, orgID string) (*corev1alpha1.StackResource, error)\n\tBuildVolumeCR(ctx context.Context, volume *models.Volume) (*storagev1alpha1.Volume, error)\n}\n```\n\n```go\nfunc NewClusterResourceBuilder(spec ClusterResourceBuilderSpec) ClusterResourceBuilder\n```\n\n```go\ntype ClusterResourceBuilderSpec struct {\n\t// CredentialResolver is optional; when set, org-level registry credentials\n\t// auto-attach to image pull / push specs.\n\tCredentialResolver credentials.Resolver\n\tPlatformBaseDomain string\n\tComputeMode        config.ComputeMode\n\tPlatformTLSEnabled bool\n}\n```\n\n```go\ntype PostgresClusterBuildContext struct {\n\t// BackupObjectStoreName is the resolved name of the barman ObjectStore\n\t// K8s resource used for backups. Required when BackupConfig.ObjectStoreID is set.\n\tBackupObjectStoreName string\n\n\t// RestoreObjectStoreName is the resolved name of the barman ObjectStore\n\t// K8s resource used for restore. Required when restoring from object store.\n\tRestoreObjectStoreName string\n\n\t// RecoverySourceClusterName is the name of the PostgresCluster CR that\n\t// originally archived backups to the object store. Used as the barman-cloud\n\t// serverName when restoring from object store.\n\tRecoverySourceClusterName string\n\n\t// RestoreBackupName is the resolved CNPG Backup CR name to restore from.\n\t// Required when restoring from a specific backup.\n\tRestoreBackupName string\n}\n```\nPostgresClusterBuildContext provides pre-resolved references needed to build a PostgresCluster CR. The caller is responsible for resolving database IDs to cluster resource names before invoking the builder.\n\n```go\ntype PostgresClusterBuilder interface {\n\tBuildPostgresClusterCR(addon *models.PostgresAddon, buildCtx PostgresClusterBuildContext) (*addonsv1alpha1.PostgresCluster, error)\n\t// BuildImportPasswordSecret builds the K8s Secret that holds the password for\n\t// importing from an external database. The returned secret must be created in\n\t// the cluster before the PostgresCluster CR is applied.\n\tBuildImportPasswordSecret(addon *models.PostgresAddon, password string) *corev1.Secret\n}\n```\n\n```go\nfunc NewPostgresClusterBuilder() PostgresClusterBuilder\n```\n\n```go\ntype SecretBuilder interface {\n\t// BuildDockerConfigJsonSecret synthesizes a dockerconfigjson secret from\n\t// raw credentials — used for org-level registry credentials. ref may be an\n\t// image or repository reference; insecure derives an http:// auth URL for\n\t// in-cluster/plain-HTTP registries.\n\tBuildDockerConfigJsonSecret(ctx context.Context, secretName, username, password, ref string, insecure bool) (*corev1.Secret, error)\n\t// BuildGitCredentialsSecretFromCredentials synthesizes a git credentials\n\t// secret from raw credentials — used for org-level git integrations and\n\t// minted GitHub App tokens that have no backing hub secret.\n\tBuildGitCredentialsSecretFromCredentials(ctx context.Context, secretName string, creds gitclient.GitCredentials) (*corev1.Secret, error)\n}\n```\n\n```go\nfunc NewSecretBuilder(spec SecretBuilderSpec) SecretBuilder\n```\n\n```go\ntype SecretBuilderSpec struct{}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/builders","name":"builders","synopsis":"","isRedistributable":true}
