services

package
v0.0.6-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 72 Imported by: 0

Documentation

Overview

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Package services is a generated GoMock package.

Index

Constants

View Source
const (
	CredentialSourceIntegration = credentials.SourceIntegration
	CredentialSourceAnonymous   = credentials.SourceAnonymous

	RegistryPurposePull = credentials.RegistryPurposePull
	RegistryPurposePush = credentials.RegistryPurposePush
)
View Source
const (

	// GitHub webhook event names.
	GitHubEventInstallation = "installation"
	GitHubEventPullRequest  = "pull_request"
	GitHubEventPush         = "push"
	// issue_comment and label are subscribed ahead of use so already-created
	// apps receive them when the hub starts handling them; unknown events are
	// dropped by the webhook handler until then. GitHub delivers PR comments
	// under issue_comment.
	GitHubEventIssueComment = "issue_comment"
	GitHubEventLabel        = "label"
)
View Source
const PreviewEnvFile = ".env.preview"

PreviewEnvFile is the optional repo-root dotenv file whose entries override stackfile env for a preview environment.

Variables

This section is empty.

Functions

func ContentHash

func ContentHash(data []byte) string

func EncodeStackResourceSubdomainPrefix

func EncodeStackResourceSubdomainPrefix(stackID, resourceName string, port int) string

EncodeStackResourceSubdomainPrefix returns a short stable subdomain token from stack ID, resource name, and port number.

func FQDNForPortWithCustomDomain

func FQDNForPortWithCustomDomain(stackID, resourceName, customDomain string, port models.Port) (fqdn, generatedPrefix string)

func FQDNForPortWithPlatformDomain

func FQDNForPortWithPlatformDomain(resourceID, resourceName, baseDomain string, port models.Port) (string, string, error)

func IsBase64

func IsBase64(s string) bool

func ValidDNSName

func ValidDNSName(input string) string

Types

type AESEncryptionService

type AESEncryptionService struct {
	// contains filtered or unexported fields
}

AESEncryptionService implements EncryptionService using AES-256-GCM with PBKDF2

func (*AESEncryptionService) DecryptData

func (s *AESEncryptionService) DecryptData(in string) ([]byte, error)

DecryptData decrypts the base64-encoded string back to original data Expected format: base64(salt + nonce + ciphertext)

func (*AESEncryptionService) EncryptData

func (s *AESEncryptionService) EncryptData(in []byte) (string, error)

EncryptData encrypts the input data using AES-256-GCM with PBKDF2 key derivation Returns base64-encoded string containing: salt + nonce + ciphertext

type APITokenService

type APITokenService interface {
	Create(ctx context.Context, name string, scopes []string, resourceIDs []string, expiresAt *time.Time) (*models.APIToken, string, *errors.ServiceError)
	GetByID(ctx context.Context, id string) (*models.APIToken, *errors.ServiceError)
	List(ctx context.Context) ([]*models.APIToken, *errors.ServiceError)
	Revoke(ctx context.Context, id string) *errors.ServiceError
	ValidateToken(ctx context.Context, rawToken string) (*models.APIToken, *errors.ServiceError)
}

func NewAPITokenService

func NewAPITokenService(spec APITokenServiceSpec) APITokenService

type APITokenServiceSpec

type APITokenServiceSpec struct {
	SessionFactory db.SessionFactory
	Logger         logger.Logger
}

type AffectedStackRef

type AffectedStackRef struct {
	ID   string
	Name string
}

AffectedStackRef 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).

type ClusterClientGetter

type ClusterClientGetter interface {
	GetClient(clusterID string) (client.Client, error)
}

type ClusterResourceServiceInjectable

type ClusterResourceServiceInjectable = clusterresource.ClusterResourceServiceInjectable

Aliases: 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.

type ClusterService

type ClusterService interface {
	BackgroundJobEnqueuerInjectable
	GetClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)
	GetOwnedClusterForOrg(ctx context.Context, orgID string) (*models.Cluster, *errors.ServiceError)
	Get(ctx context.Context, ID string) (*models.Cluster, *errors.ServiceError)
	InternalGet(ctx context.Context, ID string) (*models.Cluster, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	AddCluster(ctx context.Context, cluster *models.Cluster) (*models.Cluster, *errors.ServiceError)
	InternalUpsertSharedComputeCluster(ctx context.Context, spec *models.Cluster) (*models.Cluster, *errors.ServiceError)
	InternalListAllClusters(ctx context.Context) ([]*models.Cluster, *errors.ServiceError)
	InjectClusterManager(clusterManager clustermanager.ClusterManager)
	InternalUpdateClusterInfo(ctx context.Context, clusterID string, info *models.ClusterInfo) *errors.ServiceError
	InternalEnsurePlatformWildcardTLS(ctx context.Context, cluster *models.Cluster, cfg *config.PlatformConfig) *errors.ServiceError
	DefaultStorageClass(ctx context.Context, clusterID string) (string, *errors.ServiceError)
}

func NewClusterService

func NewClusterService(spec ClusterServiceSpec) ClusterService

type ClusterServiceSpec

type ClusterServiceSpec struct {
	SessionFactory       db.SessionFactory
	ClusterStore         stores.ClusterStore
	ClusterManager       clustermanager.ClusterManager
	ImageRegistryService ImageRegistryService
	ComputeMode          config.ComputeMode
	PlatformTLSEnabled   bool
	Permissions          auth.PermissionService
	EncryptionService    EncryptionService
	Logger               logger.Logger
}

type CredentialResolver

type CredentialResolver = credentials.Resolver

The 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.

func NewCredentialResolver

func NewCredentialResolver(spec CredentialResolverSpec) CredentialResolver

type CredentialResolverSpec

type CredentialResolverSpec struct {
	// RegistryCredentialService is optional; when unset, registry resolution
	// falls through to anonymous.
	RegistryCredentialService registryCredentialResolverSource
	// GitIntegrationService is optional; when unset, git resolution falls
	// through to anonymous.
	GitIntegrationService gitIntegrationResolverSource
}

type CredentialSource

type CredentialSource = credentials.Source

The 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.

type DefaultingService

type DefaultingService[T any] interface {
	PopulateDefaultValues(resource T) (T, error)
}

func NewStackDefaultingService

func NewStackDefaultingService() DefaultingService[*models.Stack]

type EncryptionService

type EncryptionService interface {
	EncryptData(in []byte) (string, error)
	DecryptData(in string) ([]byte, error)
}

EncryptionService defines the interface for encryption operations

func NewAESEncryptionService

func NewAESEncryptionService(spec EncryptionServiceSpec) (EncryptionService, error)

NewAESEncryptionService creates a new AES encryption service with secure defaults

type EncryptionServiceSpec

type EncryptionServiceSpec struct {
	Masterkey string // Master key for encryption/decryption
}

type GitHubWebhookService

type GitHubWebhookService interface {
	// ProcessGitHubWebhook resolves the integration a delivery belongs to,
	// HMAC-verifies the payload against that integration's webhook secret,
	// and dispatches installation and pull_request events.
	ProcessGitHubWebhook(ctx context.Context, event string, payload []byte, signature string) *errors.ServiceError
}

GitHubWebhookService 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.

How we find out which org a delivery belongs to:

  • 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.
  • 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.
  • 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.

type GitHubWebhookServiceSpec

type GitHubWebhookServiceSpec struct {
	Store             stores.GitIntegrationStore
	InstallationStore stores.GitInstallationStore
	EncryptionService EncryptionService
	PreviewWebhook    PreviewWebhookService
	Logger            logger.Logger
	// PlatformApp mirrors GitIntegrationServiceSpec.PlatformApp; nil means
	// per-org apps.
	PlatformApp *githubapp.AppCredentials
}

type GitIntegrationService

type GitIntegrationService interface {
	Create(ctx context.Context, integration *models.GitIntegration) (*models.GitIntegration, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.GitIntegration, *errors.ServiceError)
	ListByOrgID(ctx context.Context, organisationID string) ([]*models.GitIntegration, *errors.ServiceError)
	Update(ctx context.Context, ID string, integration *models.GitIntegration) (*models.GitIntegration, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	Verify(ctx context.Context, ID, repoURL string) *errors.ServiceError

	// InternalGetForHost returns the decrypted git_credentials integration for
	// (org, host). No permission checks; used by the credential resolver.
	InternalGetForHost(ctx context.Context, organisationID, host string) (*models.GitIntegration, *errors.ServiceError)
	// InternalGetByID returns the decrypted integration by ID. No permission
	// checks; used by the credential resolver for explicit overrides.
	InternalGetByID(ctx context.Context, ID string) (*models.GitIntegration, *errors.ServiceError)

	// GitHub App manifest flow, installations, and discovery.
	CreateGitHubAppManifest(ctx context.Context, organisationID string) (*models.GitHubAppManifestFlow, *errors.ServiceError)
	HandleGitHubManifestCallback(ctx context.Context, code, state string) (string, *errors.ServiceError)
	HandleGitHubAppSetup(ctx context.Context, installationID int64, state string) (string, *errors.ServiceError)
	ListInstallations(ctx context.Context, integrationID string, refresh bool) ([]*models.GitInstallation, *errors.ServiceError)
	ListRepositories(ctx context.Context, integrationID string, page int, installationUUID string) (*githubapp.RepoPage, *errors.ServiceError)
	GetRepository(ctx context.Context, integrationID, owner, repo string) (*githubapp.Repo, *errors.ServiceError)
	ListRepositoryBranches(ctx context.Context, integrationID, owner, repo string) ([]string, *errors.ServiceError)

	// InternalMintForRepo mints an installation token for the org's installed
	// GitHub App when it covers the repository owner (404 to fall through).
	InternalMintForRepo(ctx context.Context, organisationID, repoURL string) (*models.GitHubAppMintResult, *errors.ServiceError)
	// InternalMintCloneToken re-mints a token for a known integration; used
	// by the hub-side token refresher.
	InternalMintCloneToken(ctx context.Context, integrationID, repoURL string) (*models.GitHubAppMintResult, *errors.ServiceError)
}

type GitIntegrationServiceSpec

type GitIntegrationServiceSpec struct {
	Store             stores.GitIntegrationStore
	InstallationStore stores.GitInstallationStore
	OAuthStateStore   stores.OAuthStateStore
	OrganisationStore stores.OrganisationStore
	AtomicExecutor    stores.AtomicExecutor
	GitHubAppClient   githubapp.Client
	EncryptionService EncryptionService
	Permissions       auth.PermissionService
	Logger            logger.Logger
	// ExternalURL is the hub's externally reachable base URL, required for
	// the GitHub App manifest flow.
	ExternalURL string
	// PlatformApp is the platform-wide GitHub App every org installs. Nil
	// keeps each org creating its own app through the manifest flow.
	PlatformApp *githubapp.AppCredentials
	// GitClients is optional; it defaults to real git clients.
	GitClients verifyGitClientProvider
}

type ImageBuildService

type ImageBuildService interface {
	InternalCreate(ctx context.Context, resourceBuild *models.ImageBuild) (*models.ImageBuild, *errors.ServiceError)
	InternalUpdateStatus(ctx context.Context, BuildID string, status *models.ImageBuildStatus) *errors.ServiceError
	ListByResourceName(ctx context.Context, stackID string, resourceName string) ([]*models.ImageBuild, *errors.ServiceError)
	ListByStackID(ctx context.Context, stackID string) ([]*models.ImageBuild, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)
	InternalGetByID(ctx context.Context, ID string) (*models.ImageBuild, *errors.ServiceError)
}

func NewImageBuildService

func NewImageBuildService(spec ImageBuildServiceSpec) ImageBuildService

type ImageBuildServiceSpec

type ImageBuildServiceSpec struct {
	SessionFactory       db.SessionFactory
	StackResourceService StackResourceService
	Logger               logger.Logger
	Permissions          auth.PermissionService
	StackStore           stores.StackStore
}

type ImageRegistryService

type ImageRegistryService interface {
	BackgroundJobEnqueuerInjectable
	Get(ctx context.Context, ID string) (*models.ClusterImageRegistry, *errors.ServiceError)
	InternalGet(ctx context.Context, ID string) (*models.ClusterImageRegistry, *errors.ServiceError)
	InternalMarkAllDeletingByClusterIDWithTx(ctx context.Context, clusterID string) *errors.ServiceError
	ListForOrg(ctx context.Context, orgID string) ([]*models.ClusterImageRegistry, *errors.ServiceError)
	ListByClusterID(ctx context.Context, orgID, clusterID string) ([]*models.ClusterImageRegistry, *errors.ServiceError)
	Create(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)
	InternalCreateSeedRegistry(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)
	CreateWithTx(ctx context.Context, spec *models.ClusterImageRegistry) (*models.ClusterImageRegistry, *errors.ServiceError)
	DeleteWithTx(ctx context.Context, orgID string, registry *models.ClusterImageRegistry) *errors.ServiceError
	UpdateStatus(ctx context.Context, ID string, status *models.ClusterImageRegistryStatus) *errors.ServiceError
	PopulateInClusterRegistryNameForResource(ctx context.Context, orgID, clusterID, stackName string, resource *models.StackResource) *errors.ServiceError
	Delete(ctx context.Context, orgID, ID string) *errors.ServiceError
}

func NewClusterImageRegistryService

func NewClusterImageRegistryService(spec ImageRegistryServiceSpec) ImageRegistryService

type ImageRegistryServiceSpec

type ImageRegistryServiceSpec struct {
	SessionFactory db.SessionFactory
	Permissions    auth.PermissionService
	Logger         logger.Logger
}

type LoggingParams

type LoggingParams struct {
	// contains filtered or unexported fields
}

func NewLoggingParams

func NewLoggingParams(queryValues url.Values) (*LoggingParams, error)

func (*LoggingParams) Follow

func (p *LoggingParams) Follow() bool

func (*LoggingParams) Since

func (p *LoggingParams) Since() string

func (*LoggingParams) TailLines

func (p *LoggingParams) TailLines() int

type LoggingService

type LoggingService interface {
	StreamLogsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)
	StreamLogsForStack(ctx context.Context, orgID string, stackID string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)
	StreamLogsForBuild(ctx context.Context, orgID string, buildID string, options *LoggingParams) (interfaces.ServerSideStreamable, *errors.ServiceError)
	ClusterResourceServiceInjectable
}

func NewLoggingService

func NewLoggingService(spec LoggingServiceSpec) LoggingService

type LoggingServiceSpec

type LoggingServiceSpec struct {
	ClusterService       ClusterService
	StackResourceService StackResourceService
	ImageBuildService    ImageBuildService
	Logger               logger.Logger
}

type MetricsService

type MetricsService interface {
	GetMetricsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string) (*models.ResourceMetrics, error)
	GetMetricsForStack(ctx context.Context, orgID string, stackID string) (*models.ResourceMetrics, error)
	StreamMetricsForStackResource(ctx context.Context, orgID string, stackID string, stackResourceName string) (interfaces.ServerSideStreamable, error)
	StreamMetricsForStack(ctx context.Context, orgID string, stackID string) (interfaces.ServerSideStreamable, error)
	ClusterResourceServiceInjectable
}

func NewMetricsService

func NewMetricsService(spec MetricsServiceSpec) MetricsService

type MetricsServiceSpec

type MetricsServiceSpec struct {
	ClusterService       ClusterService
	StackResourceService StackResourceService
	StackService         StackService
	Logger               logger.Logger
}

type MockClusterLoggingService

type MockClusterLoggingService struct {
	// contains filtered or unexported fields
}

MockClusterLoggingService is a mock of ClusterLoggingService interface.

func NewMockClusterLoggingService

func NewMockClusterLoggingService(ctrl *gomock.Controller) *MockClusterLoggingService

NewMockClusterLoggingService creates a new mock instance.

func (*MockClusterLoggingService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClusterLoggingService) GetLogsForBuildPod

func (m *MockClusterLoggingService) GetLogsForBuildPod(ctx context.Context, orgID, namespace, buildName string, options clusterresource.LoggingParams) (interfaces.ServerSideStreamable, error)

GetLogsForBuildPod mocks base method.

func (*MockClusterLoggingService) GetLogsForResources

GetLogsForResources mocks base method.

type MockClusterLoggingServiceMockRecorder

type MockClusterLoggingServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockClusterLoggingServiceMockRecorder is the mock recorder for MockClusterLoggingService.

func (*MockClusterLoggingServiceMockRecorder) GetLogsForBuildPod

func (mr *MockClusterLoggingServiceMockRecorder) GetLogsForBuildPod(ctx, orgID, namespace, buildName, options any) *gomock.Call

GetLogsForBuildPod indicates an expected call of GetLogsForBuildPod.

func (*MockClusterLoggingServiceMockRecorder) GetLogsForResources

func (mr *MockClusterLoggingServiceMockRecorder) GetLogsForResources(ctx, orgID, resources, options any) *gomock.Call

GetLogsForResources indicates an expected call of GetLogsForResources.

type MockImageBuildService

type MockImageBuildService struct {
	// contains filtered or unexported fields
}

MockImageBuildService is a mock of ImageBuildService interface.

func NewMockImageBuildService

func NewMockImageBuildService(ctrl *gomock.Controller) *MockImageBuildService

NewMockImageBuildService creates a new mock instance.

func (*MockImageBuildService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockImageBuildService) GetByID

GetByID mocks base method.

func (*MockImageBuildService) InternalCreate

func (m *MockImageBuildService) InternalCreate(ctx context.Context, resourceBuild *models.ImageBuild) (*models.ImageBuild, *errors.ServiceError)

InternalCreate mocks base method.

func (*MockImageBuildService) InternalGetByID

InternalGetByID mocks base method.

func (*MockImageBuildService) InternalUpdateStatus

func (m *MockImageBuildService) InternalUpdateStatus(ctx context.Context, BuildID string, status *models.ImageBuildStatus) *errors.ServiceError

InternalUpdateStatus mocks base method.

func (*MockImageBuildService) ListByResourceName

func (m *MockImageBuildService) ListByResourceName(ctx context.Context, stackID, resourceName string) ([]*models.ImageBuild, *errors.ServiceError)

ListByResourceName mocks base method.

func (*MockImageBuildService) ListByStackID

func (m *MockImageBuildService) ListByStackID(ctx context.Context, stackID string) ([]*models.ImageBuild, *errors.ServiceError)

ListByStackID mocks base method.

type MockImageBuildServiceMockRecorder

type MockImageBuildServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockImageBuildServiceMockRecorder is the mock recorder for MockImageBuildService.

func (*MockImageBuildServiceMockRecorder) GetByID

func (mr *MockImageBuildServiceMockRecorder) GetByID(ctx, ID any) *gomock.Call

GetByID indicates an expected call of GetByID.

func (*MockImageBuildServiceMockRecorder) InternalCreate

func (mr *MockImageBuildServiceMockRecorder) InternalCreate(ctx, resourceBuild any) *gomock.Call

InternalCreate indicates an expected call of InternalCreate.

func (*MockImageBuildServiceMockRecorder) InternalGetByID

func (mr *MockImageBuildServiceMockRecorder) InternalGetByID(ctx, ID any) *gomock.Call

InternalGetByID indicates an expected call of InternalGetByID.

func (*MockImageBuildServiceMockRecorder) InternalUpdateStatus

func (mr *MockImageBuildServiceMockRecorder) InternalUpdateStatus(ctx, BuildID, status any) *gomock.Call

InternalUpdateStatus indicates an expected call of InternalUpdateStatus.

func (*MockImageBuildServiceMockRecorder) ListByResourceName

func (mr *MockImageBuildServiceMockRecorder) ListByResourceName(ctx, stackID, resourceName any) *gomock.Call

ListByResourceName indicates an expected call of ListByResourceName.

func (*MockImageBuildServiceMockRecorder) ListByStackID

func (mr *MockImageBuildServiceMockRecorder) ListByStackID(ctx, stackID any) *gomock.Call

ListByStackID indicates an expected call of ListByStackID.

type MockPreviewCommentService

type MockPreviewCommentService struct {
	// contains filtered or unexported fields
}

MockPreviewCommentService is a mock of PreviewCommentService interface.

func NewMockPreviewCommentService

func NewMockPreviewCommentService(ctrl *gomock.Controller) *MockPreviewCommentService

NewMockPreviewCommentService creates a new mock instance.

func (*MockPreviewCommentService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPreviewCommentService) InternalUpsertComment

func (m *MockPreviewCommentService) InternalUpsertComment(ctx context.Context, preview *models.PreviewStack) error

InternalUpsertComment mocks base method.

type MockPreviewCommentServiceMockRecorder

type MockPreviewCommentServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockPreviewCommentServiceMockRecorder is the mock recorder for MockPreviewCommentService.

func (*MockPreviewCommentServiceMockRecorder) InternalUpsertComment

func (mr *MockPreviewCommentServiceMockRecorder) InternalUpsertComment(ctx, preview any) *gomock.Call

InternalUpsertComment indicates an expected call of InternalUpsertComment.

type MockPreviewStackService

type MockPreviewStackService struct {
	// contains filtered or unexported fields
}

MockPreviewStackService is a mock of PreviewStackService interface.

func NewMockPreviewStackService

func NewMockPreviewStackService(ctrl *gomock.Controller) *MockPreviewStackService

NewMockPreviewStackService creates a new mock instance.

func (*MockPreviewStackService) Create

Create mocks base method.

func (*MockPreviewStackService) Delete

func (m *MockPreviewStackService) Delete(ctx context.Context, previewStackID string) *errors.ServiceError

Delete mocks base method.

func (*MockPreviewStackService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPreviewStackService) Get

Get mocks base method.

func (*MockPreviewStackService) InjectBackgroundJobEnqueuer

func (m *MockPreviewStackService) InjectBackgroundJobEnqueuer(dep clusterresource.BackgroundJobEnqueuerDep)

InjectBackgroundJobEnqueuer mocks base method.

func (*MockPreviewStackService) InternalBuildStackFromContent

func (m *MockPreviewStackService) InternalBuildStackFromContent(ctx context.Context, config *models.StackPreviewConfig, preview *models.PreviewStack, stackFileBytes []byte) (*models.Stack, *errors.OperationError)

InternalBuildStackFromContent mocks base method.

func (*MockPreviewStackService) InternalCreateFromWebhook

func (m *MockPreviewStackService) InternalCreateFromWebhook(ctx context.Context, config *models.StackPreviewConfig, prNumber, branch, headSHA string) (*models.PreviewStack, *errors.ServiceError)

InternalCreateFromWebhook mocks base method.

func (*MockPreviewStackService) InternalDeleteFromWebhook

func (m *MockPreviewStackService) InternalDeleteFromWebhook(ctx context.Context, previewStackID string) *errors.ServiceError

InternalDeleteFromWebhook mocks base method.

func (*MockPreviewStackService) InternalFetchStackfile

func (m *MockPreviewStackService) InternalFetchStackfile(ctx context.Context, config *models.StackPreviewConfig, commitSHA string) ([]byte, string, *errors.OperationError)

InternalFetchStackfile mocks base method.

func (*MockPreviewStackService) InternalSyncFromWebhook

func (m *MockPreviewStackService) InternalSyncFromWebhook(ctx context.Context, previewStackID, headSHA string) *errors.ServiceError

InternalSyncFromWebhook mocks base method.

func (*MockPreviewStackService) List

List mocks base method.

func (*MockPreviewStackService) Sync

func (m *MockPreviewStackService) Sync(ctx context.Context, previewStackID string, opts PreviewSyncOpts) *errors.ServiceError

Sync mocks base method.

type MockPreviewStackServiceMockRecorder

type MockPreviewStackServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockPreviewStackServiceMockRecorder is the mock recorder for MockPreviewStackService.

func (*MockPreviewStackServiceMockRecorder) Create

func (mr *MockPreviewStackServiceMockRecorder) Create(ctx, preview any) *gomock.Call

Create indicates an expected call of Create.

func (*MockPreviewStackServiceMockRecorder) Delete

func (mr *MockPreviewStackServiceMockRecorder) Delete(ctx, previewStackID any) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockPreviewStackServiceMockRecorder) Get

func (mr *MockPreviewStackServiceMockRecorder) Get(ctx, previewStackID any) *gomock.Call

Get indicates an expected call of Get.

func (*MockPreviewStackServiceMockRecorder) InjectBackgroundJobEnqueuer

func (mr *MockPreviewStackServiceMockRecorder) InjectBackgroundJobEnqueuer(dep any) *gomock.Call

InjectBackgroundJobEnqueuer indicates an expected call of InjectBackgroundJobEnqueuer.

func (*MockPreviewStackServiceMockRecorder) InternalBuildStackFromContent

func (mr *MockPreviewStackServiceMockRecorder) InternalBuildStackFromContent(ctx, config, preview, stackFileBytes any) *gomock.Call

InternalBuildStackFromContent indicates an expected call of InternalBuildStackFromContent.

func (*MockPreviewStackServiceMockRecorder) InternalCreateFromWebhook

func (mr *MockPreviewStackServiceMockRecorder) InternalCreateFromWebhook(ctx, config, prNumber, branch, headSHA any) *gomock.Call

InternalCreateFromWebhook indicates an expected call of InternalCreateFromWebhook.

func (*MockPreviewStackServiceMockRecorder) InternalDeleteFromWebhook

func (mr *MockPreviewStackServiceMockRecorder) InternalDeleteFromWebhook(ctx, previewStackID any) *gomock.Call

InternalDeleteFromWebhook indicates an expected call of InternalDeleteFromWebhook.

func (*MockPreviewStackServiceMockRecorder) InternalFetchStackfile

func (mr *MockPreviewStackServiceMockRecorder) InternalFetchStackfile(ctx, config, commitSHA any) *gomock.Call

InternalFetchStackfile indicates an expected call of InternalFetchStackfile.

func (*MockPreviewStackServiceMockRecorder) InternalSyncFromWebhook

func (mr *MockPreviewStackServiceMockRecorder) InternalSyncFromWebhook(ctx, previewStackID, headSHA any) *gomock.Call

InternalSyncFromWebhook indicates an expected call of InternalSyncFromWebhook.

func (*MockPreviewStackServiceMockRecorder) List

func (mr *MockPreviewStackServiceMockRecorder) List(ctx, projectID, params any) *gomock.Call

List indicates an expected call of List.

func (*MockPreviewStackServiceMockRecorder) Sync

func (mr *MockPreviewStackServiceMockRecorder) Sync(ctx, previewStackID, opts any) *gomock.Call

Sync indicates an expected call of Sync.

type MockPreviewWebhookService

type MockPreviewWebhookService struct {
	// contains filtered or unexported fields
}

MockPreviewWebhookService is a mock of PreviewWebhookService interface.

func NewMockPreviewWebhookService

func NewMockPreviewWebhookService(ctrl *gomock.Controller) *MockPreviewWebhookService

NewMockPreviewWebhookService creates a new mock instance.

func (*MockPreviewWebhookService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPreviewWebhookService) HandlePullRequest

HandlePullRequest mocks base method.

type MockPreviewWebhookServiceMockRecorder

type MockPreviewWebhookServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockPreviewWebhookServiceMockRecorder is the mock recorder for MockPreviewWebhookService.

func (*MockPreviewWebhookServiceMockRecorder) HandlePullRequest

func (mr *MockPreviewWebhookServiceMockRecorder) HandlePullRequest(ctx, ev any) *gomock.Call

HandlePullRequest indicates an expected call of HandlePullRequest.

type MockReleaseEventRecorder

type MockReleaseEventRecorder struct {
	// contains filtered or unexported fields
}

MockReleaseEventRecorder is a mock of ReleaseEventRecorder interface.

func NewMockReleaseEventRecorder

func NewMockReleaseEventRecorder(ctrl *gomock.Controller) *MockReleaseEventRecorder

NewMockReleaseEventRecorder creates a new mock instance.

func (*MockReleaseEventRecorder) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockReleaseEventRecorder) Record

Record mocks base method.

func (*MockReleaseEventRecorder) RecordBuildEvent

func (m *MockReleaseEventRecorder) RecordBuildEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, buildID string, failure *models.BuildFailureDetail) *errors.ServiceError

RecordBuildEvent mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseCheckFailed

func (m *MockReleaseEventRecorder) RecordReleaseCheckFailed(ctx context.Context, release *models.StackRelease, resourceName, check, reason string) *errors.ServiceError

RecordReleaseCheckFailed mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseChecksPassed

func (m *MockReleaseEventRecorder) RecordReleaseChecksPassed(ctx context.Context, release *models.StackRelease) *errors.ServiceError

RecordReleaseChecksPassed mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseChecksStarted

func (m *MockReleaseEventRecorder) RecordReleaseChecksStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError

RecordReleaseChecksStarted mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseCreated

func (m *MockReleaseEventRecorder) RecordReleaseCreated(ctx context.Context, release *models.StackRelease) *errors.ServiceError

RecordReleaseCreated mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseStarted

func (m *MockReleaseEventRecorder) RecordReleaseStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError

RecordReleaseStarted mocks base method.

func (*MockReleaseEventRecorder) RecordReleaseTerminal

func (m *MockReleaseEventRecorder) RecordReleaseTerminal(ctx context.Context, release *models.StackRelease, state models.StackReleaseState, message string) *errors.ServiceError

RecordReleaseTerminal mocks base method.

func (*MockReleaseEventRecorder) RecordResourceEvent

func (m *MockReleaseEventRecorder) RecordResourceEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, reason, message string) *errors.ServiceError

RecordResourceEvent mocks base method.

type MockReleaseEventRecorderMockRecorder

type MockReleaseEventRecorderMockRecorder struct {
	// contains filtered or unexported fields
}

MockReleaseEventRecorderMockRecorder is the mock recorder for MockReleaseEventRecorder.

func (*MockReleaseEventRecorderMockRecorder) Record

func (mr *MockReleaseEventRecorderMockRecorder) Record(ctx, input any) *gomock.Call

Record indicates an expected call of Record.

func (*MockReleaseEventRecorderMockRecorder) RecordBuildEvent

func (mr *MockReleaseEventRecorderMockRecorder) RecordBuildEvent(ctx, release, resourceName, eventType, buildID, failure any) *gomock.Call

RecordBuildEvent indicates an expected call of RecordBuildEvent.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseCheckFailed

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseCheckFailed(ctx, release, resourceName, check, reason any) *gomock.Call

RecordReleaseCheckFailed indicates an expected call of RecordReleaseCheckFailed.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseChecksPassed

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseChecksPassed(ctx, release any) *gomock.Call

RecordReleaseChecksPassed indicates an expected call of RecordReleaseChecksPassed.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseChecksStarted

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseChecksStarted(ctx, release any) *gomock.Call

RecordReleaseChecksStarted indicates an expected call of RecordReleaseChecksStarted.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseCreated

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseCreated(ctx, release any) *gomock.Call

RecordReleaseCreated indicates an expected call of RecordReleaseCreated.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseStarted

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseStarted(ctx, release any) *gomock.Call

RecordReleaseStarted indicates an expected call of RecordReleaseStarted.

func (*MockReleaseEventRecorderMockRecorder) RecordReleaseTerminal

func (mr *MockReleaseEventRecorderMockRecorder) RecordReleaseTerminal(ctx, release, state, message any) *gomock.Call

RecordReleaseTerminal indicates an expected call of RecordReleaseTerminal.

func (*MockReleaseEventRecorderMockRecorder) RecordResourceEvent

func (mr *MockReleaseEventRecorderMockRecorder) RecordResourceEvent(ctx, release, resourceName, eventType, reason, message any) *gomock.Call

RecordResourceEvent indicates an expected call of RecordResourceEvent.

type MockStackService

type MockStackService struct {
	// contains filtered or unexported fields
}

MockStackService is a mock of StackService interface.

func NewMockStackService

func NewMockStackService(ctrl *gomock.Controller) *MockStackService

NewMockStackService creates a new mock instance.

func (*MockStackService) ApplyStack

func (m *MockStackService) ApplyStack(ctx context.Context, spec *models.Stack) (*models.Stack, bool, *errors.ServiceError)

ApplyStack mocks base method.

func (*MockStackService) CreateStack

func (m *MockStackService) CreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)

CreateStack mocks base method.

func (*MockStackService) CreateStackConnection

func (m *MockStackService) CreateStackConnection(ctx context.Context, stackID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)

CreateStackConnection mocks base method.

func (*MockStackService) CreateStackVolume

func (m *MockStackService) CreateStackVolume(ctx context.Context, stackID string, volume *models.Volume) (*models.Volume, *errors.ServiceError)

CreateStackVolume mocks base method.

func (*MockStackService) DeleteStack

func (m *MockStackService) DeleteStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)

DeleteStack mocks base method.

func (*MockStackService) DeleteStackConnection

func (m *MockStackService) DeleteStackConnection(ctx context.Context, stackID, connectionID string) *errors.ServiceError

DeleteStackConnection mocks base method.

func (*MockStackService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockStackService) GetStack

GetStack mocks base method.

func (*MockStackService) GetStackTopology

func (m *MockStackService) GetStackTopology(ctx context.Context, ID string) (*models.StackTopology, *errors.ServiceError)

GetStackTopology mocks base method.

func (*MockStackService) GetStacksByOrganisationID

func (m *MockStackService) GetStacksByOrganisationID(ctx context.Context, organisationID string) ([]*models.Stack, *errors.ServiceError)

GetStacksByOrganisationID mocks base method.

func (*MockStackService) GetStacksByProjectID

func (m *MockStackService) GetStacksByProjectID(ctx context.Context, projectID string) ([]*models.Stack, *errors.ServiceError)

GetStacksByProjectID mocks base method.

func (*MockStackService) InjectBackgroundJobEnqueuer

func (m *MockStackService) InjectBackgroundJobEnqueuer(dep clusterresource.BackgroundJobEnqueuerDep)

InjectBackgroundJobEnqueuer mocks base method.

func (*MockStackService) InjectClusterResourceServiceDeps

func (m *MockStackService) InjectClusterResourceServiceDeps(deps clusterresource.ClusterResourceServiceDeps)

InjectClusterResourceServiceDeps mocks base method.

func (*MockStackService) InternalCreateStack

func (m *MockStackService) InternalCreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)

InternalCreateStack mocks base method.

func (*MockStackService) InternalDeleteFromDB

func (m *MockStackService) InternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError

InternalDeleteFromDB mocks base method.

func (*MockStackService) InternalDeleteStack

func (m *MockStackService) InternalDeleteStack(ctx context.Context, stack *models.Stack) (*models.Stack, *errors.ServiceError)

InternalDeleteStack mocks base method.

func (*MockStackService) InternalGetStack

func (m *MockStackService) InternalGetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)

InternalGetStack mocks base method.

func (*MockStackService) InternalList

func (m *MockStackService) InternalList(ctx context.Context, query string, args ...any) ([]*models.Stack, *errors.ServiceError)

InternalList mocks base method.

func (*MockStackService) InternalUpdateStack

func (m *MockStackService) InternalUpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)

InternalUpdateStack mocks base method.

func (*MockStackService) ListStackConnections

func (m *MockStackService) ListStackConnections(ctx context.Context, stackID string) (models.StackConnections, *errors.ServiceError)

ListStackConnections mocks base method.

func (*MockStackService) ListStacksForCurrentUser

func (m *MockStackService) ListStacksForCurrentUser(ctx context.Context, orgID string) ([]*models.Stack, *errors.ServiceError)

ListStacksForCurrentUser mocks base method.

func (*MockStackService) SetReleaseService

func (m *MockStackService) SetReleaseService(rs releaseServiceForStack)

SetReleaseService mocks base method.

func (*MockStackService) UpdateStack

func (m *MockStackService) UpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)

UpdateStack mocks base method.

func (*MockStackService) UpdateStackConnection

func (m *MockStackService) UpdateStackConnection(ctx context.Context, stackID, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)

UpdateStackConnection mocks base method.

func (*MockStackService) UpdateStackCrRevision

func (m *MockStackService) UpdateStackCrRevision(ctx context.Context, ID, revision string) *errors.ServiceError

UpdateStackCrRevision mocks base method.

func (*MockStackService) UpdateStackShell

func (m *MockStackService) UpdateStackShell(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)

UpdateStackShell mocks base method.

func (*MockStackService) UpdateStatus

func (m *MockStackService) UpdateStatus(ctx context.Context, ID string, status *models.StackStatus) *errors.ServiceError

UpdateStatus mocks base method.

type MockStackServiceMockRecorder

type MockStackServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockStackServiceMockRecorder is the mock recorder for MockStackService.

func (*MockStackServiceMockRecorder) ApplyStack

func (mr *MockStackServiceMockRecorder) ApplyStack(ctx, spec any) *gomock.Call

ApplyStack indicates an expected call of ApplyStack.

func (*MockStackServiceMockRecorder) CreateStack

func (mr *MockStackServiceMockRecorder) CreateStack(ctx, spec any) *gomock.Call

CreateStack indicates an expected call of CreateStack.

func (*MockStackServiceMockRecorder) CreateStackConnection

func (mr *MockStackServiceMockRecorder) CreateStackConnection(ctx, stackID, connection any) *gomock.Call

CreateStackConnection indicates an expected call of CreateStackConnection.

func (*MockStackServiceMockRecorder) CreateStackVolume

func (mr *MockStackServiceMockRecorder) CreateStackVolume(ctx, stackID, volume any) *gomock.Call

CreateStackVolume indicates an expected call of CreateStackVolume.

func (*MockStackServiceMockRecorder) DeleteStack

func (mr *MockStackServiceMockRecorder) DeleteStack(ctx, ID any) *gomock.Call

DeleteStack indicates an expected call of DeleteStack.

func (*MockStackServiceMockRecorder) DeleteStackConnection

func (mr *MockStackServiceMockRecorder) DeleteStackConnection(ctx, stackID, connectionID any) *gomock.Call

DeleteStackConnection indicates an expected call of DeleteStackConnection.

func (*MockStackServiceMockRecorder) GetStack

func (mr *MockStackServiceMockRecorder) GetStack(ctx, ID any) *gomock.Call

GetStack indicates an expected call of GetStack.

func (*MockStackServiceMockRecorder) GetStackTopology

func (mr *MockStackServiceMockRecorder) GetStackTopology(ctx, ID any) *gomock.Call

GetStackTopology indicates an expected call of GetStackTopology.

func (*MockStackServiceMockRecorder) GetStacksByOrganisationID

func (mr *MockStackServiceMockRecorder) GetStacksByOrganisationID(ctx, organisationID any) *gomock.Call

GetStacksByOrganisationID indicates an expected call of GetStacksByOrganisationID.

func (*MockStackServiceMockRecorder) GetStacksByProjectID

func (mr *MockStackServiceMockRecorder) GetStacksByProjectID(ctx, projectID any) *gomock.Call

GetStacksByProjectID indicates an expected call of GetStacksByProjectID.

func (*MockStackServiceMockRecorder) InjectBackgroundJobEnqueuer

func (mr *MockStackServiceMockRecorder) InjectBackgroundJobEnqueuer(dep any) *gomock.Call

InjectBackgroundJobEnqueuer indicates an expected call of InjectBackgroundJobEnqueuer.

func (*MockStackServiceMockRecorder) InjectClusterResourceServiceDeps

func (mr *MockStackServiceMockRecorder) InjectClusterResourceServiceDeps(deps any) *gomock.Call

InjectClusterResourceServiceDeps indicates an expected call of InjectClusterResourceServiceDeps.

func (*MockStackServiceMockRecorder) InternalCreateStack

func (mr *MockStackServiceMockRecorder) InternalCreateStack(ctx, spec any) *gomock.Call

InternalCreateStack indicates an expected call of InternalCreateStack.

func (*MockStackServiceMockRecorder) InternalDeleteFromDB

func (mr *MockStackServiceMockRecorder) InternalDeleteFromDB(ctx, ID any) *gomock.Call

InternalDeleteFromDB indicates an expected call of InternalDeleteFromDB.

func (*MockStackServiceMockRecorder) InternalDeleteStack

func (mr *MockStackServiceMockRecorder) InternalDeleteStack(ctx, stack any) *gomock.Call

InternalDeleteStack indicates an expected call of InternalDeleteStack.

func (*MockStackServiceMockRecorder) InternalGetStack

func (mr *MockStackServiceMockRecorder) InternalGetStack(ctx, ID any) *gomock.Call

InternalGetStack indicates an expected call of InternalGetStack.

func (*MockStackServiceMockRecorder) InternalList

func (mr *MockStackServiceMockRecorder) InternalList(ctx, query any, args ...any) *gomock.Call

InternalList indicates an expected call of InternalList.

func (*MockStackServiceMockRecorder) InternalUpdateStack

func (mr *MockStackServiceMockRecorder) InternalUpdateStack(ctx, ID, spec any) *gomock.Call

InternalUpdateStack indicates an expected call of InternalUpdateStack.

func (*MockStackServiceMockRecorder) ListStackConnections

func (mr *MockStackServiceMockRecorder) ListStackConnections(ctx, stackID any) *gomock.Call

ListStackConnections indicates an expected call of ListStackConnections.

func (*MockStackServiceMockRecorder) ListStacksForCurrentUser

func (mr *MockStackServiceMockRecorder) ListStacksForCurrentUser(ctx, orgID any) *gomock.Call

ListStacksForCurrentUser indicates an expected call of ListStacksForCurrentUser.

func (*MockStackServiceMockRecorder) SetReleaseService

func (mr *MockStackServiceMockRecorder) SetReleaseService(rs any) *gomock.Call

SetReleaseService indicates an expected call of SetReleaseService.

func (*MockStackServiceMockRecorder) UpdateStack

func (mr *MockStackServiceMockRecorder) UpdateStack(ctx, ID, spec any) *gomock.Call

UpdateStack indicates an expected call of UpdateStack.

func (*MockStackServiceMockRecorder) UpdateStackConnection

func (mr *MockStackServiceMockRecorder) UpdateStackConnection(ctx, stackID, connectionID, connection any) *gomock.Call

UpdateStackConnection indicates an expected call of UpdateStackConnection.

func (*MockStackServiceMockRecorder) UpdateStackCrRevision

func (mr *MockStackServiceMockRecorder) UpdateStackCrRevision(ctx, ID, revision any) *gomock.Call

UpdateStackCrRevision indicates an expected call of UpdateStackCrRevision.

func (*MockStackServiceMockRecorder) UpdateStackShell

func (mr *MockStackServiceMockRecorder) UpdateStackShell(ctx, ID, spec any) *gomock.Call

UpdateStackShell indicates an expected call of UpdateStackShell.

func (*MockStackServiceMockRecorder) UpdateStatus

func (mr *MockStackServiceMockRecorder) UpdateStatus(ctx, ID, status any) *gomock.Call

UpdateStatus indicates an expected call of UpdateStatus.

type NamespaceService

type NamespaceService interface {
	CreateInDB(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)
	CreateInCluster(ctx context.Context, ns *models.Namespace) *errors.ServiceError
	CreateInDBWithTx(ctx context.Context, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)
	Get(ctx context.Context, id string) (*models.Namespace, *errors.ServiceError)
	DeleteFromDB(ctx context.Context, id string) *errors.ServiceError
	InternalDeleteFromDB(ctx context.Context, id string) *errors.ServiceError
	DeleteFromDBWithTx(ctx context.Context, id string) *errors.ServiceError
	UpdateInDB(ctx context.Context, id string, ns *models.Namespace) (*models.Namespace, *errors.ServiceError)
	ListByOrganisation(ctx context.Context, organisationID string) ([]*models.Namespace, *errors.ServiceError)
	ListByStack(ctx context.Context, stackID string) ([]*models.Namespace, *errors.ServiceError)
	PrepareNamespaceForStack(ctx context.Context, stack *models.Stack) (*models.Namespace, *errors.ServiceError)
	PrepareNamespaceForAddon(ctx context.Context, addon models.Addon, orgID string) (*models.Namespace, *errors.ServiceError)
	ClusterResourceServiceInjectable
}

func NewNamespaceService

func NewNamespaceService(spec NamespaceServiceSpec) NamespaceService

type NamespaceServiceSpec

type NamespaceServiceSpec struct {
	SessionFactory db.SessionFactory
	Logger         logger.Logger
	SharedCompute  bool
}

type ObjectStoreService

type ObjectStoreService interface {
	Create(ctx context.Context, objectStore *models.ObjectStore) (*models.ObjectStore, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.ObjectStore, *errors.ServiceError)
	InternalGetByID(ctx context.Context, ID string) (*models.ObjectStore, *errors.ServiceError)
	GetByName(ctx context.Context, organisationID, name string) (*models.ObjectStore, *errors.ServiceError)
	Update(ctx context.Context, id string, objectStore *models.ObjectStore) (*models.ObjectStore, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	ListByOrganisation(ctx context.Context, organisationID string) ([]*models.ObjectStore, *errors.ServiceError)
	ListByProjectID(ctx context.Context, projectID string) ([]*models.ObjectStore, *errors.ServiceError)
	ListObjectStoresForCurrentUser(ctx context.Context, orgID string) ([]*models.ObjectStore, *errors.ServiceError)
	ValidateObjectStoreExists(ctx context.Context, objectStoreID string) (bool, *errors.ServiceError)
	TestConnection(ctx context.Context, objectStoreID string) *errors.ServiceError
	UpdateStatus(ctx context.Context, id string, status models.ObjectStoreStatus) *errors.ServiceError
}

func NewObjectStoreService

func NewObjectStoreService(spec ObjectStoreServiceSpec) ObjectStoreService

type ObjectStoreServiceSpec

type ObjectStoreServiceSpec struct {
	SessionFactory db.SessionFactory
	SecretService  SecretService
	ProjectService ProjectService
	ClusterManager clustermanager.ClusterManager
	Permissions    auth.PermissionService
	Logger         logger.Logger
}

type OrgInviteService

type OrgInviteService interface {
	BackgroundJobEnqueuerInjectable
	Create(ctx context.Context, email, projectName string, role models.ProjectRole, expiresInDays int) (*models.OrgInvite, string, *errors.ServiceError)
	List(ctx context.Context, orgID string, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)
	GetByID(ctx context.Context, orgID, id string) (*models.OrgInvite, *errors.ServiceError)
	Revoke(ctx context.Context, orgID, id string) *errors.ServiceError
	Resend(ctx context.Context, orgID, id string) *errors.ServiceError
	PublicGetInviteInfo(ctx context.Context, rawToken string) (*models.OrgInvite, *errors.ServiceError)
	ValidateAndConsume(ctx context.Context, rawToken, email string) (*models.OrgInvite, *errors.ServiceError)
	InternalGetByID(ctx context.Context, id string) (*models.OrgInvite, *errors.ServiceError)
	InternalGetPendingUnsent(ctx context.Context, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)
	InternalMarkEmailSent(ctx context.Context, id string) *errors.ServiceError
	InternalMarkEmailError(ctx context.Context, id string, errMsg string) *errors.ServiceError
	InternalDecryptToken(ctx context.Context, encryptedToken string) (string, *errors.ServiceError)
	InternalListExpiredOrPastDue(ctx context.Context, now time.Time, params stores.ListParams) (*stores.PaginatedResult[*models.OrgInvite], *errors.ServiceError)
	InternalMarkExpiredAndDelete(ctx context.Context, invites []*models.OrgInvite) *errors.ServiceError
	InternalWithTransaction(ctx context.Context, fn func(ctx context.Context) *errors.ServiceError) *errors.ServiceError
}

func NewOrgInviteService

func NewOrgInviteService(spec OrgInviteServiceSpec) OrgInviteService

type OrgInviteServiceSpec

type OrgInviteServiceSpec struct {
	InviteStore       stores.OrgInviteStore
	ProjectService    ProjectService
	UserService       UserService
	EncryptionService EncryptionService
	Permissions       auth.PermissionService
	Logger            logger.Logger
}

type OrganisationDomainsService

type OrganisationDomainsService interface {
	Create(ctx context.Context, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)
	InternalCreateWithTx(ctx context.Context, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)
	Get(ctx context.Context, id string) (*models.OrganisationDomain, *errors.ServiceError)
	Delete(ctx context.Context, id string) *errors.ServiceError
	InternalDeleteWithTx(ctx context.Context, id string) *errors.ServiceError
	Update(ctx context.Context, id string, spec *models.OrganisationDomain) (*models.OrganisationDomain, *errors.ServiceError)
	ListByOrganisationID(ctx context.Context, organisationID string) ([]*models.OrganisationDomain, *errors.ServiceError)
	// TODO
	GetDefaultDomainForOrganisation(ctx context.Context, organisationID string) (*models.OrganisationDomain, *errors.ServiceError)
}

type OrganisationDomainsServiceSpec

type OrganisationDomainsServiceSpec struct {
	SessionFactory        db.SessionFactory
	Logger                logger.Logger
	CustomDomainsDisabled bool
}

type OrganisationService

type OrganisationService interface {
	InternalCreate(ctx context.Context, spec *models.Organisation) (*models.Organisation, *errors.ServiceError)
	InternalGetPlatformOrg(ctx context.Context) (*models.Organisation, *errors.ServiceError)
	Get(ctx context.Context, ID string) (*models.Organisation, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	Update(ctx context.Context, ID string, spec *models.Organisation) (*models.Organisation, *errors.ServiceError)

	PromoteToOrgAdmin(ctx context.Context, orgID, userID string) *errors.ServiceError
	DemoteOrgAdmin(ctx context.Context, orgID, userID, projectID string, role models.ProjectRole) *errors.ServiceError
	ListOrgAdmins(ctx context.Context, orgID string) ([]*models.User, *errors.ServiceError)
}

func NewOrganisationService

func NewOrganisationService(spec OrganisationServiceSpec) OrganisationService

type OrganisationServiceSpec

type OrganisationServiceSpec struct {
	SessionFactory            db.SessionFactory
	OrganisationDomainService OrganisationDomainsService
	ImageRegistryService      ImageRegistryService
	OrgRegistryDefaults       models.OrgRegistryDefaults
	StackQueryService         StackQueryService
	ProjectService            ProjectService
	PolicyManager             resourceaccess.ResourceAccessPolicyManager
	Permissions               auth.PermissionService
	Logger                    logger.Logger
	CustomDomainsDisabled     bool
}

type PostgresAddonDatabaseServiceSpec

type PostgresAddonDatabaseServiceSpec struct {
	SessionFactory db.SessionFactory
	Logger         logger.Logger
}

type PostgresAddonService

type PostgresAddonService interface {
	CreatePostgresAddon(ctx context.Context, postgresAddon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)
	GetPostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)
	GetPostgresAddonByName(ctx context.Context, organisationID, name string) (*models.PostgresAddon, *errors.ServiceError)
	UpdatePostgresAddon(ctx context.Context, id string, postgresAddon *models.PostgresAddon) (*models.PostgresAddon, *errors.ServiceError)
	DeletePostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)
	ListPostgresAddonsByOrganisation(ctx context.Context, organisationID string) ([]*models.PostgresAddon, *errors.ServiceError)
	ListPostgresAddonsForCurrentUser(ctx context.Context, orgID string) ([]*models.PostgresAddon, *errors.ServiceError)
	ListPostgresAddonsByProjectID(ctx context.Context, projectID string) ([]*models.PostgresAddon, *errors.ServiceError)
	UpdatePostgresAddonStatus(ctx context.Context, id string, status *models.PostgresAddonStatus) *errors.ServiceError

	// Lifecycle operations
	TriggerBackup(ctx context.Context, id string) *errors.ServiceError
	TriggerHibernate(ctx context.Context, id string, enabled bool) *errors.ServiceError
	TriggerFence(ctx context.Context, id string, enabled bool) *errors.ServiceError

	// Backup operations
	ListBackups(ctx context.Context, postgresAddonID string) ([]*models.PostgresBackup, *errors.ServiceError)

	// Credentials
	GetCredentials(ctx context.Context, addonID string, database string, superuser bool) (*models.PostgresCredentials, *errors.ServiceError)

	// Internal operations
	InternalGetPostgresAddon(ctx context.Context, id string) (*models.PostgresAddon, *errors.ServiceError)
	InternalGetCredentials(ctx context.Context, addonID string, database string, superuser bool) (*models.PostgresCredentials, *errors.ServiceError)
	InternalDeleteFromDB(ctx context.Context, id string) *errors.ServiceError
	InternalList(ctx context.Context, query string, args ...any) ([]*models.PostgresAddon, *errors.ServiceError)

	InjectClusterManager(clusterManager clustermanager.ClusterManager)

	BackgroundJobEnqueuerInjectable
	ClusterResourceServiceInjectable
}

type PostgresAddonServiceSpec

type PostgresAddonServiceSpec struct {
	SessionFactory         db.SessionFactory
	ReferenceService       ReferenceService
	ObjectStoreService     ObjectStoreService
	ClusterService         ClusterService
	NamespaceService       NamespaceService
	SecretService          SecretService
	PostgresBackupService  PostgresBackupService
	ClusterManager         clustermanager.ClusterManager
	ProjectService         ProjectService
	Logger                 logger.Logger
	Permissions            auth.PermissionService
	ExternalImportDisabled bool
	ComputePolicy          computequota.Policy
}

type PostgresBackupService

type PostgresBackupService interface {
	Create(ctx context.Context, backup *models.PostgresBackup) (*models.PostgresBackup, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.PostgresBackup, *errors.ServiceError)
	GetByName(ctx context.Context, postgresAddonID string, name string) (*models.PostgresBackup, *errors.ServiceError)
	Update(ctx context.Context, id string, backup *models.PostgresBackup) (*models.PostgresBackup, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	ListByPostgresAddon(ctx context.Context, postgresAddonID string) ([]*models.PostgresBackup, *errors.ServiceError)
	ValidateBackupExists(ctx context.Context, backupID string) (bool, *errors.ServiceError)

	// Status update methods for backup lifecycle
	UpdateBackupStatus(ctx context.Context, backupID, phase string, error *string) *errors.ServiceError
	MarkBackupCompleted(ctx context.Context, backupID string, sizeBytes *int32) *errors.ServiceError
	MarkBackupFailed(ctx context.Context, backupID string, errorMessage string) *errors.ServiceError
}

type PostgresBackupServiceSpec

type PostgresBackupServiceSpec struct {
	SessionFactory db.SessionFactory
	Logger         logger.Logger
}

type PreviewCommentService

type PreviewCommentService interface {
	// InternalUpsertComment renders the comment for the preview's current
	// state and creates or edits the sticky PR comment. On create it sets
	// preview.GitHubCommentID in place; the caller owns persisting it.
	InternalUpsertComment(ctx context.Context, preview *models.PreviewStack) error
}

PreviewCommentService maintains the sticky PR comment for a preview stack. Perm-less: reached only from the preview worker, never from user requests.

type PreviewCommentServiceSpec

type PreviewCommentServiceSpec struct {
	ConfigStore     stores.StackPreviewConfigStore
	GitIntegrations GitIntegrationService
	Commenter       githubapp.PullRequestCommenter
	Logger          logger.Logger
}

type PreviewStackService

type PreviewStackService interface {
	BackgroundJobEnqueuerInjectable
	Create(ctx context.Context, preview *models.PreviewStack) (*models.PreviewStack, *errors.ServiceError)
	Sync(ctx context.Context, previewStackID string, opts PreviewSyncOpts) *errors.ServiceError
	Delete(ctx context.Context, previewStackID string) *errors.ServiceError
	Get(ctx context.Context, previewStackID string) (*models.PreviewStack, *errors.ServiceError)
	List(ctx context.Context, projectID string, params stores.ListParams) (*stores.PaginatedResult[*models.PreviewStack], *errors.ServiceError)
	InternalFetchStackfile(ctx context.Context, config *models.StackPreviewConfig, commitSHA string) (content []byte, hash string, opErr *errors.OperationError)
	InternalBuildStackFromContent(ctx context.Context, config *models.StackPreviewConfig, preview *models.PreviewStack, stackFileBytes []byte) (*models.Stack, *errors.OperationError)
	// InternalCreateFromWebhook provisions a preview stack from a GitHub PR
	// webhook event. No permission check: the webhook has already been
	// authenticated and authorized by config resolution (org+repo match).
	InternalCreateFromWebhook(ctx context.Context, config *models.StackPreviewConfig, prNumber, branch, headSHA string) (*models.PreviewStack, *errors.ServiceError)
	// InternalSyncFromWebhook re-syncs an existing preview stack to a new head
	// commit from a GitHub PR webhook event. No permission check.
	InternalSyncFromWebhook(ctx context.Context, previewStackID, headSHA string) *errors.ServiceError
	// InternalDeleteFromWebhook tears down a preview stack from a GitHub PR
	// webhook event (PR closed/merged). No permission check.
	InternalDeleteFromWebhook(ctx context.Context, previewStackID string) *errors.ServiceError
}

func NewPreviewStackService

func NewPreviewStackService(spec PreviewStackServiceSpec) PreviewStackService

type PreviewStackServiceSpec

type PreviewStackServiceSpec struct {
	Store              stores.PreviewStackStore
	ConfigStore        stores.StackPreviewConfigStore
	StackService       StackService
	ReleaseService     StackReleaseService
	SecretService      SecretService
	CredentialResolver CredentialResolver
	Permissions        auth.PermissionService
	Logger             logger.Logger
}

type PreviewSyncOpts

type PreviewSyncOpts struct {
	Commit           string
	StackfileContent *string
	ForceSync        bool
	ImageOverrides   map[string]string
}

type PreviewWebhookService

type PreviewWebhookService interface {
	HandlePullRequest(ctx context.Context, ev PullRequestEvent) *errors.ServiceError
}

type PreviewWebhookServiceSpec

type PreviewWebhookServiceSpec struct {
	ConfigStore       stores.StackPreviewConfigStore
	PreviewStackStore stores.PreviewStackStore
	PreviewService    PreviewStackService
	Logger            logger.Logger
}

type ProjectService

type ProjectService interface {
	CreateProject(ctx context.Context, orgID string, project *models.Project) (*models.Project, *errors.ServiceError)
	GetProject(ctx context.Context, orgID, projectID string) (*models.Project, *errors.ServiceError)
	GetProjectByOrgAndName(ctx context.Context, orgID, name string) (*models.Project, *errors.ServiceError)
	ListProjects(ctx context.Context, orgID string) ([]*models.Project, *errors.ServiceError)
	UpdateProject(ctx context.Context, id string, project *models.Project) (*models.Project, *errors.ServiceError)
	DeleteProject(ctx context.Context, id string) *errors.ServiceError
	InternalCreateDefaultProject(ctx context.Context, orgID string) (*models.Project, *errors.ServiceError)
	InternalGetProjectByOrgAndName(ctx context.Context, orgID, name string) (*models.Project, *errors.ServiceError)
	InternalAddMember(ctx context.Context, projectID, userID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)

	AddMember(ctx context.Context, projectID, userID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)
	RemoveMember(ctx context.Context, membershipID string) *errors.ServiceError
	UpdateMemberRole(ctx context.Context, membershipID string, role models.ProjectRole) (*models.ProjectMembership, *errors.ServiceError)
	ListMembers(ctx context.Context, projectID string) ([]*models.ProjectMembership, *errors.ServiceError)
	ListUserProjects(ctx context.Context, userID string) ([]*models.ProjectMembership, *errors.ServiceError)
	InternalListUserProjects(ctx context.Context, userID, orgID string) ([]*models.ProjectMembership, *errors.ServiceError)
}

func NewProjectService

func NewProjectService(spec ProjectServiceSpec) ProjectService

type ProjectServiceSpec

type ProjectServiceSpec struct {
	SessionFactory db.SessionFactory
	PolicyManager  resourceaccess.ResourceAccessPolicyManager
	Permissions    auth.PermissionService
	Logger         logger.Logger
}

type PullRequestAction

type PullRequestAction string

PullRequestAction is the GitHub pull_request webhook action that triggered a PullRequestEvent.

const (
	PRActionOpened      PullRequestAction = "opened"
	PRActionReopened    PullRequestAction = "reopened"
	PRActionSynchronize PullRequestAction = "synchronize"
	PRActionClosed      PullRequestAction = "closed"
)

type PullRequestEvent

type PullRequestEvent struct {
	OrganisationID string
	RepoURL        string
	Branch         string // PR head ref
	BaseBranch     string // PR base ref
	HeadSHA        string
	PRNumber       string
	Action         PullRequestAction
}

PullRequestEvent carries the fields of a GitHub pull_request webhook payload that are needed to route preview stack provisioning.

type ReferenceService

type ReferenceService interface {
	ReprojectSpec(ctx context.Context, stackID string) *errors.ServiceError
	ProjectRelease(ctx context.Context, release *models.StackRelease) *errors.ServiceError
	IsReferentInUse(ctx context.Context, referentType models.ReferentType, referentID string) (
		bool,
		[]models.ResourceReference,
		*errors.ServiceError,
	)
}

func NewReferenceService

func NewReferenceService(spec ReferenceServiceSpec) ReferenceService

type ReferenceServiceSpec

type ReferenceServiceSpec struct {
	SessionFactory db.SessionFactory
	StackStore     stores.StackStore
}

type RegistryCredentialDeleteResult

type RegistryCredentialDeleteResult struct {
	AffectedStacks []AffectedStackRef
}

RegistryCredentialDeleteResult reports which live stacks were resolving against a deleted credential. Deletion is not blocked; this is rotation visibility.

type RegistryCredentialService

type RegistryCredentialService interface {
	Create(ctx context.Context, credential *models.RegistryCredential) (*models.RegistryCredential, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.RegistryCredential, *errors.ServiceError)
	ListByOrgID(ctx context.Context, organisationID string) ([]*models.RegistryCredential, *errors.ServiceError)
	Update(ctx context.Context, ID string, credential *models.RegistryCredential) (*models.RegistryCredential, *errors.ServiceError)
	Delete(ctx context.Context, ID string) (*RegistryCredentialDeleteResult, *errors.ServiceError)
	Verify(ctx context.Context, ID, repository string, purpose models.RegistryCredentialPurpose) *errors.ServiceError

	// InternalGetForHost returns the decrypted credential covering the given
	// purpose for (org, normalized host). No permission checks; used by the
	// credential resolver.
	InternalGetForHost(ctx context.Context, organisationID, host string, purpose models.RegistryCredentialPurpose) (*models.RegistryCredential, *errors.ServiceError)
	// InternalGetByID returns the decrypted credential by ID. No permission
	// checks; used by the credential resolver for explicit overrides.
	InternalGetByID(ctx context.Context, ID string) (*models.RegistryCredential, *errors.ServiceError)
}

type RegistryCredentialServiceSpec

type RegistryCredentialServiceSpec struct {
	Store             stores.RegistryCredentialStore
	StackStore        stores.StackStore
	ReferenceService  ReferenceService
	EncryptionService EncryptionService
	Permissions       auth.PermissionService
	Logger            logger.Logger
	// RegistryClients is optional; it defaults to real registry clients.
	RegistryClients verifyRegistryClientProvider
}

type RegistryPurpose

type RegistryPurpose = credentials.RegistryPurpose

The 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.

type ReleaseEventInput

type ReleaseEventInput struct {
	Release      *models.StackRelease
	ResourceName string // required for resource-scoped types
	Type         models.ReleaseEventType
	Message      string
	DedupeKey    string // defaulted from type/resource when empty
	Links        models.ReleaseEventLinks
	Metadata     models.ReleaseEventMetadata
}

type ReleaseEventPage

type ReleaseEventPage struct {
	Events            []*models.ReleaseEvent
	NextAfterSequence int
}

ReleaseEventPage is a sequence-cursor page of release events.

type ReleaseEventRecorder

type ReleaseEventRecorder interface {
	Record(ctx context.Context, input ReleaseEventInput) (*models.ReleaseEvent, *errors.ServiceError)
	RecordReleaseCreated(ctx context.Context, release *models.StackRelease) *errors.ServiceError
	RecordReleaseChecksStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError
	RecordReleaseCheckFailed(ctx context.Context, release *models.StackRelease, resourceName, check, reason string) *errors.ServiceError
	RecordReleaseChecksPassed(ctx context.Context, release *models.StackRelease) *errors.ServiceError
	RecordReleaseStarted(ctx context.Context, release *models.StackRelease) *errors.ServiceError
	RecordBuildEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, buildID string, failure *models.BuildFailureDetail) *errors.ServiceError
	RecordResourceEvent(ctx context.Context, release *models.StackRelease, resourceName string, eventType models.ReleaseEventType, reason string, message string) *errors.ServiceError
	RecordReleaseTerminal(ctx context.Context, release *models.StackRelease, state models.StackReleaseState, message string) *errors.ServiceError
}

type ReleaseEventRecorderSpec

type ReleaseEventRecorderSpec struct {
	Store stores.ReleaseEventStore
}

type ResolvedGitCredential

type ResolvedGitCredential = credentials.ResolvedGitCredential

The 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.

type ResolvedRegistryCredential

type ResolvedRegistryCredential = credentials.ResolvedRegistryCredential

The 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.

type SecretService

type SecretService interface {
	Create(ctx context.Context, secret *models.Secret) (*models.Secret, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.Secret, *errors.ServiceError)
	// InternalGetByID is used internally to get the secret with decrypted data.
	InternalGetByID(ctx context.Context, ID string) (*models.Secret, *errors.ServiceError)
	InternalGetByName(ctx context.Context, organisationID, name string) (*models.Secret, *errors.ServiceError)
	GetByName(ctx context.Context, organisationID, name string) (*models.Secret, *errors.ServiceError)
	Update(ctx context.Context, id string, secret *models.Secret) (*models.Secret, *errors.ServiceError)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	ListByOrganisation(ctx context.Context, organisationID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)
	ListByProjectID(ctx context.Context, projectID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)
	ListSecretsForCurrentUser(ctx context.Context, orgID string, params stores.ListParams) ([]*models.Secret, *errors.ServiceError)
	ListByUser(ctx context.Context, organisationID, userID string) ([]*models.Secret, *errors.ServiceError)
	ListByType(ctx context.Context, organisationID, secretType models.SecretType) ([]*models.Secret, *errors.ServiceError)
	ValidateSecretExists(ctx context.Context, secretID string) (bool, *errors.ServiceError)
	GetSecretKeys(ctx context.Context, secretID string) ([]string, *errors.ServiceError)
	ValidateSecretHasKeys(ctx context.Context, secretID string, requiredKeys []string) (bool, []string, *errors.ServiceError)
}

func NewSecretService

func NewSecretService(spec SecretServiceSpec) SecretService

type SecretServiceSpec

type SecretServiceSpec struct {
	SessionFactory      db.SessionFactory
	EncryptionService   EncryptionService
	ReferenceService    ReferenceService
	ClusterClientGetter ClusterClientGetter
	ProjectService      ProjectService
	Logger              logger.Logger
	Permissions         auth.PermissionService
}

type SignupService

type SignupService interface {
	Signup(ctx context.Context, user *models.User, inviteToken string) (*openapi.UserSignupResponse, *errors.ServiceError)
}

func NewSignupService

func NewSignupService(spec SignupServiceSpec) SignupService

type SignupServiceSpec

type SignupServiceSpec struct {
	UserService         UserService
	OrgInviteService    OrgInviteService
	OrganisationService OrganisationService
	ProjectService      ProjectService
	PolicyManager       resourceaccess.ResourceAccessPolicyManager
	RefreshTokenStore   stores.RefreshTokenStore
	AtomicExecutor      stores.AtomicExecutor
	JWTSecretKey        string
	JWTClaimsBuilder    jwtClaimsBuilder
	Logger              logger.Logger
}

type StackDomainsService

type StackDomainsService interface {
	Create(ctx context.Context, spec *models.StackDomain) (*models.StackDomain, *errors.ServiceError)
	InternalCreateWithTx(ctx context.Context, spec *models.StackDomain) (*models.StackDomain, *errors.ServiceError)
	Get(ctx context.Context, id string) (*models.StackDomain, *errors.ServiceError)
	Delete(ctx context.Context, id string) *errors.ServiceError
	InternalDeleteWithTx(ctx context.Context, id string) *errors.ServiceError
	GetByFqdn(ctx context.Context, fqdn string) (*models.StackDomain, *errors.ServiceError)
	ListByFqdnPrefix(ctx context.Context, prefix string) ([]*models.StackDomain, *errors.ServiceError)
	PopulateAndSaveExposedPortDomainsForResourceWithTx(ctx context.Context, stack *models.Stack, resource *models.StackResource) *errors.ServiceError
	InternalDeleteDomainsForResourceWithTx(ctx context.Context, resourceID string) *errors.ServiceError
}

func NewStackDomainsService

func NewStackDomainsService(spec StackDomainsServiceSpec) StackDomainsService

type StackDomainsServiceSpec

type StackDomainsServiceSpec struct {
	SessionFactory        db.SessionFactory
	Logger                logger.Logger
	PlatformBaseDomain    string
	CustomDomainsDisabled bool
}

type StackPreviewConfigServiceSpec

type StackPreviewConfigServiceSpec struct {
	Store              stores.StackPreviewConfigStore
	PreviewStackStore  stores.PreviewStackStore
	CredentialResolver CredentialResolver
	Permissions        auth.PermissionService
}

type StackQueryService

type StackQueryService interface {
	GetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)
	GetStackTopology(ctx context.Context, ID string) (*models.StackTopology, *errors.ServiceError)
	InternalGetStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)
	GetStacksByProjectID(ctx context.Context, projectID string) ([]*models.Stack, *errors.ServiceError)
	GetStacksByOrganisationID(ctx context.Context, organisationID string) ([]*models.Stack, *errors.ServiceError)
	ListStacksForCurrentUser(ctx context.Context, orgID string) ([]*models.Stack, *errors.ServiceError)
}

type StackReleaseService

type StackReleaseService interface {
	CreateRelease(ctx context.Context, stackID string, cause models.ReleaseCause) (*models.StackRelease, *errors.ServiceError)
	RollbackRelease(ctx context.Context, stackID, fromReleaseID string) (*models.StackRelease, *errors.ServiceError)
	GetRelease(ctx context.Context, releaseID string) (*models.StackRelease, *errors.ServiceError)
	GetReleaseDetail(ctx context.Context, releaseID string) (*models.StackRelease, *models.ReleaseLiveStatus, *errors.ServiceError)
	ListReleases(ctx context.Context, stackID string, params stores.ListParams) (*stores.PaginatedResult[*models.StackRelease], *errors.ServiceError)
	ListReleaseEvents(ctx context.Context, stackID, releaseID string, afterSequence, limit int) (*ReleaseEventPage, *errors.ServiceError)
	StreamReleaseEvents(ctx context.Context, stackID, releaseID string, afterSequence int) (interfaces.ServerSideStreamable, *errors.ServiceError)
	CancelRelease(ctx context.Context, releaseID string) *errors.ServiceError

	// Internal methods are called by workers and controllers; no permission checks.
	InternalCreateRelease(ctx context.Context, stackID string, cause models.ReleaseCause) (*models.StackRelease, *errors.ServiceError)
	InternalGet(ctx context.Context, releaseID string) (*models.StackRelease, *errors.ServiceError)
	InternalGetReleaseRefs(ctx context.Context, stacks []*models.Stack) (map[string]models.StackReleaseRefs, *errors.ServiceError)
	InternalGetActiveByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)
	InternalGetLatestByStackID(ctx context.Context, stackID string) (*models.StackRelease, *errors.ServiceError)
	InternalListActive(ctx context.Context) ([]*models.StackRelease, *errors.ServiceError)
	MarkInProgress(ctx context.Context, id string) (bool, *errors.ServiceError)
	SaveManifest(ctx context.Context, id string, m *models.ReleaseManifest, rev string, pins models.ReleasePins, rendererVersion string) (bool, *errors.ServiceError)
	MarkReleased(ctx context.Context, id string, outcome models.ReleaseOutcome) (bool, *errors.ServiceError)
	MarkCancelled(ctx context.Context, id string, reasons string) (bool, *errors.ServiceError)
	MarkSuperseded(ctx context.Context, id string, reason string) (bool, *errors.ServiceError)
	MarkFailed(ctx context.Context, id string, message string, outcome *models.ReleaseOutcome) (bool, *errors.ServiceError)
	SetConvergeClockStartedAt(ctx context.Context, id string, startedAt *time.Time) *errors.ServiceError
	MarkFailedWithValidationErrors(ctx context.Context, id, message string, verrs models.ReleaseValidationErrors) (bool, *errors.ServiceError)
	AppendImageDigests(ctx context.Context, id string, digests map[string]string) *errors.ServiceError

	BackgroundJobEnqueuerInjectable
}

func NewStackReleaseService

func NewStackReleaseService(spec StackReleaseServiceSpec) StackReleaseService

type StackReleaseServiceSpec

type StackReleaseServiceSpec struct {
	Store              stores.StackReleaseStore
	StackService       StackService
	CredentialResolver CredentialResolver
	Permissions        auth.PermissionService
	ReferenceService   ReferenceService
	EventStore         stores.ReleaseEventStore
	EventRecorder      ReleaseEventRecorder
	// GitClients is optional; it defaults to real git clients.
	GitClients    sourceGitClientProvider
	ComputePolicy computequota.Policy
}

type StackResourceService

type StackResourceService interface {
	InjectClusterManager(clusterManager clustermanager.ClusterManager)
	Create(ctx context.Context, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)
	GetByStackID(ctx context.Context, stackID string) ([]*models.StackResource, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.StackResource, *errors.ServiceError)
	GetByStackIDAndResourceName(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)
	InternalGetByStackIDAndResourceName(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)
	Update(ctx context.Context, stackID, resourceName string, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)
	Delete(ctx context.Context, stackID, resourceName string) *errors.ServiceError
	UpdateStatus(ctx context.Context, resourceID string, status *models.StackResourceStatus) *errors.ServiceError
	InternalCreateWithTx(ctx context.Context, stack *models.Stack, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)
	InternalUpdateWithTx(ctx context.Context, stack *models.Stack, resourceID string, resource *models.StackResource) (*models.StackResource, *errors.ServiceError)
	InternalDeleteWithTx(ctx context.Context, resourceID string) *errors.ServiceError
	InternalSyncResourcesWithTx(ctx context.Context, stack *models.Stack, existingStack *models.Stack, desired []*models.StackResource) *errors.ServiceError
	Restart(ctx context.Context, stackID, resourceName string) (*models.StackResource, *errors.ServiceError)
}

type StackResourceServiceSpec

type StackResourceServiceSpec struct {
	SessionFactory         db.SessionFactory
	StorageService         StackStorageService
	Logger                 logger.Logger
	Permissions            auth.PermissionService
	StackStore             stores.StackStore
	StackResourceStore     stores.StackResourceStore
	ClusterRegistryService ImageRegistryService
	StackDomainService     StackDomainsService
	ReferenceService       ReferenceService
	ResourceValidator      stackresourcevalidator.Validator
	ComputePolicy          computequota.Policy
}

type StackService

type StackService interface {
	CreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)
	UpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)
	ApplyStack(ctx context.Context, spec *models.Stack) (*models.Stack, bool, *errors.ServiceError)
	UpdateStackShell(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)
	ListStackConnections(ctx context.Context, stackID string) (models.StackConnections, *errors.ServiceError)
	CreateStackConnection(ctx context.Context, stackID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)
	CreateStackVolume(ctx context.Context, stackID string, volume *models.Volume) (*models.Volume, *errors.ServiceError)
	UpdateStackConnection(ctx context.Context, stackID, connectionID string, connection *models.StackConnection) (*models.StackConnection, *errors.ServiceError)
	DeleteStackConnection(ctx context.Context, stackID, connectionID string) *errors.ServiceError
	UpdateStatus(ctx context.Context, ID string, status *models.StackStatus) *errors.ServiceError
	DeleteStack(ctx context.Context, ID string) (*models.Stack, *errors.ServiceError)
	InternalCreateStack(ctx context.Context, spec *models.Stack) (*models.Stack, *errors.ServiceError)
	InternalUpdateStack(ctx context.Context, ID string, spec *models.Stack) (*models.Stack, *errors.ServiceError)
	InternalDeleteStack(ctx context.Context, stack *models.Stack) (*models.Stack, *errors.ServiceError)
	UpdateStackCrRevision(ctx context.Context, ID string, revision string) *errors.ServiceError
	InternalList(ctx context.Context, query string, args ...any) ([]*models.Stack, *errors.ServiceError)
	InternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError
	SetReleaseService(rs releaseServiceForStack)
	ClusterResourceServiceInjectable
	BackgroundJobEnqueuerInjectable
	StackQueryService
}

func NewStackService

func NewStackService(spec StackServiceSpec) StackService

type StackServiceSpec

type StackServiceSpec struct {
	SessionFactory        db.SessionFactory
	VolumeService         VolumeService
	ClusterService        ClusterService
	OrganisationService   OrganisationService
	StackResourceService  StackResourceService
	NamespaceService      NamespaceService
	SecretService         SecretService
	PostgresAddonService  PostgresAddonService
	ProjectService        ProjectService
	Permissions           auth.PermissionService
	Logger                logger.Logger
	ReferenceService      ReferenceService
	CredentialResolver    CredentialResolver
	GitIntegrationService GitIntegrationService
	PlatformBaseDomain    string
	ComputePolicy         computequota.Policy
}

type StackStorageService

type StackStorageService interface {
	Get(ctx context.Context, ID string, userID string) (*models.StackStorage, *errors.ServiceError)
	GetByID(ctx context.Context, ID string) (*models.StackStorage, *errors.ServiceError)
	GetbyWorkspaceName(ctx context.Context, workspaceName string, userID string) (*models.StackStorage, *errors.ServiceError)
	InternalGet(ctx context.Context, ID string) (*models.StackStorage, *errors.ServiceError)
	ListByOrganisationID(ctx context.Context, organisationID string) ([]*models.StackStorage, *errors.ServiceError)
	ListByUserID(ctx context.Context, userID string) ([]*models.StackStorage, *errors.ServiceError)
	Create(ctx context.Context, spec *models.StackStorage, userID string) (*models.StackStorage, *errors.ServiceError)
	Update(ctx context.Context, ID string, userID string, spec *models.StackStorage) (*models.StackStorage, *errors.ServiceError)
	UpdateStatus(ctx context.Context, ID string, status *models.StackStorageStatus) *errors.ServiceError
	InjectClusterResourceService(clusterResourceService clusterresource.StackStorageClusterResourceService)
	ListVolumes(ctx context.Context, workspaceStorageID string, userID string) ([]*models.Volume, *errors.ServiceError)
	Delete(ctx context.Context, ID string, userID string) *errors.ServiceError
	MarkAsSynced(ctx context.Context, userID string, storageID string, volumeID string) *errors.ServiceError
}

type UserService

type UserService interface {
	Get(ctx context.Context, ID string) (*models.User, *errors.ServiceError)
	GetUserFromContext(ctx context.Context) (*models.User, []*models.ProjectMembership, *errors.ServiceError)
	ListByOrgID(ctx context.Context, orgID string, params stores.ListParams) (*stores.PaginatedResult[*models.User], *errors.ServiceError)
	InternalGet(ctx context.Context, ID string) (*models.User, *errors.ServiceError)
	InternalGetByEmail(ctx context.Context, email string) (*models.User, *errors.ServiceError)
	InternalCreate(ctx context.Context, user *models.User) (*models.User, *errors.ServiceError)
	InternalCreateOAuthUser(ctx context.Context, email, name, githubID, avatarURL string) (*models.User, error)
	InternalCreateInvitedUser(ctx context.Context, user *models.User, invite *models.OrgInvite) (*models.User, *errors.ServiceError)
	InternalCreateInvitedOAuthUser(ctx context.Context, email, name, githubID, avatarURL string, invite *models.OrgInvite) (*models.User, error)
	Login(ctx context.Context, loginRequest *openapi.LoginRequest) (*openapi.LoginResponse, *errors.ServiceError)
}

func NewUserService

func NewUserService(spec UserServiceSpec) UserService

type UserServiceSpec

type UserServiceSpec struct {
	SessionFactory              db.SessionFactory
	Logger                      logger.Logger
	JwtSecretKey                string
	ResourceAccessPolicyManager resourceaccess.ResourceAccessPolicyManager
	JWTClaimsBuilder            jwtClaimsBuilder
	OrganisationService         OrganisationService
	Permissions                 auth.PermissionService
	ProjectService              ProjectService
	RefreshTokenStore           stores.RefreshTokenStore
	AtomicExecutor              stores.AtomicExecutor
}

type VolumeService

type VolumeService interface {
	Get(ctx context.Context, ID string) (*models.Volume, *errors.ServiceError)
	InternalGet(ctx context.Context, ID string) (*models.Volume, *errors.ServiceError)
	GetByVolumeNameAndNamespace(ctx context.Context, volumeName, namespace string) (*models.Volume, *errors.ServiceError)
	InternalList(ctx context.Context, ids []string) ([]*models.Volume, *errors.ServiceError)
	InternalListNotReady(ctx context.Context) ([]*models.Volume, *errors.ServiceError)
	CreateWithTx(ctx context.Context, spec *models.Volume) (*models.Volume, *errors.ServiceError)
	CreateInDbWithTx(ctx context.Context, spec *models.Volume) (*models.Volume, *errors.ServiceError)
	CreateInCluster(ctx context.Context, spec *models.Volume) *errors.ServiceError
	ListByUserID(ctx context.Context, projectID, userID string) ([]*models.Volume, *errors.ServiceError)
	UpdateStatus(ctx context.Context, ID string, status *models.VolumeStatus) *errors.ServiceError
	UpdateGitRepoSourceRevision(ctx context.Context, ID string, revision models.GitRepoRevision) (*models.Volume, *errors.ServiceError)
	UpdateRemoteSourceRevision(ctx context.Context, ID string, revision models.RemoteDirSource) (*models.Volume, *errors.ServiceError)
	InjectClusterResourceService(volumeClusterService clusterresource.VolumeClusterResourceService)
	Delete(ctx context.Context, ID string) *errors.ServiceError
	InternalDeleteFromDB(ctx context.Context, ID string) *errors.ServiceError
	InternalDeleteVolumesUsedByStackFromDB(ctx context.Context, stackID string) *errors.ServiceError
	DeleteWithTx(ctx context.Context, ID string) *errors.ServiceError
	ListVolumesUsedByStack(ctx context.Context, stackID string) ([]*models.Volume, *errors.ServiceError)
	InternalCreateWithTx(ctx context.Context, stack *models.Stack, volume *models.Volume) (*models.Volume, *errors.ServiceError)
	InternalSyncVolumesWithTx(ctx context.Context, stack *models.Stack, existingStack *models.Stack, desired []*models.Volume) *errors.ServiceError
}

func NewVolumeService

func NewVolumeService(spec VolumeServiceSpec) VolumeService

type VolumeServiceSpec

type VolumeServiceSpec struct {
	SessionFactory   db.SessionFactory
	ReferenceService ReferenceService
	Logger           logger.Logger
	Permissions      auth.PermissionService
	ComputePolicy    computequota.Policy
}

Directories

Path Synopsis
Package clusterresource is a generated GoMock package.
Package clusterresource is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL