{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stores\n\n## Constants\n\n```go\nconst (\n\tDefaultPageSize = 20\n\tMaxPageSize     = 100\n)\n```\n\n## Types\n\n```go\ntype APITokenStore interface {\n\tCreate(ctx context.Context, token *models.APIToken) (*models.APIToken, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.APIToken, *errors.ServiceError)\n\tGetByTokenHash(ctx context.Context, hash string) (*models.APIToken, *errors.ServiceError)\n\tListByUserID(ctx context.Context, userID string) ([]*models.APIToken, *errors.ServiceError)\n\tRevoke(ctx context.Context, id string) *errors.ServiceError\n\tUpdateLastUsed(ctx context.Context, id string) *errors.ServiceError\n}\n```\n\n```go\ntype AtomicExecutor interface {\n\tWithTransaction(ctx context.Context, fn func(ctx context.Context) *errors.ServiceError) *errors.ServiceError\n}\n```\nInterface to run a function with a DB transaction.\n\n```go\ntype ClusterImageRegistryStore interface {\n\tGetByID(ctx context.Context, ID string) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tGetForOrgAndCluster(ctx context.Context, orgID, clusterID string) (*models.ClusterImageRegistry, *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\tListByClusterIDInternal(ctx context.Context, clusterID string) ([]*models.ClusterImageRegistry, *errors.ServiceError)\n\tCreate(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, ID string, status *models.ClusterImageRegistryStatus) *errors.ServiceError\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tMarkDeletingWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tMarkAllDeletingByClusterIDWithTx(ctx context.Context, clusterID string) *errors.ServiceError\n\tAtomicExecutor\n}\n```\n\n```go\ntype ClusterStore interface {\n\tCreate(ctx context.Context, spec *models.Cluster) (*models.Cluster, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.Cluster) (*models.Cluster, *errors.ServiceError)\n\tListBYOCClustersForOrg(ctx context.Context, orgID string) ([]*models.Cluster, *errors.ServiceError)\n\tListSharedComputeClusters(ctx context.Context) ([]*models.Cluster, *errors.ServiceError)\n\tListSharedComputeClustersForOrg(ctx context.Context, orgID string) ([]*models.Cluster, *errors.ServiceError)\n\tGet(ctx context.Context, ID string) (*models.Cluster, *errors.ServiceError)\n\tPersistManagerState(ctx context.Context, ID string, running bool) *errors.ServiceError\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tMarkDeletingWithTx(ctx context.Context, ID string, at time.Time) *errors.ServiceError\n\tListIDsForImageRegistryReconciliation(ctx context.Context) ([]string, *errors.ServiceError)\n\tGetByClusterUrl(ctx context.Context, clusterURL string) (*models.Cluster, *errors.ServiceError)\n\tFindAnyClusterIDBySharedCompute(ctx context.Context, sharedCompute bool) (string, *errors.ServiceError)\n\tUpdateSharedComputeCluster(ctx context.Context, cluster *models.Cluster) *errors.ServiceError\n\tUpdateClusterInfo(ctx context.Context, ID string, info *models.ClusterInfo) *errors.ServiceError\n\tListAll(ctx context.Context) ([]*models.Cluster, *errors.ServiceError)\n\tAtomicExecutor\n}\n```\n\n```go\ntype Filter struct {\n\tField string\n\tValue any\n}\n```\n\n```go\ntype GitInstallationStore interface {\n\t// Upsert creates or updates the installation keyed by\n\t// (git_integration_id, installation_id).\n\tUpsert(ctx context.Context, installation *models.GitInstallation) (*models.GitInstallation, *errors.ServiceError)\n\tListByIntegrationID(ctx context.Context, integrationID string) ([]*models.GitInstallation, *errors.ServiceError)\n\tGetByIntegrationAndID(ctx context.Context, integrationID, id string) (*models.GitInstallation, *errors.ServiceError)\n\tGetByIntegrationAndAccount(ctx context.Context, integrationID, accountLogin string) (*models.GitInstallation, *errors.ServiceError)\n\t// GetByInstallationID looks up an installation by its GitHub-global\n\t// installation id (repository webhooks carry only this reference).\n\tGetByInstallationID(ctx context.Context, installationID int64) (*models.GitInstallation, *errors.ServiceError)\n\tDeleteByInstallationID(ctx context.Context, integrationID string, installationID int64) *errors.ServiceError\n}\n```\n\n```go\ntype GitIntegrationStore 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\t// GetByOrgAndHost returns the git_credentials integration for the (org,\n\t// host) pair.\n\tGetByOrgAndHost(ctx context.Context, organisationID, host string) (*models.GitIntegration, *errors.ServiceError)\n\t// GetGitHubAppForOrg returns the org's github_app integration.\n\tGetGitHubAppForOrg(ctx context.Context, organisationID string) (*models.GitIntegration, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, organisationID string) ([]*models.GitIntegration, *errors.ServiceError)\n\t// ListGitHubApps returns every github_app integration across orgs (used\n\t// to match webhook deliveries by app ID).\n\tListGitHubApps(ctx context.Context) ([]*models.GitIntegration, *errors.ServiceError)\n\tUpdate(ctx context.Context, integration *models.GitIntegration) (*models.GitIntegration, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n}\n```\n\n```go\ntype ImageBuildStore interface {\n\tCreate(ctx context.Context, resourceBuild *models.ImageBuild) (*models.ImageBuild, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, BuildID string, status *models.ImageBuildStatus) *errors.ServiceError\n\tGetByResourceID(ctx context.Context, resourceID 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}\n```\n\n```go\ntype ListParams struct {\n\tFilters  []Filter\n\tPage     int\n\tPageSize int\n\tOrderBy  string\n}\n```\n\n```go\nfunc (p ListParams) Apply(query *gorm.DB) *gorm.DB\n```\n\n```go\nfunc (p ListParams) ApplyFiltersOnly(query *gorm.DB) *gorm.DB\n```\n\n```go\nfunc (p ListParams) Limit() int\n```\n\n```go\nfunc (p ListParams) Offset() int\n```\n\n```go\nfunc (p ListParams) TotalPages(total int64) int\n```\n\n```go\nfunc (p ListParams) WithDefaultOrder(order string) ListParams\n```\n\n```go\ntype NamespacesStore interface {\n\tCreateWithTx(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)\n\tCreate(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)\n\tGet(ctx context.Context, id string) (*models.Namespace, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tUpdate(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}\n```\n\n```go\ntype OAuthStateStore interface {\n\tCreate(ctx context.Context, state *models.OAuthState) *errors.ServiceError\n\tConsume(ctx context.Context, state, provider string) (*models.OAuthState, *errors.ServiceError)\n\tDeleteExpired(ctx context.Context, maxAge time.Duration) error\n}\n```\n\n```go\ntype ObjectStoreStore 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\tGetByName(ctx context.Context, organisationID, name string) (*models.ObjectStore, *errors.ServiceError)\n\tUpdate(ctx context.Context, 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\tListByProjectIDs(ctx context.Context, projectIDs []string) ([]*models.ObjectStore, *errors.ServiceError)\n\n\tUpdateStatus(ctx context.Context, id string, status models.ObjectStoreStatus) *errors.ServiceError\n\n\t// Validation\n\tValidateObjectStoreExists(ctx context.Context, objectStoreID string) (bool, *errors.ServiceError)\n\tValidateObjectStoreNameUnique(ctx context.Context, organisationID, name, excludeID string) (bool, *errors.ServiceError)\n\n\tIsReferencedByAddon(ctx context.Context, objectStoreID string) (bool, *errors.ServiceError)\n}\n```\n\n```go\ntype OrgInviteStore interface {\n\tAtomicExecutor\n\tCreate(ctx context.Context, invite *models.OrgInvite) (*models.OrgInvite, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.OrgInvite, *errors.ServiceError)\n\tGetByTokenHash(ctx context.Context, tokenHash string) (*models.OrgInvite, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, orgID string, params ListParams) (*PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, id string, status models.InviteStatus) *errors.ServiceError\n\tMarkAccepted(ctx context.Context, id string) *errors.ServiceError\n\tMarkEmailSent(ctx context.Context, id string) *errors.ServiceError\n\tMarkEmailError(ctx context.Context, id string, errMsg string) *errors.ServiceError\n\tResetEmailStatus(ctx context.Context, id string) *errors.ServiceError\n\tListPendingUnsent(ctx context.Context, params ListParams) (*PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n\tGetPendingByOrgAndEmail(ctx context.Context, orgID, email string) (*models.OrgInvite, *errors.ServiceError)\n\tDeleteIDs(ctx context.Context, ids []string) *errors.ServiceError\n\tListExpiredOrPastDue(ctx context.Context, now time.Time, params ListParams) (*PaginatedResult[*models.OrgInvite], *errors.ServiceError)\n}\n```\n\n```go\ntype OrganisationDomainStore interface {\n\tCreateWithTx(ctx context.Context, domain *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)\n\tBulkCreate(ctx context.Context, domains []*models.OrganisationDomain) ([]*models.OrganisationDomain, *errors.ServiceError)\n\tCreate(ctx context.Context, domain *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\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tUpdate(ctx context.Context, id string, domain *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)\n\tListByOrganisationID(ctx context.Context, organisationID string) ([]*models.OrganisationDomain, *errors.ServiceError)\n}\n```\n\n```go\ntype OrganisationStore interface {\n\tGetPlatformOrg(ctx context.Context) (*models.Organisation, *errors.ServiceError)\n\tOrganisationNameExists(ctx context.Context, name string) (bool, *errors.ServiceError)\n\tCreate(ctx context.Context, spec *models.Organisation) (*models.Organisation, *errors.ServiceError)\n\tGet(ctx context.Context, ID string) (*models.Organisation, *errors.ServiceError)\n\t// LockByID takes a row-level lock on the organisation. It must be called\n\t// inside a transaction to serialize topology mutations owned by that org.\n\tLockByID(ctx context.Context, ID string) *errors.ServiceError\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tUpdate(ctx context.Context, id string, org *models.Organisation) (*models.Organisation, *errors.ServiceError)\n}\n```\n\n```go\ntype PaginatedResult[T any] struct {\n\tItems      []T\n\tTotal      int64\n\tPage       int\n\tPageSize   int\n\tTotalPages int\n}\n```\n\n```go\ntype PostgresAddonDatabaseStore 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, database *models.PostgresAddonDatabase) (*models.PostgresAddonDatabase, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, 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\n\t// Validation\n\tValidateDatabaseExists(ctx context.Context, databaseID string) (bool, *errors.ServiceError)\n\tValidateDatabaseNameUnique(ctx context.Context, postgresAddonID, name, excludeID string) (bool, *errors.ServiceError)\n}\n```\n\n```go\ntype PostgresAddonStore interface {\n\tCreate(ctx context.Context, addon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, addon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tGetByID(ctx context.Context, ID string) (*models.PostgresAddon, *errors.ServiceError)\n\tGetByName(ctx context.Context, organisationID, name string) (*models.PostgresAddon, *errors.ServiceError)\n\tUpdate(ctx context.Context, addon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, addon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tListByOrganisation(ctx context.Context, organisationID string) ([]*models.PostgresAddon, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string) ([]*models.PostgresAddon, *errors.ServiceError)\n\tListByProjectIDs(ctx context.Context, projectIDs []string) ([]*models.PostgresAddon, *errors.ServiceError)\n\n\t// Validation\n\tValidateAddonExists(ctx context.Context, addonID string) (bool, *errors.ServiceError)\n\tValidateAddonNameUnique(ctx context.Context, organisationID, name, excludeID string) (bool, *errors.ServiceError)\n\n\t// Status and lifecycle management\n\tUpdateStatus(ctx context.Context, id string, status *models.PostgresAddonStatus) *errors.ServiceError\n\tUpdateBackupRequestedAt(ctx context.Context, id string, timestamp *time.Time) *errors.ServiceError\n\tUpdateDeletionTimestamp(ctx context.Context, id string, timestamp *time.Time) *errors.ServiceError\n\tInternalList(ctx context.Context, query string, args ...any) ([]*models.PostgresAddon, *errors.ServiceError)\n\n\t// Transaction support\n\tWithTransaction(ctx context.Context, fn func(ctx context.Context) *errors.ServiceError) *errors.ServiceError\n}\n```\n\n```go\ntype PostgresBackupStore 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\tUpdate(ctx context.Context, 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\n\tGetByName(ctx context.Context, postgresAddonID string, name string) (*models.PostgresBackup, *errors.ServiceError)\n\n\t// Validation\n\tValidateBackupExists(ctx context.Context, backupID string) (bool, *errors.ServiceError)\n}\n```\n\n```go\ntype PreviewStackStore interface {\n\tAtomicExecutor\n\tCreate(ctx context.Context, preview *models.PreviewStack) (*models.PreviewStack, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.PreviewStack, *errors.ServiceError)\n\tUpdate(ctx context.Context, preview *models.PreviewStack) (*models.PreviewStack, *errors.ServiceError)\n\tGetByConfigAndPR(ctx context.Context, configID string, prNumber string) (*models.PreviewStack, *errors.ServiceError)\n\tCountActiveByConfigID(ctx context.Context, configID string) (int64, *errors.ServiceError)\n\tListByConfigID(ctx context.Context, configID string, params ListParams) (*PaginatedResult[*models.PreviewStack], *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string, params ListParams) (*PaginatedResult[*models.PreviewStack], *errors.ServiceError)\n\tListNeedingReconciliation(ctx context.Context, page, pageSize int) ([]*models.PreviewStack, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n}\n```\n\n```go\ntype ProjectMembershipStore interface {\n\tCreate(ctx context.Context, membership *models.ProjectMembership) (*models.ProjectMembership, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.ProjectMembership, *errors.ServiceError)\n\tGetByProjectAndUser(ctx context.Context, projectID, userID string) (*models.ProjectMembership, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string) ([]*models.ProjectMembership, *errors.ServiceError)\n\tListByUserID(ctx context.Context, userID string) ([]*models.ProjectMembership, *errors.ServiceError)\n\tListByUserIDAndOrgID(ctx context.Context, userID, orgID string) ([]*models.ProjectMembership, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, membership *models.ProjectMembership) (*models.ProjectMembership, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n}\n```\n\n```go\ntype ProjectStore interface {\n\tCreate(ctx context.Context, project *models.Project) (*models.Project, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.Project, *errors.ServiceError)\n\tGetByOrgAndName(ctx context.Context, orgID, name string) (*models.Project, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, orgID string) ([]*models.Project, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, project *models.Project) (*models.Project, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tGetDefaultProjectForOrg(ctx context.Context, orgID string) (*models.Project, *errors.ServiceError)\n}\n```\n\n```go\ntype RefreshTokenStore interface {\n\tCreate(ctx context.Context, token *models.RefreshToken) (*models.RefreshToken, *errors.ServiceError)\n\tGetByTokenHash(ctx context.Context, hash string) (*models.RefreshToken, *errors.ServiceError)\n\tRevoke(ctx context.Context, id string) *errors.ServiceError\n\tRevokeAllForUser(ctx context.Context, userID string) *errors.ServiceError\n}\n```\n\n```go\ntype RegistryCredentialStore 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\t// GetByOrgAndHost returns all credentials for the (org, normalized host)\n\t// pair; there can be up to one per purpose.\n\tGetByOrgAndHost(ctx context.Context, organisationID, host string) ([]*models.RegistryCredential, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, organisationID string) ([]*models.RegistryCredential, *errors.ServiceError)\n\tUpdate(ctx context.Context, credential *models.RegistryCredential) (*models.RegistryCredential, *errors.ServiceError)\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n}\n```\n\n```go\ntype ReleaseEventStore interface {\n\t// Insert assigns the next release-local sequence and inserts the event in\n\t// its own transaction. A duplicate (release_id, dedupe_key) is a no-op and\n\t// returns (nil, nil).\n\tInsert(ctx context.Context, event *models.ReleaseEvent) (*models.ReleaseEvent, *errors.ServiceError)\n\t// InsertWithTx is Insert joining the caller's ambient transaction.\n\t// Must run inside a transaction (db.TxFromContext must be non-nil).\n\tInsertWithTx(ctx context.Context, event *models.ReleaseEvent) (*models.ReleaseEvent, *errors.ServiceError)\n\t// ListByReleaseID returns events with sequence \u003e afterSequence ordered by\n\t// sequence ASC, capped at limit.\n\tListByReleaseID(ctx context.Context, releaseID string, afterSequence int, limit int) ([]*models.ReleaseEvent, *errors.ServiceError)\n\tAtomicExecutor\n}\n```\n\n```go\ntype ResourceReferenceStore interface {\n\t// ReplaceSpecWithTx deletes all spec-scoped rows (release_id IS NULL) for the\n\t// stack and reinserts refs. Must run inside a transaction.\n\tReplaceSpecWithTx(ctx context.Context, stackID string, refs []models.ResourceReference) *errors.ServiceError\n\t// InsertReleaseWithTx inserts release-scoped rows. Must run inside a transaction.\n\tInsertReleaseWithTx(ctx context.Context, releaseID, stackID string, refs []models.ResourceReference) *errors.ServiceError\n\t// ListByReferent returns every reference row (any scope, org-wide) for a referent.\n\tListByReferent(ctx context.Context, referentType models.ReferentType, referentID string) ([]models.ResourceReference, *errors.ServiceError)\n}\n```\n\n```go\ntype ResourceValidationRecordStore interface {\n\tGet(ctx context.Context, stackID, resourceName string, kind models.ResourceValidationCheckKind) (*models.ResourceValidationRecord, *errors.ServiceError)\n\tUpsert(ctx context.Context, record *models.ResourceValidationRecord) *errors.ServiceError\n}\n```\n\n```go\ntype SecretStore 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\tGetByName(ctx context.Context, organisationID, name string) (*models.Secret, *errors.ServiceError)\n\tUpdate(ctx context.Context, secret *models.Secret) (*models.Secret, *errors.ServiceError)\n\tUpdateEncryptedData(ctx context.Context, secretID string, encryptedData string, keys []string, dataHash string) *errors.ServiceError\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n\tListByOrganisation(ctx context.Context, organisationID string, params ListParams) ([]*models.Secret, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string, params ListParams) ([]*models.Secret, *errors.ServiceError)\n\tListByProjectIDs(ctx context.Context, projectIDs []string, params 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\ntype StackConnectionStore interface {\n\tListByStackID(ctx context.Context, stackID string) (models.StackConnections, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, stackID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, stackID, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tDeleteWithTx(ctx context.Context, stackID, connectionID string) *errors.ServiceError\n\tReplaceByStackIDWithTx(ctx context.Context, stackID string, connections models.StackConnections) *errors.ServiceError\n\tIsNodeReferenced(ctx context.Context, stackID string, ref models.TopologyNodeRef) (bool, error)\n\tIsNodeReferencedAsSource(ctx context.Context, stackID string, ref models.TopologyNodeRef) (bool, error)\n\tIsNodeReferencedAsTarget(ctx context.Context, stackID string, ref models.TopologyNodeRef) (bool, error)\n}\n```\n\n```go\ntype StackDomainsStore interface {\n\tCreateWithTx(ctx context.Context, domain *models.StackDomain) (*models.StackDomain, *errors.ServiceError)\n\tBulkCreate(ctx context.Context, domains []*models.StackDomain) (models.StackDomainList, *errors.ServiceError)\n\tCreate(ctx context.Context, domain *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\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tUpdate(ctx context.Context, id string, domain *models.StackDomain) (*models.StackDomain, *errors.ServiceError)\n\tListByStackID(ctx context.Context, stackID string) (models.StackDomainList, *errors.ServiceError)\n\tListByStackResourceID(ctx context.Context, stackResourceID string) (models.StackDomainList, *errors.ServiceError)\n\tGetByStackResourceAndPort(ctx context.Context, stackResourceID string, port int) (*models.StackDomain, *errors.ServiceError)\n\tDeleteForStackResourceAndPort(ctx context.Context, stackResourceID string, port int) *errors.ServiceError\n\tDeleteForStackResourceAndPortWithTx(ctx context.Context, stackResourceID string, port int) *errors.ServiceError\n\tGetByFqdn(ctx context.Context, fqdn string) (*models.StackDomain, *errors.ServiceError)\n\tListByOrganisationID(ctx context.Context, organisationID string) (models.StackDomainList, *errors.ServiceError)\n\tListByFqdnPrefix(ctx context.Context, prefix string) (models.StackDomainList, *errors.ServiceError)\n}\n```\n\n```go\ntype StackPreviewConfigStore interface {\n\tAtomicExecutor\n\tCreate(ctx context.Context, config *models.StackPreviewConfig) (*models.StackPreviewConfig, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.StackPreviewConfig, *errors.ServiceError)\n\tGetByProjectAndName(ctx context.Context, projectID, name string) (*models.StackPreviewConfig, *errors.ServiceError)\n\tGetByOrgAndRepo(ctx context.Context, organisationID, normalizedRepoURL string) (*models.StackPreviewConfig, *errors.ServiceError)\n\tUpdate(ctx context.Context, config *models.StackPreviewConfig) (*models.StackPreviewConfig, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tListByProjectID(ctx context.Context, projectID string, params ListParams) (*PaginatedResult[*models.StackPreviewConfig], *errors.ServiceError)\n}\n```\n\n```go\ntype StackReleaseStore interface {\n\t// Create inserts a new release with sequence = max(sequence)+1.\n\tCreate(ctx context.Context, release *models.StackRelease) (*models.StackRelease, *errors.ServiceError)\n\n\tGetByID(ctx context.Context, id string) (*models.StackRelease, *errors.ServiceError)\n\n\tListByStackID(ctx context.Context, stackID string, params ListParams) (*PaginatedResult[*models.StackRelease], *errors.ServiceError)\n\n\t// ListActive returns all non-terminal releases across all stacks.\n\tListActive(ctx context.Context) ([]*models.StackRelease, *errors.ServiceError)\n\n\t// GetActiveByStackID returns the single active (non-terminal) release for a stack,\n\t// or (nil, nil) if none exists.\n\tGetActiveByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)\n\n\t// GetLatestByStackID returns the highest-sequence release for a stack, any state,\n\t// or (nil, nil) if the stack has no releases.\n\tGetLatestByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)\n\n\t// GetLatestByStackIDs returns the highest-sequence release for each of the given\n\t// stack IDs, keyed by stack ID. Stacks with no releases are absent from the map.\n\tGetLatestByStackIDs(ctx context.Context, stackIDs []string) (map[string]*models.StackRelease, *errors.ServiceError)\n\n\t// GetByIDs returns releases keyed by release ID.\n\tGetByIDs(ctx context.Context, ids []string) (map[string]*models.StackRelease, *errors.ServiceError)\n\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\tMarkFailed(ctx context.Context, id string, message string, outcome *models.ReleaseOutcome) (bool, *errors.ServiceError)\n\tMarkFailedWithValidationErrors(ctx context.Context, id, message string, verrs models.ReleaseValidationErrors) (bool, *errors.ServiceError)\n\tCancel(ctx context.Context, id string) (bool, *errors.ServiceError)\n\tMarkCancelled(ctx context.Context, id string, reason string) (bool, *errors.ServiceError)\n\tMarkSuperseded(ctx context.Context, id string, reason string) (bool, *errors.ServiceError)\n\n\t// AppendImageDigests merges image digests into the release pins.\n\tAppendImageDigests(ctx context.Context, id string, digests map[string]string) *errors.ServiceError\n\n\t// SetConvergeClockStartedAt stamps (nil: clears) the convergence timeout\n\t// clock on an InProgress release. See models.ReleaseWorkerStatus.\n\tSetConvergeClockStartedAt(ctx context.Context, id string, startedAt *time.Time) *errors.ServiceError\n\n\t// ListTerminalSummariesByStackID returns lightweight release summaries for GC decisions.\n\t// Only terminal-state releases are returned — active releases are never GC candidates.\n\tListTerminalSummariesByStackID(ctx context.Context, stackID string) ([]models.ReleaseSummary, *errors.ServiceError)\n\n\t// DeleteByIDs removes releases by their IDs.\n\tDeleteByIDs(ctx context.Context, ids []string) *errors.ServiceError\n\n\t// ListStackIDsExceedingRetention returns stack IDs that have more than `cap`\n\t// terminal releases — candidates for periodic GC.\n\tListStackIDsExceedingRetention(ctx context.Context, cap int) ([]string, *errors.ServiceError)\n\n\tAtomicExecutor\n}\n```\n\n```go\ntype StackResourceStore interface {\n\tCreate(ctx context.Context, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, resource *models.StackResource, stack *models.Stack) (*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\tUpdate(ctx context.Context, resourceID string, resource *models.StackResource, stack *models.Stack) (*models.StackResource, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, resourceID string, resource *models.StackResource, stack *models.Stack) (*models.StackResource, *errors.ServiceError)\n\tUpdatePortsWithTx(ctx context.Context, resourceID string, resource *models.StackResource) *errors.ServiceError\n\tUpdateStatus(ctx context.Context, resourceID string, status *models.StackResourceStatus) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, ID string) *errors.ServiceError\n\tDelete(ctx context.Context, ID string) *errors.ServiceError\n}\n```\n\n```go\ntype StackStore interface {\n\tCreate(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.Stack, *errors.ServiceError)\n\t// LockByID takes a row-level lock on the stack (SELECT ... FOR UPDATE).\n\t// Only meaningful inside WithTransaction; serializes concurrent mutations\n\t// that must observe each other (e.g. duplicate-name checks on create).\n\tLockByID(ctx context.Context, id string) *errors.ServiceError\n\t// GetByNameAndProjectID resolves a stack by name within a project scope. Stack\n\t// names are unique per project, so this is the canonical lookup for\n\t// name-addressed operations (e.g. declarative apply).\n\tGetByNameAndProjectID(ctx context.Context, name string, projectID string) (*models.Stack, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tUpdateRevision(ctx context.Context, id string, revision string) *errors.ServiceError\n\tUpdateConnectionsWithTx(ctx context.Context, id string, connections models.StackConnections) *errors.ServiceError\n\tCreateConnectionWithTx(ctx context.Context, id string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tUpdateConnectionWithTx(ctx context.Context, id string, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)\n\tDeleteConnectionWithTx(ctx context.Context, id string, connectionID string) *errors.ServiceError\n\tInternalList(ctx context.Context, query string, args ...any) ([]*models.Stack, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, id string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tUpdateShellWithTx(ctx context.Context, id string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, id string, status *models.StackStatus) *errors.ServiceError\n\tUpdateForDelete(ctx context.Context, id string, spec *models.Stack) (*models.Stack, *errors.ServiceError)\n\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tListByOrganisationID(ctx context.Context, organisationID string) ([]*models.Stack, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string) ([]*models.Stack, *errors.ServiceError)\n\tListByProjectIDs(ctx context.Context, projectIDs []string) ([]*models.Stack, *errors.ServiceError)\n\tListByUserID(ctx context.Context, userID string) ([]*models.Stack, *errors.ServiceError)\n\tAtomicExecutor\n}\n```\n\n```go\ntype StackVolumeStore interface {\n\tCreate(ctx context.Context, sv *models.StackVolume) *errors.ServiceError\n\tDelete(ctx context.Context, stackID, volumeID string) *errors.ServiceError\n\tGetByVolumeID(ctx context.Context, volumeID string) (*models.StackVolume, *errors.ServiceError)\n\tListVolumesByStackID(ctx context.Context, stackID string) ([]*models.Volume, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, sv *models.StackVolume) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, stackID, volumeID string) *errors.ServiceError\n}\n```\n\n```go\ntype StorageStore interface {\n\tCreate(ctx context.Context, spec *models.StackStorage) (*models.StackStorage, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.StackStorage) (*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\tGetByIDorName(ctx context.Context, idOrName string, userID string) (*models.StackStorage, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, spec *models.StackStorage) (*models.StackStorage, *errors.ServiceError)\n\tUpdateWithTx(ctx context.Context, id string, spec *models.StackStorage) (*models.StackStorage, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, id string, status *models.StackStorageStatus) (*models.StackStorage, *errors.ServiceError)\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tDeleteByNameWithTx(ctx context.Context, name string, userID string) *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\tAtomicExecutor\n}\n```\n\n```go\ntype UserStore interface {\n\tCreate(ctx context.Context, user *models.User) (*models.User, *errors.ServiceError)\n\tGetByID(ctx context.Context, id string) (*models.User, *errors.ServiceError)\n\tGetByEmail(ctx context.Context, email string) (*models.User, *errors.ServiceError)\n\tUpdate(ctx context.Context, id string, user *models.User) (*models.User, *errors.ServiceError)\n\tListByOrgID(ctx context.Context, orgID string, params ListParams) (*PaginatedResult[*models.User], *errors.ServiceError)\n\tListByOrgAndRole(ctx context.Context, orgID string, role models.UserRole) ([]*models.User, *errors.ServiceError)\n}\n```\n\n```go\ntype VolumeStore interface {\n\tCreate(ctx context.Context, spec *models.Volume) (*models.Volume, *errors.ServiceError)\n\tCreateWithTx(ctx context.Context, spec *models.Volume) (*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\tGetByID(ctx context.Context, id string) (*models.Volume, *errors.ServiceError)\n\tUpdateGitRepoSourceRevision(ctx context.Context, id string, revision models.GitRepoRevision) (*models.Volume, *errors.ServiceError)\n\tUpdateGitRepoSourceRevisionWithTx(ctx context.Context, id string, revision models.GitRepoRevision) (*models.Volume, *errors.ServiceError)\n\tUpdateRemoteDirSourceHash(ctx context.Context, id string, remoteDirHash string) (*models.Volume, *errors.ServiceError)\n\tUpdateRemoteDirSourceHashWithTx(ctx context.Context, id string, remoteDirHash string) (*models.Volume, *errors.ServiceError)\n\tUpdateStatus(ctx context.Context, id string, status *models.VolumeStatus) *errors.ServiceError\n\tDelete(ctx context.Context, id string) *errors.ServiceError\n\tDeleteWithTx(ctx context.Context, id string) *errors.ServiceError\n\tGetByUserID(ctx context.Context, id string) ([]*models.Volume, *errors.ServiceError)\n\tGetByVolumeNameAndNamespace(ctx context.Context, volumeName string, namespace string) (*models.Volume, *errors.ServiceError)\n\tListByProjectID(ctx context.Context, projectID string) ([]*models.Volume, *errors.ServiceError)\n\tAtomicExecutor\n}\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/stores","name":"stores","synopsis":"","isRedistributable":true}
