{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package services\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\nPackage services is a generated GoMock package.\n\n## Constants\n\n```go\nconst (\n\tCredentialSourceIntegration = credentials.SourceIntegration\n\tCredentialSourceAnonymous   = credentials.SourceAnonymous\n\n\tRegistryPurposePull = credentials.RegistryPurposePull\n\tRegistryPurposePush = credentials.RegistryPurposePush\n)\n```\n\n```go\nconst (\n\n\t// GitHub webhook event names.\n\tGitHubEventInstallation = \"installation\"\n\tGitHubEventPullRequest  = \"pull_request\"\n\tGitHubEventPush         = \"push\"\n\t// issue_comment and label are subscribed ahead of use so already-created\n\t// apps receive them when the hub starts handling them; unknown events are\n\t// dropped by the webhook handler until then. GitHub delivers PR comments\n\t// under issue_comment.\n\tGitHubEventIssueComment = \"issue_comment\"\n\tGitHubEventLabel        = \"label\"\n)\n```\n\n```go\nconst PreviewEnvFile = \".env.preview\"\n```\nPreviewEnvFile is the optional repo-root dotenv file whose entries override stackfile env for a preview environment.\n\n## Functions\n\n```go\nfunc ContentHash(data []byte) string\n```\n\n```go\nfunc EncodeStackResourceSubdomainPrefix(stackID, resourceName string, port int) string\n```\nEncodeStackResourceSubdomainPrefix returns a short stable subdomain token from stack ID, resource name, and port number.\n\n```go\nfunc FQDNForPortWithCustomDomain(stackID, resourceName, customDomain string, port models.Port) (fqdn, generatedPrefix string)\n```\n\n```go\nfunc FQDNForPortWithPlatformDomain(resourceID, resourceName, baseDomain string, port models.Port) (string, string, error)\n```\n\n```go\nfunc IsBase64(s string) bool\n```\n\n```go\nfunc ValidDNSName(input string) string\n```\n\n## Types\n\n```go\ntype AESEncryptionService struct {\n\t// contains filtered or unexported fields\n}\n```\nAESEncryptionService implements EncryptionService using AES-256-GCM with PBKDF2\n\n```go\nfunc (s *AESEncryptionService) DecryptData(in string) ([]byte, error)\n```\nDecryptData decrypts the base64-encoded string back to original data Expected format: base64(salt + nonce + ciphertext)\n\n```go\nfunc (s *AESEncryptionService) EncryptData(in []byte) (string, error)\n```\nEncryptData encrypts the input data using AES-256-GCM with PBKDF2 key derivation Returns base64-encoded string containing: salt + nonce + ciphertext\n\n```go\ntype APITokenService interface {\n\tCreate(ctx context.Context, name string, scopes []string, resourceIDs []string, expiresAt *time.Time) (*models.APIToken, string, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.APIToken, *errors.ServiceError)\n\tList(ctx context.Context) ([]*models.APIToken, *errors.ServiceError)\n\tRevoke(ctx context.Context, id string) *errors.ServiceError\n\tValidateToken(ctx context.Context, rawToken string) (*models.APIToken, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewAPITokenService(spec APITokenServiceSpec) APITokenService\n```\n\n```go\ntype APITokenServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype AffectedStackRef struct {\n\tID   string\n\tName string\n}\n```\nAffectedStackRef identifies a stack that depends on an org-level registry credential — either implicitly (live-spec host match, no explicit secret ref) or explicitly (a pinned credential ID recorded in the reference graph, which also spans retained releases).\n\n```go\ntype BackgroundJobEnqueuerDep = clusterresource.BackgroundJobEnqueuerDep\n```\n\n```go\ntype BackgroundJobEnqueuerInjectable = clusterresource.BackgroundJobEnqueuerInjectable\n```\n\n```go\ntype ClusterClientGetter interface {\n\tGetClient(clusterID string) (client.Client, error)\n}\n```\n\n```go\ntype ClusterResourceServiceDeps = clusterresource.ClusterResourceServiceDeps\n```\n\n```go\ntype ClusterResourceServiceInjectable = clusterresource.ClusterResourceServiceInjectable\n```\nAliases: the deps type and injectable interface are defined in the clusterresource leaf package so that generated mocks of services interfaces embedding ClusterResourceServiceInjectable (pkg/mocks) import that leaf instead of pkg/services — importing pkg/services from pkg/mocks would close an import cycle through the in-package tests of pkg/services and its dependents.\n\n```go\ntype ClusterService interface {\n\tBackgroundJobEnqueuerInjectable\n\tGetClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)\n\tGetOwnedClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)\n\tGet(ctx context.Context, ID string) (*models.Cluster, *errors.ServiceError)\n\tInternalGet(ctx context.Context, ID string) (*models.Cluster, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tAddCluster(ctx context.Context, cluster *models.Cluster) (*models.Cluster, *errors.ServiceError)\n\tInternalUpsertSharedComputeCluster(ctx context.Context, spec *models.Cluster) (*models.Cluster, *errors.ServiceError)\n\tInternalListAllClusters(ctx context.Context) ([]*models.Cluster, *errors.ServiceError)\n\tInjectClusterManager(clusterManager clustermanager.ClusterManager)\n\tInternalUpdateClusterInfo(ctx context.Context, clusterID string, info *models.ClusterInfo) *errors.ServiceError\n\tInternalEnsurePlatformWildcardTLS(ctx context.Context, cluster *models.Cluster, cfg *config.PlatformConfig) *errors.ServiceError\n\tDefaultStorageClass(ctx context.Context, clusterID string) (string, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewClusterService(spec ClusterServiceSpec) ClusterService\n```\n\n```go\ntype ClusterServiceSpec struct {\n\tSessionFactory       db.SessionFactory\n\tClusterStore         stores.ClusterStore\n\tClusterManager       clustermanager.ClusterManager\n\tImageRegistryService ImageRegistryService\n\tComputeMode          config.ComputeMode\n\tPlatformTLSEnabled   bool\n\tPermissions          auth.PermissionService\n\tEncryptionService    EncryptionService\n\tLogger               logger.Logger\n}\n```\n\n```go\ntype CredentialResolver = credentials.Resolver\n```\nThe resolver types live in pkg/credentials so packages the services layer depends on (e.g. the stack validator) can consume them without an import cycle. Aliased here so service-layer consumers keep the CredentialResolver naming.\n\n```go\nfunc NewCredentialResolver(spec CredentialResolverSpec) CredentialResolver\n```\n\n```go\ntype CredentialResolverSpec struct {\n\t// RegistryCredentialService is optional; when unset, registry resolution\n\t// falls through to anonymous.\n\tRegistryCredentialService registryCredentialResolverSource\n\t// GitIntegrationService is optional; when unset, git resolution falls\n\t// through to anonymous.\n\tGitIntegrationService gitIntegrationResolverSource\n}\n```\n\n```go\ntype CredentialSource = credentials.Source\n```\nThe resolver types live in pkg/credentials so packages the services layer depends on (e.g. the stack validator) can consume them without an import cycle. Aliased here so service-layer consumers keep the CredentialResolver naming.\n\n```go\ntype DefaultingService[T any] interface {\n\tPopulateDefaultValues(resource T) (T, error)\n}\n```\n\n```go\nfunc NewStackDefaultingService() DefaultingService[*models.Stack]\n```\n\n```go\ntype EncryptionService interface {\n\tEncryptData(in []byte) (string, error)\n\tDecryptData(in string) ([]byte, error)\n}\n```\nEncryptionService defines the interface for encryption operations\n\n```go\nfunc NewAESEncryptionService(spec EncryptionServiceSpec) (EncryptionService, error)\n```\nNewAESEncryptionService creates a new AES encryption service with secure defaults\n\n```go\ntype EncryptionServiceSpec struct {\n\tMasterkey string // Master key for encryption/decryption\n}\n```\n\n```go\ntype GitHubWebhookService interface {\n\t// ProcessGitHubWebhook resolves the integration a delivery belongs to,\n\t// HMAC-verifies the payload against that integration's webhook secret,\n\t// and dispatches installation and pull_request events.\n\tProcessGitHubWebhook(ctx context.Context, event string, payload []byte, signature string) *errors.ServiceError\n}\n```\nGitHubWebhookService is the ingress for GitHub webhook deliveries. It is deliberately separate from GitIntegrationService so webhook dispatch can depend on the preview webhook router without a construction cycle.\n\nHow we find out which org a delivery belongs to:\n\n  - First, look up the git\\_installations row by installation id. This works for both app modes. For the shared platform app it is the ONLY safe way: all orgs share one app id, so the app id cannot tell orgs apart.\n  - If there is no row, match by app id across BYO integrations. Each BYO app has its own unique app id, so a match names exactly one org. This only happens on a BYO app's very first delivery, before its row exists.\n  - If neither works for an installation event, we ack it and do nothing. For the platform app, the setup callback links the install to its org — the webhook never does. Erroring would just make GitHub retry forever.\n\n```go\nfunc NewGitHubWebhookService(spec GitHubWebhookServiceSpec) GitHubWebhookService\n```\n\n```go\ntype GitHubWebhookServiceSpec struct {\n\tStore             stores.GitIntegrationStore\n\tInstallationStore stores.GitInstallationStore\n\tEncryptionService EncryptionService\n\tPreviewWebhook    PreviewWebhookService\n\tLogger            logger.Logger\n\t// PlatformApp mirrors GitIntegrationServiceSpec.PlatformApp; nil means\n\t// per-org apps.\n\tPlatformApp *githubapp.AppCredentials\n}\n```\n\n```go\ntype GitIntegrationService interface {\n\tCreate(ctx context.Context, integration *models.GitIntegration) (*models.GitIntegration, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.GitIntegration, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, organisationID string) ([]*models.GitIntegration, *errors.ServiceError)\n\tUpdate(ctx context.Context, ID string, integration *models.GitIntegration) (*models.GitIntegration, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tVerify(ctx context.Context, ID, repoURL string) *errors.ServiceError\n\n\t// InternalGetForHost returns the decrypted git_credentials integration for\n\t// (org, host). No permission checks; used by the credential resolver.\n\tInternalGetForHost(ctx context.Context, organisationID, host string) (*models.GitIntegration, *errors.ServiceError)\n\t// InternalGetByID returns the decrypted integration by ID. No permission\n\t// checks; used by the credential resolver for explicit overrides.\n\tInternalGetByID(ctx context.Context, ID string) (*models.GitIntegration, *errors.ServiceError)\n\n\t// GitHub App manifest flow, installations, and discovery.\n\tCreateGitHubAppManifest(ctx context.Context, organisationID string) (*models.GitHubAppManifestFlow, *errors.ServiceError)\n\tHandleGitHubManifestCallback(ctx context.Context, code, state string) (string, *errors.ServiceError)\n\tHandleGitHubAppSetup(ctx context.Context, installationID int64, state string) (string, *errors.ServiceError)\n\tListInstallations(ctx context.Context, integrationID string, refresh bool) ([]*models.GitInstallation, *errors.ServiceError)\n\tListRepositories(ctx context.Context, integrationID string, page int, installationUUID string) (*githubapp.RepoPage, *errors.ServiceError)\n\tGetRepository(ctx context.Context, integrationID, owner, repo string) (*githubapp.Repo, *errors.ServiceError)\n\tListRepositoryBranches(ctx context.Context, integrationID, owner, repo string) ([]string, *errors.ServiceError)\n\n\t// InternalMintForRepo mints an installation token for the org's installed\n\t// GitHub App when it covers the repository owner (404 to fall through).\n\tInternalMintForRepo(ctx context.Context, organisationID, repoURL string) (*models.GitHubAppMintResult, *errors.ServiceError)\n\t// InternalMintCloneToken re-mints a token for a known integration; used\n\t// by the hub-side token refresher.\n\tInternalMintCloneToken(ctx context.Context, integrationID, repoURL string) (*models.GitHubAppMintResult, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewGitIntegrationService(spec GitIntegrationServiceSpec) GitIntegrationService\n```\n\n```go\ntype GitIntegrationServiceSpec struct {\n\tStore             stores.GitIntegrationStore\n\tInstallationStore stores.GitInstallationStore\n\tOAuthStateStore   stores.OAuthStateStore\n\tOrganisationStore stores.OrganisationStore\n\tAtomicExecutor    stores.AtomicExecutor\n\tGitHubAppClient   githubapp.Client\n\tEncryptionService EncryptionService\n\tPermissions       auth.PermissionService\n\tLogger            logger.Logger\n\t// ExternalURL is the hub's externally reachable base URL, required for\n\t// the GitHub App manifest flow.\n\tExternalURL string\n\t// PlatformApp is the platform-wide GitHub App every org installs. Nil\n\t// keeps each org creating its own app through the manifest flow.\n\tPlatformApp *githubapp.AppCredentials\n\t// GitClients is optional; it defaults to real git clients.\n\tGitClients verifyGitClientProvider\n}\n```\n\n```go\ntype ImageBuildService interface {\n\tInternalCreate(ctx context.Context, resourceBuild *models.ImageBuild) (*models.ImageBuild, *errors.ServiceError)\n\tInternalUpdateStatus(ctx context.Context, BuildID string, status *models.ImageBuildStatus) *errors.ServiceError\n\tListByResourceName(ctx context.Context, stackID string, resourceName string) ([]*models.ImageBuild, *errors.ServiceError)\n\tListByStackID(ctx context.Context, stackID string) ([]*models.ImageBuild, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)\n\tInternalGetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewImageBuildService(spec ImageBuildServiceSpec) ImageBuildService\n```\n\n```go\ntype ImageBuildServiceSpec struct {\n\tSessionFactory       db.SessionFactory\n\tStackResourceService StackResourceService\n\tLogger               logger.Logger\n\tPermissions          auth.PermissionService\n\tStackStore           stores.StackStore\n}\n```\n\n```go\ntype ImageRegistryService interface {\n\tBackgroundJobEnqueuerInjectable\n\tGet(ctx context.Context, ID string) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tInternalGet(ctx context.Context, ID string) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tInternalMarkAllDeletingByClusterIDWithTx(ctx context.Context, clusterID string) *errors.ServiceError\n\tListForOrg(ctx context.Context, orgID string) ([]*models.ClusterImageRegistry, *errors.ServiceError)\n\tListByClusterID(ctx context.Context, orgID, clusterID string) ([]*models.ClusterImageRegistry, *errors.ServiceError)\n\tCreate(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tInternalCreateSeedRegistry(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tDeleteWithTx(ctx context.Context, orgID string, registry *models.ClusterImageRegistry) *errors.ServiceError\n\tUpdateStatus(ctx context.Context, ID string, status *models.ClusterImageRegistryStatus) *errors.ServiceError\n\tPopulateInClusterRegistryNameForResource(ctx context.Context, orgID, clusterID, stackName string, resource *models.StackResource) *errors.ServiceError\n\tDelete(ctx context.Context, orgID, ID string) *errors.ServiceError\n}\n```\n\n```go\nfunc NewClusterImageRegistryService(spec ImageRegistryServiceSpec) ImageRegistryService\n```\n\n```go\ntype ImageRegistryServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tPermissions    auth.PermissionService\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype LoggingParams struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewLoggingParams(queryValues url.Values) (*LoggingParams, error)\n```\n\n```go\nfunc (p *LoggingParams) Follow() bool\n```\n\n```go\nfunc (p *LoggingParams) Since() string\n```\n\n```go\nfunc (p *LoggingParams) TailLines() int\n```\n\n```go\ntype LoggingService interface {\n\tStreamLogsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)\n\tStreamLogsForStack(ctx context.Context, orgID string, stackID string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)\n\tStreamLogsForBuild(ctx context.Context, orgID string, buildID string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)\n\tClusterResourceServiceInjectable\n}\n```\n\n```go\nfunc NewLoggingService(spec LoggingServiceSpec) LoggingService\n```\n\n```go\ntype LoggingServiceSpec struct {\n\tClusterService       ClusterService\n\tStackResourceService StackResourceService\n\tImageBuildService    ImageBuildService\n\tLogger               logger.Logger\n}\n```\n\n```go\ntype MetricsService interface {\n\tGetMetricsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string) (*models.ResourceMetrics, error)\n\tGetMetricsForStack(ctx context.Context, orgID string, stackID string) (*models.ResourceMetrics, error)\n\tStreamMetricsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string) (interfaces.ServerSideStreamable, error)\n\tStreamMetricsForStack(ctx context.Context, orgID string, stackID string) (interfaces.ServerSideStreamable, error)\n\tClusterResourceServiceInjectable\n}\n```\n\n```go\nfunc NewMetricsService(spec MetricsServiceSpec) MetricsService\n```\n\n```go\ntype MetricsServiceSpec struct {\n\tClusterService       ClusterService\n\tStackResourceService StackResourceService\n\tStackService         StackService\n\tLogger               logger.Logger\n}\n```\n\n```go\ntype MockClusterLoggingService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockClusterLoggingService is a mock of ClusterLoggingService interface.\n\n```go\nfunc NewMockClusterLoggingService(ctrl *gomock.Controller) *MockClusterLoggingService\n```\nNewMockClusterLoggingService creates a new mock instance.\n\n```go\nfunc (m *MockClusterLoggingService) EXPECT() *MockClusterLoggingServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockClusterLoggingService) GetLogsForBuildPod(ctx context.Context, orgID, namespace, buildName string, options clusterresource.LoggingParams) (interfaces.ServerSideStreamable, error)\n```\nGetLogsForBuildPod mocks base method.\n\n```go\nfunc (m *MockClusterLoggingService) GetLogsForResources(ctx context.Context, orgID string, resources []*models.StackResource, options clusterresource.LoggingParams) (interfaces.ServerSideStreamable, error)\n```\nGetLogsForResources mocks base method.\n\n```go\ntype MockClusterLoggingServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockClusterLoggingServiceMockRecorder is the mock recorder for MockClusterLoggingService.\n\n```go\nfunc (mr *MockClusterLoggingServiceMockRecorder) GetLogsForBuildPod(ctx, orgID, namespace, buildName, options any) *gomock.Call\n```\nGetLogsForBuildPod indicates an expected call of GetLogsForBuildPod.\n\n```go\nfunc (mr *MockClusterLoggingServiceMockRecorder) GetLogsForResources(ctx, orgID, resources, options any) *gomock.Call\n```\nGetLogsForResources indicates an expected call of GetLogsForResources.\n\n```go\ntype MockImageBuildService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockImageBuildService is a mock of ImageBuildService interface.\n\n```go\nfunc NewMockImageBuildService(ctrl *gomock.Controller) *MockImageBuildService\n```\nNewMockImageBuildService creates a new mock instance.\n\n```go\nfunc (m *MockImageBuildService) EXPECT() *MockImageBuildServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockImageBuildService) GetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)\n```\nGetByID mocks base method.\n\n```go\nfunc (m *MockImageBuildService) InternalCreate(ctx context.Context, resourceBuild *models.ImageBuild) (*models.ImageBuild, *errors.ServiceError)\n```\nInternalCreate mocks base method.\n\n```go\nfunc (m *MockImageBuildService) InternalGetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)\n```\nInternalGetByID mocks base method.\n\n```go\nfunc (m *MockImageBuildService) InternalUpdateStatus(ctx context.Context, BuildID string, status *models.ImageBuildStatus) *errors.ServiceError\n```\nInternalUpdateStatus mocks base method.\n\n```go\nfunc (m *MockImageBuildService) ListByResourceName(ctx context.Context, stackID, resourceName string) ([]*models.ImageBuild, *errors.ServiceError)\n```\nListByResourceName mocks base method.\n\n```go\nfunc (m *MockImageBuildService) ListByStackID(ctx context.Context, stackID string) ([]*models.ImageBuild, *errors.ServiceError)\n```\nListByStackID mocks base method.\n\n```go\ntype MockImageBuildServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockImageBuildServiceMockRecorder is the mock recorder for MockImageBuildService.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) GetByID(ctx, ID any) *gomock.Call\n```\nGetByID indicates an expected call of GetByID.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) InternalCreate(ctx, resourceBuild any) *gomock.Call\n```\nInternalCreate indicates an expected call of InternalCreate.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) InternalGetByID(ctx, ID any) *gomock.Call\n```\nInternalGetByID indicates an expected call of InternalGetByID.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) InternalUpdateStatus(ctx, BuildID, status any) *gomock.Call\n```\nInternalUpdateStatus indicates an expected call of InternalUpdateStatus.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) ListByResourceName(ctx, stackID, resourceName any) *gomock.Call\n```\nListByResourceName indicates an expected call of ListByResourceName.\n\n```go\nfunc (mr *MockImageBuildServiceMockRecorder) ListByStackID(ctx, stackID any) *gomock.Call\n```\nListByStackID indicates an expected call of ListByStackID.\n\n```go\ntype MockPreviewCommentService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewCommentService is a mock of PreviewCommentService interface.\n\n```go\nfunc NewMockPreviewCommentService(ctrl *gomock.Controller) *MockPreviewCommentService\n```\nNewMockPreviewCommentService creates a new mock instance.\n\n```go\nfunc (m *MockPreviewCommentService) EXPECT() *MockPreviewCommentServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockPreviewCommentService) InternalUpsertComment(ctx context.Context, preview *models.PreviewStack) error\n```\nInternalUpsertComment mocks base method.\n\n```go\ntype MockPreviewCommentServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewCommentServiceMockRecorder is the mock recorder for MockPreviewCommentService.\n\n```go\nfunc (mr *MockPreviewCommentServiceMockRecorder) InternalUpsertComment(ctx, preview any) *gomock.Call\n```\nInternalUpsertComment indicates an expected call of InternalUpsertComment.\n\n```go\ntype MockPreviewStackService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewStackService is a mock of PreviewStackService interface.\n\n```go\nfunc NewMockPreviewStackService(ctrl *gomock.Controller) *MockPreviewStackService\n```\nNewMockPreviewStackService creates a new mock instance.\n\n```go\nfunc (m *MockPreviewStackService) Create(ctx context.Context, preview *models.PreviewStack) (*models.PreviewStack, *errors.ServiceError)\n```\nCreate mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) Delete(ctx context.Context, previewStackID string) *errors.ServiceError\n```\nDelete mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) EXPECT() *MockPreviewStackServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockPreviewStackService) Get(ctx context.Context, previewStackID string) (*models.PreviewStack, *errors.ServiceError)\n```\nGet mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InjectBackgroundJobEnqueuer(dep clusterresource.BackgroundJobEnqueuerDep)\n```\nInjectBackgroundJobEnqueuer mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InternalBuildStackFromContent(ctx context.Context, config *models.StackPreviewConfig, preview *models.PreviewStack, stackFileBytes []byte) (*models.Stack, *errors.OperationError)\n```\nInternalBuildStackFromContent mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InternalCreateFromWebhook(ctx context.Context, config *models.StackPreviewConfig, prNumber, branch, headSHA string) (*models.PreviewStack, *errors.ServiceError)\n```\nInternalCreateFromWebhook mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InternalDeleteFromWebhook(ctx context.Context, previewStackID string) *errors.ServiceError\n```\nInternalDeleteFromWebhook mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InternalFetchStackfile(ctx context.Context, config *models.StackPreviewConfig, commitSHA string) ([]byte, string, *errors.OperationError)\n```\nInternalFetchStackfile mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) InternalSyncFromWebhook(ctx context.Context, previewStackID, headSHA string) *errors.ServiceError\n```\nInternalSyncFromWebhook mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) List(ctx context.Context, projectID string, params stores.ListParams) (*stores.PaginatedResult[*models.PreviewStack], *errors.ServiceError)\n```\nList mocks base method.\n\n```go\nfunc (m *MockPreviewStackService) Sync(ctx context.Context, previewStackID string, opts PreviewSyncOpts) *errors.ServiceError\n```\nSync mocks base method.\n\n```go\ntype MockPreviewStackServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewStackServiceMockRecorder is the mock recorder for MockPreviewStackService.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) Create(ctx, preview any) *gomock.Call\n```\nCreate indicates an expected call of Create.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) Delete(ctx, previewStackID any) *gomock.Call\n```\nDelete indicates an expected call of Delete.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) Get(ctx, previewStackID any) *gomock.Call\n```\nGet indicates an expected call of Get.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InjectBackgroundJobEnqueuer(dep any) *gomock.Call\n```\nInjectBackgroundJobEnqueuer indicates an expected call of InjectBackgroundJobEnqueuer.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InternalBuildStackFromContent(ctx, config, preview, stackFileBytes any) *gomock.Call\n```\nInternalBuildStackFromContent indicates an expected call of InternalBuildStackFromContent.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InternalCreateFromWebhook(ctx, config, prNumber, branch, headSHA any) *gomock.Call\n```\nInternalCreateFromWebhook indicates an expected call of InternalCreateFromWebhook.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InternalDeleteFromWebhook(ctx, previewStackID any) *gomock.Call\n```\nInternalDeleteFromWebhook indicates an expected call of InternalDeleteFromWebhook.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InternalFetchStackfile(ctx, config, commitSHA any) *gomock.Call\n```\nInternalFetchStackfile indicates an expected call of InternalFetchStackfile.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) InternalSyncFromWebhook(ctx, previewStackID, headSHA any) *gomock.Call\n```\nInternalSyncFromWebhook indicates an expected call of InternalSyncFromWebhook.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) List(ctx, projectID, params any) *gomock.Call\n```\nList indicates an expected call of List.\n\n```go\nfunc (mr *MockPreviewStackServiceMockRecorder) Sync(ctx, previewStackID, opts any) *gomock.Call\n```\nSync indicates an expected call of Sync.\n\n```go\ntype MockPreviewWebhookService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewWebhookService is a mock of PreviewWebhookService interface.\n\n```go\nfunc NewMockPreviewWebhookService(ctrl *gomock.Controller) *MockPreviewWebhookService\n```\nNewMockPreviewWebhookService creates a new mock instance.\n\n```go\nfunc (m *MockPreviewWebhookService) EXPECT() *MockPreviewWebhookServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockPreviewWebhookService) HandlePullRequest(ctx context.Context, ev PullRequestEvent) *errors.ServiceError\n```\nHandlePullRequest mocks base method.\n\n```go\ntype MockPreviewWebhookServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockPreviewWebhookServiceMockRecorder is the mock recorder for MockPreviewWebhookService.\n\n```go\nfunc (mr *MockPreviewWebhookServiceMockRecorder) HandlePullRequest(ctx, ev any) *gomock.Call\n```\nHandlePullRequest indicates an expected call of HandlePullRequest.\n\n```go\ntype MockReleaseEventRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockReleaseEventRecorder is a mock of ReleaseEventRecorder interface.\n\n```go\nfunc NewMockReleaseEventRecorder(ctrl *gomock.Controller) *MockReleaseEventRecorder\n```\nNewMockReleaseEventRecorder creates a new mock instance.\n\n```go\nfunc (m *MockReleaseEventRecorder) EXPECT() *MockReleaseEventRecorderMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockReleaseEventRecorder) Record(ctx context.Context, input ReleaseEventInput) (*models.ReleaseEvent, *errors.ServiceError)\n```\nRecord mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordBuildEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, buildID string, failure *models.BuildFailureDetail) *errors.ServiceError\n```\nRecordBuildEvent mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseCheckFailed(ctx context.Context, release *models.StackRelease, resourceName, check, reason string) *errors.ServiceError\n```\nRecordReleaseCheckFailed mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseChecksPassed(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n```\nRecordReleaseChecksPassed mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseChecksStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n```\nRecordReleaseChecksStarted mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseCreated(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n```\nRecordReleaseCreated mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n```\nRecordReleaseStarted mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordReleaseTerminal(ctx context.Context, release *models.StackRelease, state models.StackReleaseState, message string) *errors.ServiceError\n```\nRecordReleaseTerminal mocks base method.\n\n```go\nfunc (m *MockReleaseEventRecorder) RecordResourceEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, reason, message string) *errors.ServiceError\n```\nRecordResourceEvent mocks base method.\n\n```go\ntype MockReleaseEventRecorderMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockReleaseEventRecorderMockRecorder is the mock recorder for MockReleaseEventRecorder.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) Record(ctx, input any) *gomock.Call\n```\nRecord indicates an expected call of Record.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordBuildEvent(ctx, release, resourceName, eventType, buildID, failure any) *gomock.Call\n```\nRecordBuildEvent indicates an expected call of RecordBuildEvent.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseCheckFailed(ctx, release, resourceName, check, reason any) *gomock.Call\n```\nRecordReleaseCheckFailed indicates an expected call of RecordReleaseCheckFailed.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseChecksPassed(ctx, release any) *gomock.Call\n```\nRecordReleaseChecksPassed indicates an expected call of RecordReleaseChecksPassed.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseChecksStarted(ctx, release any) *gomock.Call\n```\nRecordReleaseChecksStarted indicates an expected call of RecordReleaseChecksStarted.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseCreated(ctx, release any) *gomock.Call\n```\nRecordReleaseCreated indicates an expected call of RecordReleaseCreated.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseStarted(ctx, release any) *gomock.Call\n```\nRecordReleaseStarted indicates an expected call of RecordReleaseStarted.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseTerminal(ctx, release, state, message any) *gomock.Call\n```\nRecordReleaseTerminal indicates an expected call of RecordReleaseTerminal.\n\n```go\nfunc (mr *MockReleaseEventRecorderMockRecorder) RecordResourceEvent(ctx, release, resourceName, eventType, reason, message any) *gomock.Call\n```\nRecordResourceEvent indicates an expected call of RecordResourceEvent.\n\n```go\ntype MockStackService struct {\n\t// contains filtered or unexported fields\n}\n```\nMockStackService is a mock of StackService interface.\n\n```go\nfunc NewMockStackService(ctrl *gomock.Controller) *MockStackService\n```\nNewMockStackService creates a new mock instance.\n\n```go\nfunc (m *MockStackService) ApplyStack(ctx context.Context, spec *models.Stack) (*models.Stack, bool, *errors.ServiceError)\n```\nApplyStack mocks base method.\n\n```go\nfunc (m *MockStackService) CreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nCreateStack mocks base method.\n\n```go\nfunc (m *MockStackService) CreateStackConnection(ctx context.Context, stackID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n```\nCreateStackConnection mocks base method.\n\n```go\nfunc (m *MockStackService) CreateStackVolume(ctx context.Context, stackID string, volume *models.Volume) (*models.Volume, *errors.ServiceError)\n```\nCreateStackVolume mocks base method.\n\n```go\nfunc (m *MockStackService) DeleteStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n```\nDeleteStack mocks base method.\n\n```go\nfunc (m *MockStackService) DeleteStackConnection(ctx context.Context, stackID, connectionID string) *errors.ServiceError\n```\nDeleteStackConnection mocks base method.\n\n```go\nfunc (m *MockStackService) EXPECT() *MockStackServiceMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockStackService) GetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n```\nGetStack mocks base method.\n\n```go\nfunc (m *MockStackService) GetStackTopology(ctx context.Context, ID string) (*models.StackTopology, *errors.ServiceError)\n```\nGetStackTopology mocks base method.\n\n```go\nfunc (m *MockStackService) GetStacksByOrganisationID(ctx context.Context, organisationID string) ([]*models.Stack, *errors.ServiceError)\n```\nGetStacksByOrganisationID mocks base method.\n\n```go\nfunc (m *MockStackService) GetStacksByProjectID(ctx context.Context, projectID string) ([]*models.Stack, *errors.ServiceError)\n```\nGetStacksByProjectID mocks base method.\n\n```go\nfunc (m *MockStackService) InjectBackgroundJobEnqueuer(dep clusterresource.BackgroundJobEnqueuerDep)\n```\nInjectBackgroundJobEnqueuer mocks base method.\n\n```go\nfunc (m *MockStackService) InjectClusterResourceServiceDeps(deps clusterresource.ClusterResourceServiceDeps)\n```\nInjectClusterResourceServiceDeps mocks base method.\n\n```go\nfunc (m *MockStackService) InternalCreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nInternalCreateStack mocks base method.\n\n```go\nfunc (m *MockStackService) InternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError\n```\nInternalDeleteFromDB mocks base method.\n\n```go\nfunc (m *MockStackService) InternalDeleteStack(ctx context.Context, stack *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nInternalDeleteStack mocks base method.\n\n```go\nfunc (m *MockStackService) InternalGetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n```\nInternalGetStack mocks base method.\n\n```go\nfunc (m *MockStackService) InternalList(ctx context.Context, query string, args ...any) ([]*models.Stack, *errors.ServiceError)\n```\nInternalList mocks base method.\n\n```go\nfunc (m *MockStackService) InternalUpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nInternalUpdateStack mocks base method.\n\n```go\nfunc (m *MockStackService) ListStackConnections(ctx context.Context, stackID string) (models.StackConnections, *errors.ServiceError)\n```\nListStackConnections mocks base method.\n\n```go\nfunc (m *MockStackService) ListStacksForCurrentUser(ctx context.Context, orgID string) ([]*models.Stack, *errors.ServiceError)\n```\nListStacksForCurrentUser mocks base method.\n\n```go\nfunc (m *MockStackService) SetReleaseService(rs releaseServiceForStack)\n```\nSetReleaseService mocks base method.\n\n```go\nfunc (m *MockStackService) UpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nUpdateStack mocks base method.\n\n```go\nfunc (m *MockStackService) UpdateStackConnection(ctx context.Context, stackID, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n```\nUpdateStackConnection mocks base method.\n\n```go\nfunc (m *MockStackService) UpdateStackCrRevision(ctx context.Context, ID, revision string) *errors.ServiceError\n```\nUpdateStackCrRevision mocks base method.\n\n```go\nfunc (m *MockStackService) UpdateStackShell(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n```\nUpdateStackShell mocks base method.\n\n```go\nfunc (m *MockStackService) UpdateStatus(ctx context.Context, ID string, status *models.StackStatus) *errors.ServiceError\n```\nUpdateStatus mocks base method.\n\n```go\ntype MockStackServiceMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockStackServiceMockRecorder is the mock recorder for MockStackService.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) ApplyStack(ctx, spec any) *gomock.Call\n```\nApplyStack indicates an expected call of ApplyStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) CreateStack(ctx, spec any) *gomock.Call\n```\nCreateStack indicates an expected call of CreateStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) CreateStackConnection(ctx, stackID, connection any) *gomock.Call\n```\nCreateStackConnection indicates an expected call of CreateStackConnection.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) CreateStackVolume(ctx, stackID, volume any) *gomock.Call\n```\nCreateStackVolume indicates an expected call of CreateStackVolume.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) DeleteStack(ctx, ID any) *gomock.Call\n```\nDeleteStack indicates an expected call of DeleteStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) DeleteStackConnection(ctx, stackID, connectionID any) *gomock.Call\n```\nDeleteStackConnection indicates an expected call of DeleteStackConnection.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) GetStack(ctx, ID any) *gomock.Call\n```\nGetStack indicates an expected call of GetStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) GetStackTopology(ctx, ID any) *gomock.Call\n```\nGetStackTopology indicates an expected call of GetStackTopology.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) GetStacksByOrganisationID(ctx, organisationID any) *gomock.Call\n```\nGetStacksByOrganisationID indicates an expected call of GetStacksByOrganisationID.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) GetStacksByProjectID(ctx, projectID any) *gomock.Call\n```\nGetStacksByProjectID indicates an expected call of GetStacksByProjectID.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InjectBackgroundJobEnqueuer(dep any) *gomock.Call\n```\nInjectBackgroundJobEnqueuer indicates an expected call of InjectBackgroundJobEnqueuer.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InjectClusterResourceServiceDeps(deps any) *gomock.Call\n```\nInjectClusterResourceServiceDeps indicates an expected call of InjectClusterResourceServiceDeps.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalCreateStack(ctx, spec any) *gomock.Call\n```\nInternalCreateStack indicates an expected call of InternalCreateStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalDeleteFromDB(ctx, ID any) *gomock.Call\n```\nInternalDeleteFromDB indicates an expected call of InternalDeleteFromDB.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalDeleteStack(ctx, stack any) *gomock.Call\n```\nInternalDeleteStack indicates an expected call of InternalDeleteStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalGetStack(ctx, ID any) *gomock.Call\n```\nInternalGetStack indicates an expected call of InternalGetStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalList(ctx, query any, args ...any) *gomock.Call\n```\nInternalList indicates an expected call of InternalList.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) InternalUpdateStack(ctx, ID, spec any) *gomock.Call\n```\nInternalUpdateStack indicates an expected call of InternalUpdateStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) ListStackConnections(ctx, stackID any) *gomock.Call\n```\nListStackConnections indicates an expected call of ListStackConnections.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) ListStacksForCurrentUser(ctx, orgID any) *gomock.Call\n```\nListStacksForCurrentUser indicates an expected call of ListStacksForCurrentUser.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) SetReleaseService(rs any) *gomock.Call\n```\nSetReleaseService indicates an expected call of SetReleaseService.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) UpdateStack(ctx, ID, spec any) *gomock.Call\n```\nUpdateStack indicates an expected call of UpdateStack.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) UpdateStackConnection(ctx, stackID, connectionID, connection any) *gomock.Call\n```\nUpdateStackConnection indicates an expected call of UpdateStackConnection.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) UpdateStackCrRevision(ctx, ID, revision any) *gomock.Call\n```\nUpdateStackCrRevision indicates an expected call of UpdateStackCrRevision.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) UpdateStackShell(ctx, ID, spec any) *gomock.Call\n```\nUpdateStackShell indicates an expected call of UpdateStackShell.\n\n```go\nfunc (mr *MockStackServiceMockRecorder) UpdateStatus(ctx, ID, status any) *gomock.Call\n```\nUpdateStatus indicates an expected call of UpdateStatus.\n\n```go\ntype NamespaceService interface {\n\tCreateInDB(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)\n\tCreateInCluster(ctx context.Context, ns *models.Namespace) *errors.ServiceError\n\tCreateInDBWithTx(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)\n\tGet(ctx context.Context, id string) (*models.Namespace, *errors.ServiceError)\n\tDeleteFromDB(ctx context.Context, id string) *errors.ServiceError\n\tInternalDeleteFromDB(ctx context.Context, id string) *errors.ServiceError\n\tDeleteFromDBWithTx(ctx context.Context, id string) *errors.ServiceError\n\tUpdateInDB(ctx context.Context, id string, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)\n\tListByOrganisation(ctx context.Context, organisationID string) ([]*models.Namespace, *errors.ServiceError)\n\tListByStack(ctx context.Context, stackID string) ([]*models.Namespace, *errors.ServiceError)\n\tPrepareNamespaceForStack(ctx context.Context, stack *models.Stack) (*models.Namespace, *errors.ServiceError)\n\tPrepareNamespaceForAddon(ctx context.Context, addon models.Addon, orgID string) (*models.Namespace, *errors.ServiceError)\n\tClusterResourceServiceInjectable\n}\n```\n\n```go\nfunc NewNamespaceService(spec NamespaceServiceSpec) NamespaceService\n```\n\n```go\ntype NamespaceServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tLogger         logger.Logger\n\tSharedCompute  bool\n}\n```\n\n```go\ntype ObjectStoreService interface {\n\tCreate(ctx context.Context, objectStore *models.ObjectStore) (*models.ObjectStore, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.ObjectStore, *errors.ServiceError)\n\tInternalGetByID(ctx context.Context, ID string) (*models.ObjectStore, *errors.ServiceError)\n\tGetByName(ctx context.Context, organisationID, name string) (*models.ObjectStore, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, objectStore *models.ObjectStore) (*models.ObjectStore, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tListByOrganisation(ctx context.Context, organisationID string) ([]*models.ObjectStore, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string) ([]*models.ObjectStore, *errors.ServiceError)\n\tListObjectStoresForCurrentUser(ctx context.Context, orgID string) ([]*models.ObjectStore, *errors.ServiceError)\n\tValidateObjectStoreExists(ctx context.Context, objectStoreID string) (bool, *errors.ServiceError)\n\tTestConnection(ctx context.Context, objectStoreID string) *errors.ServiceError\n\tUpdateStatus(ctx context.Context, id string, status models.ObjectStoreStatus) *errors.ServiceError\n}\n```\n\n```go\nfunc NewObjectStoreService(spec ObjectStoreServiceSpec) ObjectStoreService\n```\n\n```go\ntype ObjectStoreServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tSecretService  SecretService\n\tProjectService ProjectService\n\tClusterManager clustermanager.ClusterManager\n\tPermissions    auth.PermissionService\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype OrgInviteService interface {\n\tBackgroundJobEnqueuerInjectable\n\tCreate(ctx context.Context, email, projectName string, role models.ProjectRole, expiresInDays int) (*models.OrgInvite, string, *errors.ServiceError)\n\tList(ctx context.Context, orgID string, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n\tGetByID(ctx context.Context, orgID, id string) (*models.OrgInvite, *errors.ServiceError)\n\tRevoke(ctx context.Context, orgID, id string) *errors.ServiceError\n\tResend(ctx context.Context, orgID, id string) *errors.ServiceError\n\tPublicGetInviteInfo(ctx context.Context, rawToken string) (*models.OrgInvite, *errors.ServiceError)\n\tValidateAndConsume(ctx context.Context, rawToken, email string) (*models.OrgInvite, *errors.ServiceError)\n\tInternalGetByID(ctx context.Context, id string) (*models.OrgInvite, *errors.ServiceError)\n\tInternalGetPendingUnsent(ctx context.Context, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n\tInternalMarkEmailSent(ctx context.Context, id string) *errors.ServiceError\n\tInternalMarkEmailError(ctx context.Context, id string, errMsg string) *errors.ServiceError\n\tInternalDecryptToken(ctx context.Context, encryptedToken string) (string, *errors.ServiceError)\n\tInternalListExpiredOrPastDue(ctx context.Context, now time.Time, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n\tInternalMarkExpiredAndDelete(ctx context.Context, invites []*models.OrgInvite) *errors.ServiceError\n\tInternalWithTransaction(ctx context.Context, fn func(ctx context.Context) *errors.ServiceError) *errors.ServiceError\n}\n```\n\n```go\nfunc NewOrgInviteService(spec OrgInviteServiceSpec) OrgInviteService\n```\n\n```go\ntype OrgInviteServiceSpec struct {\n\tInviteStore       stores.OrgInviteStore\n\tProjectService    ProjectService\n\tUserService       UserService\n\tEncryptionService EncryptionService\n\tPermissions       auth.PermissionService\n\tLogger            logger.Logger\n}\n```\n\n```go\ntype OrganisationDomainsService interface {\n\tCreate(ctx context.Context, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)\n\tInternalCreateWithTx(ctx context.Context, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)\n\tGet(ctx context.Context, id string) (*models.OrganisationDomain, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tInternalDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tUpdate(ctx context.Context, id string, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)\n\tListByOrganisationID(ctx context.Context, organisationID string) ([]*models.OrganisationDomain, *errors.ServiceError)\n\t// TODO\n\tGetDefaultDomainForOrganisation(ctx context.Context, organisationID string) (*models.OrganisationDomain, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewOrganisationDomainsService(spec OrganisationDomainsServiceSpec) OrganisationDomainsService\n```\n\n```go\ntype OrganisationDomainsServiceSpec struct {\n\tSessionFactory        db.SessionFactory\n\tLogger                logger.Logger\n\tCustomDomainsDisabled bool\n}\n```\n\n```go\ntype OrganisationService interface {\n\tInternalCreate(ctx context.Context, spec *models.Organisation) (*models.Organisation, *errors.ServiceError)\n\tInternalGetPlatformOrg(ctx context.Context) (*models.Organisation, *errors.ServiceError)\n\tGet(ctx context.Context, ID string) (*models.Organisation, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tUpdate(ctx context.Context, ID string, spec *models.Organisation) (*models.Organisation, *errors.ServiceError)\n\n\tPromoteToOrgAdmin(ctx context.Context, orgID, userID string) *errors.ServiceError\n\tDemoteOrgAdmin(ctx context.Context, orgID, userID, projectID string, role models.ProjectRole) *errors.ServiceError\n\tListOrgAdmins(ctx context.Context, orgID string) ([]*models.User, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewOrganisationService(spec OrganisationServiceSpec) OrganisationService\n```\n\n```go\ntype OrganisationServiceSpec struct {\n\tSessionFactory            db.SessionFactory\n\tOrganisationDomainService OrganisationDomainsService\n\tImageRegistryService      ImageRegistryService\n\tOrgRegistryDefaults       models.OrgRegistryDefaults\n\tStackQueryService         StackQueryService\n\tProjectService            ProjectService\n\tPolicyManager             resourceaccess.ResourceAccessPolicyManager\n\tPermissions               auth.PermissionService\n\tLogger                    logger.Logger\n\tCustomDomainsDisabled     bool\n}\n```\n\n```go\ntype PostgresAddonDatabaseService interface {\n\tCreate(ctx context.Context, database *models.PostgresAddonDatabase) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, database *models.PostgresAddonDatabase) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tGetByName(ctx context.Context, postgresAddonID, name string) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, database *models.PostgresAddonDatabase) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, id string, database *models.PostgresAddonDatabase) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tListByPostgresAddon(ctx context.Context, postgresAddonID string) ([]*models.PostgresAddonDatabase, *errors.ServiceError)\n\tValidateDatabaseExists(ctx context.Context, databaseID string) (bool, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewPostgresAddonDatabaseService(spec PostgresAddonDatabaseServiceSpec) PostgresAddonDatabaseService\n```\n\n```go\ntype PostgresAddonDatabaseServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype PostgresAddonService interface {\n\tCreatePostgresAddon(ctx context.Context, postgresAddon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tGetPostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)\n\tGetPostgresAddonByName(ctx context.Context, organisationID, name string) (*models.PostgresAddon, *errors.ServiceError)\n\tUpdatePostgresAddon(ctx context.Context, id string, postgresAddon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tDeletePostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)\n\tListPostgresAddonsByOrganisation(ctx context.Context, organisationID string) ([]*models.PostgresAddon, *errors.ServiceError)\n\tListPostgresAddonsForCurrentUser(ctx context.Context, orgID string) ([]*models.PostgresAddon, *errors.ServiceError)\n\tListPostgresAddonsByProjectID(ctx context.Context, projectID string) ([]*models.PostgresAddon, *errors.ServiceError)\n\tUpdatePostgresAddonStatus(ctx context.Context, id string, status *models.PostgresAddonStatus) *errors.ServiceError\n\n\t// Lifecycle operations\n\tTriggerBackup(ctx context.Context, id string) *errors.ServiceError\n\tTriggerHibernate(ctx context.Context, id string, enabled bool) *errors.ServiceError\n\tTriggerFence(ctx context.Context, id string, enabled bool) *errors.ServiceError\n\n\t// Backup operations\n\tListBackups(ctx context.Context, postgresAddonID string) ([]*models.PostgresBackup, *errors.ServiceError)\n\n\t// Credentials\n\tGetCredentials(ctx context.Context, addonID string, database string, superuser bool) (*models.PostgresCredentials, *errors.ServiceError)\n\n\t// Internal operations\n\tInternalGetPostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)\n\tInternalGetCredentials(ctx context.Context, addonID string, database string, superuser bool) (*models.PostgresCredentials, *errors.ServiceError)\n\tInternalDeleteFromDB(ctx context.Context, id string) *errors.ServiceError\n\tInternalList(ctx context.Context, query string, args ...any) ([]*models.PostgresAddon, *errors.ServiceError)\n\n\tInjectClusterManager(clusterManager clustermanager.ClusterManager)\n\n\tBackgroundJobEnqueuerInjectable\n\tClusterResourceServiceInjectable\n}\n```\n\n```go\nfunc NewPostgresAddonService(spec PostgresAddonServiceSpec) PostgresAddonService\n```\n\n```go\ntype PostgresAddonServiceSpec struct {\n\tSessionFactory         db.SessionFactory\n\tReferenceService       ReferenceService\n\tObjectStoreService     ObjectStoreService\n\tClusterService         ClusterService\n\tNamespaceService       NamespaceService\n\tSecretService          SecretService\n\tPostgresBackupService  PostgresBackupService\n\tClusterManager         clustermanager.ClusterManager\n\tProjectService         ProjectService\n\tLogger                 logger.Logger\n\tPermissions            auth.PermissionService\n\tExternalImportDisabled bool\n\tComputePolicy          computequota.Policy\n}\n```\n\n```go\ntype PostgresBackupService interface {\n\tCreate(ctx context.Context, backup *models.PostgresBackup) (*models.PostgresBackup, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.PostgresBackup, *errors.ServiceError)\n\tGetByName(ctx context.Context, postgresAddonID string, name string) (*models.PostgresBackup, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, backup *models.PostgresBackup) (*models.PostgresBackup, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tListByPostgresAddon(ctx context.Context, postgresAddonID string) ([]*models.PostgresBackup, *errors.ServiceError)\n\tValidateBackupExists(ctx context.Context, backupID string) (bool, *errors.ServiceError)\n\n\t// Status update methods for backup lifecycle\n\tUpdateBackupStatus(ctx context.Context, backupID, phase string, error *string) *errors.ServiceError\n\tMarkBackupCompleted(ctx context.Context, backupID string, sizeBytes *int32) *errors.ServiceError\n\tMarkBackupFailed(ctx context.Context, backupID string, errorMessage string) *errors.ServiceError\n}\n```\n\n```go\nfunc NewPostgresBackupService(spec PostgresBackupServiceSpec) PostgresBackupService\n```\n\n```go\ntype PostgresBackupServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype PreviewCommentService interface {\n\t// InternalUpsertComment renders the comment for the preview's current\n\t// state and creates or edits the sticky PR comment. On create it sets\n\t// preview.GitHubCommentID in place; the caller owns persisting it.\n\tInternalUpsertComment(ctx context.Context, preview *models.PreviewStack) error\n}\n```\nPreviewCommentService maintains the sticky PR comment for a preview stack. Perm-less: reached only from the preview worker, never from user requests.\n\n```go\nfunc NewPreviewCommentService(spec PreviewCommentServiceSpec) PreviewCommentService\n```\n\n```go\ntype PreviewCommentServiceSpec struct {\n\tConfigStore     stores.StackPreviewConfigStore\n\tGitIntegrations GitIntegrationService\n\tCommenter       githubapp.PullRequestCommenter\n\tLogger          logger.Logger\n}\n```\n\n```go\ntype PreviewStackService interface {\n\tBackgroundJobEnqueuerInjectable\n\tCreate(ctx context.Context, preview *models.PreviewStack) (*models.PreviewStack, *errors.ServiceError)\n\tSync(ctx context.Context, previewStackID string, opts PreviewSyncOpts) *errors.ServiceError\n\tDelete(ctx context.Context, previewStackID string) *errors.ServiceError\n\tGet(ctx context.Context, previewStackID string) (*models.PreviewStack, *errors.ServiceError)\n\tList(ctx context.Context, projectID string, params stores.ListParams) (*stores.PaginatedResult[*models.PreviewStack], *errors.ServiceError)\n\tInternalFetchStackfile(ctx context.Context, config *models.StackPreviewConfig, commitSHA string) (content []byte, hash string, opErr *errors.OperationError)\n\tInternalBuildStackFromContent(ctx context.Context, config *models.StackPreviewConfig, preview *models.PreviewStack, stackFileBytes []byte) (*models.Stack, *errors.OperationError)\n\t// InternalCreateFromWebhook provisions a preview stack from a GitHub PR\n\t// webhook event. No permission check: the webhook has already been\n\t// authenticated and authorized by config resolution (org+repo match).\n\tInternalCreateFromWebhook(ctx context.Context, config *models.StackPreviewConfig, prNumber, branch, headSHA string) (*models.PreviewStack, *errors.ServiceError)\n\t// InternalSyncFromWebhook re-syncs an existing preview stack to a new head\n\t// commit from a GitHub PR webhook event. No permission check.\n\tInternalSyncFromWebhook(ctx context.Context, previewStackID, headSHA string) *errors.ServiceError\n\t// InternalDeleteFromWebhook tears down a preview stack from a GitHub PR\n\t// webhook event (PR closed/merged). No permission check.\n\tInternalDeleteFromWebhook(ctx context.Context, previewStackID string) *errors.ServiceError\n}\n```\n\n```go\nfunc NewPreviewStackService(spec PreviewStackServiceSpec) PreviewStackService\n```\n\n```go\ntype PreviewStackServiceSpec struct {\n\tStore              stores.PreviewStackStore\n\tConfigStore        stores.StackPreviewConfigStore\n\tStackService       StackService\n\tReleaseService     StackReleaseService\n\tSecretService      SecretService\n\tCredentialResolver CredentialResolver\n\tPermissions        auth.PermissionService\n\tLogger             logger.Logger\n}\n```\n\n```go\ntype PreviewSyncOpts struct {\n\tCommit           string\n\tStackfileContent *string\n\tForceSync        bool\n\tImageOverrides   map[string]string\n}\n```\n\n```go\ntype PreviewWebhookService interface {\n\tHandlePullRequest(ctx context.Context, ev PullRequestEvent) *errors.ServiceError\n}\n```\n\n```go\nfunc NewPreviewWebhookService(spec PreviewWebhookServiceSpec) PreviewWebhookService\n```\n\n```go\ntype PreviewWebhookServiceSpec struct {\n\tConfigStore       stores.StackPreviewConfigStore\n\tPreviewStackStore stores.PreviewStackStore\n\tPreviewService    PreviewStackService\n\tLogger            logger.Logger\n}\n```\n\n```go\ntype ProjectService interface {\n\tCreateProject(ctx context.Context, orgID string, project *models.Project) (*models.Project, *errors.ServiceError)\n\tGetProject(ctx context.Context, orgID, projectID string) (*models.Project, *errors.ServiceError)\n\tGetProjectByOrgAndName(ctx context.Context, orgID, name string) (*models.Project, *errors.ServiceError)\n\tListProjects(ctx context.Context, orgID string) ([]*models.Project, *errors.ServiceError)\n\tUpdateProject(ctx context.Context, id string, project *models.Project) (*models.Project, *errors.ServiceError)\n\tDeleteProject(ctx context.Context, id string) *errors.ServiceError\n\tInternalCreateDefaultProject(ctx context.Context, orgID string) (*models.Project, *errors.ServiceError)\n\tInternalGetProjectByOrgAndName(ctx context.Context, orgID, name string) (*models.Project, *errors.ServiceError)\n\tInternalAddMember(ctx context.Context, projectID, userID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)\n\n\tAddMember(ctx context.Context, projectID, userID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)\n\tRemoveMember(ctx context.Context, membershipID string) *errors.ServiceError\n\tUpdateMemberRole(ctx context.Context, membershipID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)\n\tListMembers(ctx context.Context, projectID string) ([]*models.ProjectMembership, *errors.ServiceError)\n\tListUserProjects(ctx context.Context, userID string) ([]*models.ProjectMembership, *errors.ServiceError)\n\tInternalListUserProjects(ctx context.Context, userID, orgID string) ([]*models.ProjectMembership, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewProjectService(spec ProjectServiceSpec) ProjectService\n```\n\n```go\ntype ProjectServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tPolicyManager  resourceaccess.ResourceAccessPolicyManager\n\tPermissions    auth.PermissionService\n\tLogger         logger.Logger\n}\n```\n\n```go\ntype PullRequestAction string\n```\nPullRequestAction is the GitHub pull\\_request webhook action that triggered a PullRequestEvent.\n\n```go\nconst (\n\tPRActionOpened      PullRequestAction = \"opened\"\n\tPRActionReopened    PullRequestAction = \"reopened\"\n\tPRActionSynchronize PullRequestAction = \"synchronize\"\n\tPRActionClosed      PullRequestAction = \"closed\"\n)\n```\n\n```go\ntype PullRequestEvent struct {\n\tOrganisationID string\n\tRepoURL        string\n\tBranch         string // PR head ref\n\tBaseBranch     string // PR base ref\n\tHeadSHA        string\n\tPRNumber       string\n\tAction         PullRequestAction\n}\n```\nPullRequestEvent carries the fields of a GitHub pull\\_request webhook payload that are needed to route preview stack provisioning.\n\n```go\ntype ReferenceService interface {\n\tReprojectSpec(ctx context.Context, stackID string) *errors.ServiceError\n\tProjectRelease(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n\tIsReferentInUse(ctx context.Context, referentType models.ReferentType, referentID string) (\n\t\tbool,\n\t\t[]models.ResourceReference,\n\t\t*errors.ServiceError,\n\t)\n}\n```\n\n```go\nfunc NewReferenceService(spec ReferenceServiceSpec) ReferenceService\n```\n\n```go\ntype ReferenceServiceSpec struct {\n\tSessionFactory db.SessionFactory\n\tStackStore     stores.StackStore\n}\n```\n\n```go\ntype RegistryCredentialDeleteResult struct {\n\tAffectedStacks []AffectedStackRef\n}\n```\nRegistryCredentialDeleteResult reports which live stacks were resolving against a deleted credential. Deletion is not blocked; this is rotation visibility.\n\n```go\ntype RegistryCredentialService interface {\n\tCreate(ctx context.Context, credential *models.RegistryCredential) (*models.RegistryCredential, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.RegistryCredential, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, organisationID string) ([]*models.RegistryCredential, *errors.ServiceError)\n\tUpdate(ctx context.Context, ID string, credential *models.RegistryCredential) (*models.RegistryCredential, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) (*RegistryCredentialDeleteResult, *errors.ServiceError)\n\tVerify(ctx context.Context, ID, repository string, purpose models.RegistryCredentialPurpose) *errors.ServiceError\n\n\t// InternalGetForHost returns the decrypted credential covering the given\n\t// purpose for (org, normalized host). No permission checks; used by the\n\t// credential resolver.\n\tInternalGetForHost(ctx context.Context, organisationID, host string, purpose models.RegistryCredentialPurpose) (*models.RegistryCredential, *errors.ServiceError)\n\t// InternalGetByID returns the decrypted credential by ID. No permission\n\t// checks; used by the credential resolver for explicit overrides.\n\tInternalGetByID(ctx context.Context, ID string) (*models.RegistryCredential, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewRegistryCredentialService(spec RegistryCredentialServiceSpec) RegistryCredentialService\n```\n\n```go\ntype RegistryCredentialServiceSpec struct {\n\tStore             stores.RegistryCredentialStore\n\tStackStore        stores.StackStore\n\tReferenceService  ReferenceService\n\tEncryptionService EncryptionService\n\tPermissions       auth.PermissionService\n\tLogger            logger.Logger\n\t// RegistryClients is optional; it defaults to real registry clients.\n\tRegistryClients verifyRegistryClientProvider\n}\n```\n\n```go\ntype RegistryPurpose = credentials.RegistryPurpose\n```\nThe resolver types live in pkg/credentials so packages the services layer depends on (e.g. the stack validator) can consume them without an import cycle. Aliased here so service-layer consumers keep the CredentialResolver naming.\n\n```go\ntype ReleaseEventInput struct {\n\tRelease      *models.StackRelease\n\tResourceName string // required for resource-scoped types\n\tType         models.ReleaseEventType\n\tMessage      string\n\tDedupeKey    string // defaulted from type/resource when empty\n\tLinks        models.ReleaseEventLinks\n\tMetadata     models.ReleaseEventMetadata\n}\n```\n\n```go\ntype ReleaseEventPage struct {\n\tEvents            []*models.ReleaseEvent\n\tNextAfterSequence int\n}\n```\nReleaseEventPage is a sequence-cursor page of release events.\n\n```go\ntype ReleaseEventRecorder interface {\n\tRecord(ctx context.Context, input ReleaseEventInput) (*models.ReleaseEvent, *errors.ServiceError)\n\tRecordReleaseCreated(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n\tRecordReleaseChecksStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n\tRecordReleaseCheckFailed(ctx context.Context, release *models.StackRelease, resourceName, check, reason string) *errors.ServiceError\n\tRecordReleaseChecksPassed(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n\tRecordReleaseStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError\n\tRecordBuildEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, buildID string, failure *models.BuildFailureDetail) *errors.ServiceError\n\tRecordResourceEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, reason string, message string) *errors.ServiceError\n\tRecordReleaseTerminal(ctx context.Context, release *models.StackRelease, state models.StackReleaseState, message string) *errors.ServiceError\n}\n```\n\n```go\nfunc NewReleaseEventRecorder(spec ReleaseEventRecorderSpec) ReleaseEventRecorder\n```\n\n```go\ntype ReleaseEventRecorderSpec struct {\n\tStore stores.ReleaseEventStore\n}\n```\n\n```go\ntype ResolvedGitCredential = credentials.ResolvedGitCredential\n```\nThe resolver types live in pkg/credentials so packages the services layer depends on (e.g. the stack validator) can consume them without an import cycle. Aliased here so service-layer consumers keep the CredentialResolver naming.\n\n```go\ntype ResolvedRegistryCredential = credentials.ResolvedRegistryCredential\n```\nThe resolver types live in pkg/credentials so packages the services layer depends on (e.g. the stack validator) can consume them without an import cycle. Aliased here so service-layer consumers keep the CredentialResolver naming.\n\n```go\ntype SecretService interface {\n\tCreate(ctx context.Context, secret *models.Secret) (*models.Secret, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.Secret, *errors.ServiceError)\n\t// InternalGetByID is used internally to get the secret with decrypted data.\n\tInternalGetByID(ctx context.Context, ID string) (*models.Secret, *errors.ServiceError)\n\tInternalGetByName(ctx context.Context, organisationID, name string) (*models.Secret, *errors.ServiceError)\n\tGetByName(ctx context.Context, organisationID, name string) (*models.Secret, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, secret *models.Secret) (*models.Secret, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tListByOrganisation(ctx context.Context, organisationID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)\n\tListSecretsForCurrentUser(ctx context.Context, orgID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)\n\tListByUser(ctx context.Context, organisationID, userID string) ([]*models.Secret, *errors.ServiceError)\n\tListByType(ctx context.Context, organisationID, secretType models.SecretType) ([]*models.Secret, *errors.ServiceError)\n\tValidateSecretExists(ctx context.Context, secretID string) (bool, *errors.ServiceError)\n\tGetSecretKeys(ctx context.Context, secretID string) ([]string, *errors.ServiceError)\n\tValidateSecretHasKeys(ctx context.Context, secretID string, requiredKeys []string) (bool, []string, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewSecretService(spec SecretServiceSpec) SecretService\n```\n\n```go\ntype SecretServiceSpec struct {\n\tSessionFactory      db.SessionFactory\n\tEncryptionService   EncryptionService\n\tReferenceService    ReferenceService\n\tClusterClientGetter ClusterClientGetter\n\tProjectService      ProjectService\n\tLogger              logger.Logger\n\tPermissions         auth.PermissionService\n}\n```\n\n```go\ntype SignupService interface {\n\tSignup(ctx context.Context, user *models.User, inviteToken string) (*openapi.UserSignupResponse, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewSignupService(spec SignupServiceSpec) SignupService\n```\n\n```go\ntype SignupServiceSpec struct {\n\tUserService         UserService\n\tOrgInviteService    OrgInviteService\n\tOrganisationService OrganisationService\n\tProjectService      ProjectService\n\tPolicyManager       resourceaccess.ResourceAccessPolicyManager\n\tRefreshTokenStore   stores.RefreshTokenStore\n\tAtomicExecutor      stores.AtomicExecutor\n\tJWTSecretKey        string\n\tJWTClaimsBuilder    jwtClaimsBuilder\n\tLogger              logger.Logger\n}\n```\n\n```go\ntype StackDomainsService interface {\n\tCreate(ctx context.Context, spec *models.StackDomain) (*models.StackDomain, *errors.ServiceError)\n\tInternalCreateWithTx(ctx context.Context, spec *models.StackDomain) (*models.StackDomain, *errors.ServiceError)\n\tGet(ctx context.Context, id string) (*models.StackDomain, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tInternalDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tGetByFqdn(ctx context.Context, fqdn string) (*models.StackDomain, *errors.ServiceError)\n\tListByFqdnPrefix(ctx context.Context, prefix string) ([]*models.StackDomain, *errors.ServiceError)\n\tPopulateAndSaveExposedPortDomainsForResourceWithTx(ctx context.Context, stack *models.Stack, resource *models.StackResource) *errors.ServiceError\n\tInternalDeleteDomainsForResourceWithTx(ctx context.Context, resourceID string) *errors.ServiceError\n}\n```\n\n```go\nfunc NewStackDomainsService(spec StackDomainsServiceSpec) StackDomainsService\n```\n\n```go\ntype StackDomainsServiceSpec struct {\n\tSessionFactory        db.SessionFactory\n\tLogger                logger.Logger\n\tPlatformBaseDomain    string\n\tCustomDomainsDisabled bool\n}\n```\n\n```go\ntype StackPreviewConfigService interface {\n\tCreate(ctx context.Context, config *models.StackPreviewConfig) (*models.StackPreviewConfig, *errors.ServiceError)\n\tGet(ctx context.Context, id string) (*models.StackPreviewConfig, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, config *models.StackPreviewConfig) (*models.StackPreviewConfig, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tList(ctx context.Context, projectID string, params stores.ListParams) (*stores.PaginatedResult[*models.StackPreviewConfig], *errors.ServiceError)\n}\n```\n\n```go\nfunc NewStackPreviewConfigService(spec StackPreviewConfigServiceSpec) StackPreviewConfigService\n```\n\n```go\ntype StackPreviewConfigServiceSpec struct {\n\tStore              stores.StackPreviewConfigStore\n\tPreviewStackStore  stores.PreviewStackStore\n\tCredentialResolver CredentialResolver\n\tPermissions        auth.PermissionService\n}\n```\n\n```go\ntype StackQueryService interface {\n\tGetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n\tGetStackTopology(ctx context.Context, ID string) (*models.StackTopology, *errors.ServiceError)\n\tInternalGetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n\tGetStacksByProjectID(ctx context.Context, projectID string) ([]*models.Stack, *errors.ServiceError)\n\tGetStacksByOrganisationID(ctx context.Context, organisationID string) ([]*models.Stack, *errors.ServiceError)\n\tListStacksForCurrentUser(ctx context.Context, orgID string) ([]*models.Stack, *errors.ServiceError)\n}\n```\n\n```go\ntype StackReleaseService interface {\n\tCreateRelease(ctx context.Context, stackID string, cause models.ReleaseCause) (*models.StackRelease, *errors.ServiceError)\n\tRollbackRelease(ctx context.Context, stackID, fromReleaseID string) (*models.StackRelease, *errors.ServiceError)\n\tGetRelease(ctx context.Context, releaseID string) (*models.StackRelease, *errors.ServiceError)\n\tGetReleaseDetail(ctx context.Context, releaseID string) (*models.StackRelease, *models.ReleaseLiveStatus, *errors.ServiceError)\n\tListReleases(ctx context.Context, stackID string, params stores.ListParams) (*stores.PaginatedResult[*models.StackRelease], *errors.ServiceError)\n\tListReleaseEvents(ctx context.Context, stackID, releaseID string, afterSequence, limit int) (*ReleaseEventPage, *errors.ServiceError)\n\tStreamReleaseEvents(ctx context.Context, stackID, releaseID string, afterSequence int) (interfaces.ServerSideStreamable, *errors.ServiceError)\n\tCancelRelease(ctx context.Context, releaseID string) *errors.ServiceError\n\n\t// Internal methods are called by workers and controllers; no permission checks.\n\tInternalCreateRelease(ctx context.Context, stackID string, cause models.ReleaseCause) (*models.StackRelease, *errors.ServiceError)\n\tInternalGet(ctx context.Context, releaseID string) (*models.StackRelease, *errors.ServiceError)\n\tInternalGetReleaseRefs(ctx context.Context, stacks []*models.Stack) (map[string]models.StackReleaseRefs, *errors.ServiceError)\n\tInternalGetActiveByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)\n\tInternalGetLatestByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)\n\tInternalListActive(ctx context.Context) ([]*models.StackRelease, *errors.ServiceError)\n\tMarkInProgress(ctx context.Context, id string) (bool, *errors.ServiceError)\n\tSaveManifest(ctx context.Context, id string, m *models.ReleaseManifest, rev string, pins models.ReleasePins, rendererVersion string) (bool, *errors.ServiceError)\n\tMarkReleased(ctx context.Context, id string, outcome models.ReleaseOutcome) (bool, *errors.ServiceError)\n\tMarkCancelled(ctx context.Context, id string, reasons string) (bool, *errors.ServiceError)\n\tMarkSuperseded(ctx context.Context, id string, reason string) (bool, *errors.ServiceError)\n\tMarkFailed(ctx context.Context, id string, message string, outcome *models.ReleaseOutcome) (bool, *errors.ServiceError)\n\tSetConvergeClockStartedAt(ctx context.Context, id string, startedAt *time.Time) *errors.ServiceError\n\tMarkFailedWithValidationErrors(ctx context.Context, id, message string, verrs models.ReleaseValidationErrors) (bool, *errors.ServiceError)\n\tAppendImageDigests(ctx context.Context, id string, digests map[string]string) *errors.ServiceError\n\n\tBackgroundJobEnqueuerInjectable\n}\n```\n\n```go\nfunc NewStackReleaseService(spec StackReleaseServiceSpec) StackReleaseService\n```\n\n```go\ntype StackReleaseServiceSpec struct {\n\tStore              stores.StackReleaseStore\n\tStackService       StackService\n\tCredentialResolver CredentialResolver\n\tPermissions        auth.PermissionService\n\tReferenceService   ReferenceService\n\tEventStore         stores.ReleaseEventStore\n\tEventRecorder      ReleaseEventRecorder\n\t// GitClients is optional; it defaults to real git clients.\n\tGitClients    sourceGitClientProvider\n\tComputePolicy computequota.Policy\n}\n```\n\n```go\ntype StackResourceService interface {\n\tInjectClusterManager(clusterManager clustermanager.ClusterManager)\n\tCreate(ctx context.Context, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)\n\tGetByStackID(ctx context.Context, stackID string) ([]*models.StackResource, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.StackResource, *errors.ServiceError)\n\tGetByStackIDAndResourceName(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)\n\tInternalGetByStackIDAndResourceName(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)\n\tUpdate(ctx context.Context, stackID, resourceName string, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)\n\tDelete(ctx context.Context, stackID, resourceName string) *errors.ServiceError\n\tUpdateStatus(ctx context.Context, resourceID string, status *models.StackResourceStatus) *errors.ServiceError\n\tInternalCreateWithTx(ctx context.Context, stack *models.Stack, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)\n\tInternalUpdateWithTx(ctx context.Context, stack *models.Stack, resourceID string, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)\n\tInternalDeleteWithTx(ctx context.Context, resourceID string) *errors.ServiceError\n\tInternalSyncResourcesWithTx(ctx context.Context, stack *models.Stack, existingStack *models.Stack, desired []*models.StackResource) *errors.ServiceError\n\tRestart(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewStackResourceService(spec StackResourceServiceSpec) StackResourceService\n```\n\n```go\ntype StackResourceServiceSpec struct {\n\tSessionFactory         db.SessionFactory\n\tStorageService         StackStorageService\n\tLogger                 logger.Logger\n\tPermissions            auth.PermissionService\n\tStackStore             stores.StackStore\n\tStackResourceStore     stores.StackResourceStore\n\tClusterRegistryService ImageRegistryService\n\tStackDomainService     StackDomainsService\n\tReferenceService       ReferenceService\n\tResourceValidator      stackresourcevalidator.Validator\n\tComputePolicy          computequota.Policy\n}\n```\n\n```go\ntype StackService interface {\n\tCreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tUpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tApplyStack(ctx context.Context, spec *models.Stack) (*models.Stack, bool, *errors.ServiceError)\n\tUpdateStackShell(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tListStackConnections(ctx context.Context, stackID string) (models.StackConnections, *errors.ServiceError)\n\tCreateStackConnection(ctx context.Context, stackID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tCreateStackVolume(ctx context.Context, stackID string, volume *models.Volume) (*models.Volume, *errors.ServiceError)\n\tUpdateStackConnection(ctx context.Context, stackID, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tDeleteStackConnection(ctx context.Context, stackID, connectionID string) *errors.ServiceError\n\tUpdateStatus(ctx context.Context, ID string, status *models.StackStatus) *errors.ServiceError\n\tDeleteStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)\n\tInternalCreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tInternalUpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tInternalDeleteStack(ctx context.Context, stack *models.Stack) (*models.Stack, *errors.ServiceError)\n\tUpdateStackCrRevision(ctx context.Context, ID string, revision string) *errors.ServiceError\n\tInternalList(ctx context.Context, query string, args ...any) ([]*models.Stack, *errors.ServiceError)\n\tInternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError\n\tSetReleaseService(rs releaseServiceForStack)\n\tClusterResourceServiceInjectable\n\tBackgroundJobEnqueuerInjectable\n\tStackQueryService\n}\n```\n\n```go\nfunc NewStackService(spec StackServiceSpec) StackService\n```\n\n```go\ntype StackServiceSpec struct {\n\tSessionFactory        db.SessionFactory\n\tVolumeService         VolumeService\n\tClusterService        ClusterService\n\tOrganisationService   OrganisationService\n\tStackResourceService  StackResourceService\n\tNamespaceService      NamespaceService\n\tSecretService         SecretService\n\tPostgresAddonService  PostgresAddonService\n\tProjectService        ProjectService\n\tPermissions           auth.PermissionService\n\tLogger                logger.Logger\n\tReferenceService      ReferenceService\n\tCredentialResolver    CredentialResolver\n\tGitIntegrationService GitIntegrationService\n\tPlatformBaseDomain    string\n\tComputePolicy         computequota.Policy\n}\n```\n\n```go\ntype StackStorageService interface {\n\tGet(ctx context.Context, ID string, userID string) (*models.StackStorage, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.StackStorage, *errors.ServiceError)\n\tGetbyWorkspaceName(ctx context.Context, workspaceName string, userID string) (*models.StackStorage, *errors.ServiceError)\n\tInternalGet(ctx context.Context, ID string) (*models.StackStorage, *errors.ServiceError)\n\tListByOrganisationID(ctx context.Context, organisationID string) ([]*models.StackStorage, *errors.ServiceError)\n\tListByUserID(ctx context.Context, userID string) ([]*models.StackStorage, *errors.ServiceError)\n\tCreate(ctx context.Context, spec *models.StackStorage, userID string) (*models.StackStorage, *errors.ServiceError)\n\tUpdate(ctx context.Context, ID string, userID string, spec *models.StackStorage) (*models.StackStorage, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, ID string, status *models.StackStorageStatus) *errors.ServiceError\n\tInjectClusterResourceService(clusterResourceService clusterresource.StackStorageClusterResourceService)\n\tListVolumes(ctx context.Context, workspaceStorageID string, userID string) ([]*models.Volume, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string, userID string) *errors.ServiceError\n\tMarkAsSynced(ctx context.Context, userID string, storageID string, volumeID string) *errors.ServiceError\n}\n```\n\n```go\ntype UserService interface {\n\tGet(ctx context.Context, ID string) (*models.User, *errors.ServiceError)\n\tGetUserFromContext(ctx context.Context) (*models.User, []*models.ProjectMembership, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, orgID string, params stores.ListParams) (*stores.PaginatedResult[*models.User], *errors.ServiceError)\n\tInternalGet(ctx context.Context, ID string) (*models.User, *errors.ServiceError)\n\tInternalGetByEmail(ctx context.Context, email string) (*models.User, *errors.ServiceError)\n\tInternalCreate(ctx context.Context, user *models.User) (*models.User, *errors.ServiceError)\n\tInternalCreateOAuthUser(ctx context.Context, email, name, githubID, avatarURL string) (*models.User, error)\n\tInternalCreateInvitedUser(ctx context.Context, user *models.User, invite *models.OrgInvite) (*models.User, *errors.ServiceError)\n\tInternalCreateInvitedOAuthUser(ctx context.Context, email, name, githubID, avatarURL string, invite *models.OrgInvite) (*models.User, error)\n\tLogin(ctx context.Context, loginRequest *openapi.LoginRequest) (*openapi.LoginResponse, *errors.ServiceError)\n}\n```\n\n```go\nfunc NewUserService(spec UserServiceSpec) UserService\n```\n\n```go\ntype UserServiceSpec struct {\n\tSessionFactory              db.SessionFactory\n\tLogger                      logger.Logger\n\tJwtSecretKey                string\n\tResourceAccessPolicyManager resourceaccess.ResourceAccessPolicyManager\n\tJWTClaimsBuilder            jwtClaimsBuilder\n\tOrganisationService         OrganisationService\n\tPermissions                 auth.PermissionService\n\tProjectService              ProjectService\n\tRefreshTokenStore           stores.RefreshTokenStore\n\tAtomicExecutor              stores.AtomicExecutor\n}\n```\n\n```go\ntype VolumeService interface {\n\tGet(ctx context.Context, ID string) (*models.Volume, *errors.ServiceError)\n\tInternalGet(ctx context.Context, ID string) (*models.Volume, *errors.ServiceError)\n\tGetByVolumeNameAndNamespace(ctx context.Context, volumeName, namespace string) (*models.Volume, *errors.ServiceError)\n\tInternalList(ctx context.Context, ids []string) ([]*models.Volume, *errors.ServiceError)\n\tInternalListNotReady(ctx context.Context) ([]*models.Volume, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.Volume) (*models.Volume, *errors.ServiceError)\n\tCreateInDbWithTx(ctx context.Context, spec *models.Volume) (*models.Volume, *errors.ServiceError)\n\tCreateInCluster(ctx context.Context, spec *models.Volume) *errors.ServiceError\n\tListByUserID(ctx context.Context, projectID, userID string) ([]*models.Volume, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, ID string, status *models.VolumeStatus) *errors.ServiceError\n\tUpdateGitRepoSourceRevision(ctx context.Context, ID string, revision models.GitRepoRevision) (*models.Volume, *errors.ServiceError)\n\tUpdateRemoteSourceRevision(ctx context.Context, ID string, revision models.RemoteDirSource) (*models.Volume, *errors.ServiceError)\n\tInjectClusterResourceService(volumeClusterService clusterresource.VolumeClusterResourceService)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tInternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError\n\tInternalDeleteVolumesUsedByStackFromDB(ctx context.Context, stackID string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tListVolumesUsedByStack(ctx context.Context, stackID string) ([]*models.Volume, *errors.ServiceError)\n\tInternalCreateWithTx(ctx context.Context, stack *models.Stack, volume *models.Volume) (*models.Volume, *errors.ServiceError)\n\tInternalSyncVolumesWithTx(ctx context.Context, stack *models.Stack, existingStack *models.Stack, desired []*models.Volume) *errors.ServiceError\n}\n```\n\n```go\nfunc NewVolumeService(spec VolumeServiceSpec) VolumeService\n```\n\n```go\ntype VolumeServiceSpec struct {\n\tSessionFactory   db.SessionFactory\n\tReferenceService ReferenceService\n\tLogger           logger.Logger\n\tPermissions      auth.PermissionService\n\tComputePolicy    computequota.Policy\n}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/services","name":"services","synopsis":"Package services is a generated GoMock package.","isRedistributable":true}
