Documentation
¶
Overview ¶
Package project owns compose project persistence, lifecycle, discovery, and routes.
Index ¶
- func IconCatalogForContext(ctx context.Context) string
- func RegisterProjects(api huma.API, projectService *ProjectService, ...)
- type ArchiveProjectInput
- type ArchiveProjectOutput
- type BuildProjectInput
- type CreateProjectInput
- type CreateProjectOutput
- type DeployProjectInput
- type DeployProjectOutput
- type DestroyProjectInput
- type DestroyProjectOutput
- type DownProjectInput
- type DownProjectOutput
- type GetProjectInput
- type GetProjectOutput
- type GetProjectStatusCountsInput
- type GetProjectStatusCountsOutput
- type GetProjectWorkspaceFileInput
- type GetProjectWorkspaceFileOutput
- type GetProjectWorkspaceInput
- type GetProjectWorkspaceOutput
- type ListProjectTagsInput
- type ListProjectTagsOutput
- type ListProjectsInput
- type ListProjectsOutput
- type Module
- type ProjectBuildOptions
- type ProjectHandler
- func (h *ProjectHandler) ArchiveProject(ctx context.Context, input *ArchiveProjectInput) (*ArchiveProjectOutput, error)
- func (h *ProjectHandler) BuildProjectImages(ctx context.Context, input *BuildProjectInput) (*huma.StreamResponse, error)
- func (h *ProjectHandler) CreateProject(ctx context.Context, input *CreateProjectInput) (*CreateProjectOutput, error)
- func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectInput) (*huma.StreamResponse, error)
- func (h *ProjectHandler) DestroyProject(ctx context.Context, input *DestroyProjectInput) (*DestroyProjectOutput, error)
- func (h *ProjectHandler) DownProject(ctx context.Context, input *DownProjectInput) (*DownProjectOutput, error)
- func (h *ProjectHandler) DownloadProjectWorkspaceFile(ctx context.Context, input *GetProjectWorkspaceFileInput) (*huma.StreamResponse, error)
- func (h *ProjectHandler) GetProject(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
- func (h *ProjectHandler) GetProjectCompose(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
- func (h *ProjectHandler) GetProjectRuntime(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
- func (h *ProjectHandler) GetProjectStatusCounts(ctx context.Context, input *GetProjectStatusCountsInput) (*GetProjectStatusCountsOutput, error)
- func (h *ProjectHandler) GetProjectUpdates(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
- func (h *ProjectHandler) GetProjectWorkspace(ctx context.Context, input *GetProjectWorkspaceInput) (*GetProjectWorkspaceOutput, error)
- func (h *ProjectHandler) GetProjectWorkspaceFile(ctx context.Context, input *GetProjectWorkspaceFileInput) (*GetProjectWorkspaceFileOutput, error)
- func (h *ProjectHandler) ListProjectTags(ctx context.Context, _ *ListProjectTagsInput) (*ListProjectTagsOutput, error)
- func (h *ProjectHandler) ListProjects(ctx context.Context, input *ListProjectsInput) (*ListProjectsOutput, error)
- func (h *ProjectHandler) PullProjectImages(ctx context.Context, input *PullProjectImagesInput) (*huma.StreamResponse, error)
- func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployProjectInput) (*huma.StreamResponse, error)
- func (h *ProjectHandler) RestartProject(ctx context.Context, input *RestartProjectInput) (*RestartProjectOutput, error)
- func (h *ProjectHandler) UnarchiveProject(ctx context.Context, input *UnarchiveProjectInput) (*UnarchiveProjectOutput, error)
- func (h *ProjectHandler) UpdateProject(ctx context.Context, input *UpdateProjectInput) (*UpdateProjectOutput, error)
- func (h *ProjectHandler) UpdateProjectServices(ctx context.Context, input *UpdateProjectServicesInput) (*UpdateProjectServicesOutput, error)
- func (h *ProjectHandler) UpdateProjectTag(ctx context.Context, input *UpdateProjectTagInput) (*UpdateProjectTagOutput, error)
- func (h *ProjectHandler) UpdateProjectWorkspace(ctx context.Context, input *UpdateProjectWorkspaceInput) (*UpdateProjectWorkspaceOutput, error)
- type ProjectService
- func (s *ProjectService) ApplyGitSyncEnvToDirectory(ctx context.Context, projectPath, projectsDirectory string, ...) (before, after string, err error)
- func (s *ProjectService) ApplyGitSyncProjectFiles(ctx context.Context, projectID string, composeContent string, ...) (*models.Project, error)
- func (s *ProjectService) ArchiveProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) BackfillProjectImageRefs(ctx context.Context) (int, error)
- func (s *ProjectService) BuildProjectServices(ctx context.Context, projectID string, options ProjectBuildOptions, ...) error
- func (s *ProjectService) CountProjectsWithPendingUpdates(ctx context.Context, allContainers []container.Summary) (int, error)
- func (s *ProjectService) CountServicesFromCompose(ctx context.Context, p models.Project) (int, error)
- func (s *ProjectService) CreateGitOpsManagedProject(ctx context.Context, sync *models.GitOpsSync, project *models.Project, ...) error
- func (s *ProjectService) CreateProject(ctx context.Context, name, composeContent string, envContent *string, ...) (*models.Project, error)
- func (s *ProjectService) DeployProject(ctx context.Context, projectID string, user models.User, ...) error
- func (s *ProjectService) DestroyProject(ctx context.Context, projectID string, removeFiles bool, removeVolumes bool, ...) error
- func (s *ProjectService) DownProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) DownloadProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (io.ReadCloser, int64, string, error)
- func (s *ProjectService) EnsureGitOpsProjectLinked(ctx context.Context, sync *models.GitOpsSync, project *models.Project) error
- func (s *ProjectService) EnsureProjectImagesPresent(ctx context.Context, projectID string, progressWriter io.Writer, ...) error
- func (s *ProjectService) EnsureProjectPathUnderRoot(ctx context.Context, proj *models.Project, persist bool) error
- func (s *ProjectService) GetProjectByComposeName(ctx context.Context, name string) (*models.Project, error)
- func (s *ProjectService) GetProjectContent(ctx context.Context, projectID string) (composeContent, envContent, overrideContent string, err error)
- func (s *ProjectService) GetProjectDetails(ctx context.Context, projectID string, opts project.DetailsOptions) (project.Details, error)
- func (s *ProjectService) GetProjectFromDatabaseByID(ctx context.Context, id string) (*models.Project, error)
- func (s *ProjectService) GetProjectRelativePath(ctx context.Context, projectPath string) string
- func (s *ProjectService) GetProjectServices(ctx context.Context, projectID string) ([]ProjectServiceInfo, error)
- func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (...)
- func (s *ProjectService) GetProjectTags(ctx context.Context, projectID string) ([]projecttypes.Tag, error)
- func (s *ProjectService) GetProjectWorkspace(ctx context.Context, projectID string) (*workspacetypes.Workspace, error)
- func (s *ProjectService) GetProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (*workspacetypes.FileContent, error)
- func (s *ProjectService) GetProjectsDirectory(ctx context.Context) (string, error)
- func (s *ProjectService) HandleProjectFilesChanged(ctx context.Context, paths []string)
- func (s *ProjectService) ListAllProjects(ctx context.Context) ([]models.Project, error)
- func (s *ProjectService) ListProjectTagOptions(ctx context.Context) ([]projecttypes.TagOption, error)
- func (s *ProjectService) ListProjects(ctx context.Context, params pagination.QueryParams) ([]project.Details, pagination.Response, error)
- func (s *ProjectService) ProjectMetadata(ctx context.Context, p models.Project, env *projectMetadataEnvInternal) projects.ArcaneComposeMetadata
- func (s *ProjectService) PullProjectImages(ctx context.Context, projectID string, progressWriter io.Writer, ...) error
- func (s *ProjectService) RecoverProjectRenameJournals(ctx context.Context) error
- func (s *ProjectService) RedeployProject(ctx context.Context, projectID string, user models.User, ...) error
- func (s *ProjectService) ResolveProjectComposeFile(ctx context.Context, proj *models.Project) (string, error)
- func (s *ProjectService) ResolveRegistryCredentials(ctx context.Context) ([]containerregistry.Credential, error)
- func (s *ProjectService) RestartProject(ctx context.Context, projectID string, services []string, user models.User) error
- func (s *ProjectService) StreamProjectLogs(ctx context.Context, projectID string, logsChan chan<- string, follow bool, ...) error
- func (s *ProjectService) SyncProjectsFromFileSystem(ctx context.Context) error
- func (s *ProjectService) UnarchiveProject(ctx context.Context, projectID string, user models.User) error
- func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, name *string, ...) (*models.Project, error)
- func (s *ProjectService) UpdateProjectServices(ctx context.Context, projectID string, servicesToUpdate []string, ...) error
- func (s *ProjectService) UpdateProjectTag(ctx context.Context, projectID, name string, color projecttypes.TagColor, ...) ([]projecttypes.Tag, error)
- func (s *ProjectService) UpdateProjectWorkspace(ctx context.Context, projectID string, ...) (*workspacetypes.Workspace, error)
- func (s *ProjectService) ValidateComposeDirectory(ctx context.Context, projectName, projectPath, composeFileName string) (int, error)
- func (s *ProjectService) WithKVService(kvService *kv.KVService) *ProjectService
- func (s *ProjectService) WithRegistryCredentialsProvider(provider func(context.Context) ([]containerregistry.Credential, error)) *ProjectService
- type ProjectServiceInfo
- type PullProjectImagesInput
- type RedeployProjectInput
- type RestartProjectInput
- type RestartProjectOutput
- type UnarchiveProjectInput
- type UnarchiveProjectOutput
- type UpdateProjectInput
- type UpdateProjectOutput
- type UpdateProjectServicesInput
- type UpdateProjectServicesOutput
- type UpdateProjectTagInput
- type UpdateProjectTagOutput
- type UpdateProjectWorkspaceInput
- type UpdateProjectWorkspaceOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IconCatalogForContext ¶
IconCatalogForContext resolves the icon catalog of the requesting user. On agent-proxied calls the caller is a synthetic user whose preference is populated from the X-Arcane-Icon-Catalog header the manager forwards. Background jobs have no user attached and fall back to the default catalog.
func RegisterProjects ¶
func RegisterProjects(api huma.API, projectService *ProjectService, activityService *activity.ActivityService, appCtx handlerutil.ActivityAppContext)
RegisterProjects registers project management routes using Huma. WebSocket and streaming endpoints live in api/ws.
Types ¶
type ArchiveProjectInput ¶
type ArchiveProjectOutput ¶
type ArchiveProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type BuildProjectInput ¶
type BuildProjectInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
ProjectID string `path:"projectId" doc:"Project ID"`
Body *struct {
Services []string `json:"services,omitempty" doc:"Service names to build"`
Provider string `json:"provider,omitempty" doc:"Build provider override"`
Push *bool `json:"push,omitempty" doc:"Push images"`
Load *bool `json:"load,omitempty" doc:"Load images into Docker"`
}
}
type CreateProjectInput ¶
type CreateProjectOutput ¶
type CreateProjectOutput struct {
Body base.ApiResponse[project.CreateReponse]
}
type DeployProjectInput ¶
type DeployProjectInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
ProjectID string `path:"projectId" doc:"Project ID"`
Body *project.DeployOptions
}
type DeployProjectOutput ¶
type DeployProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type DestroyProjectInput ¶
type DestroyProjectOutput ¶
type DestroyProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type DownProjectInput ¶
type DownProjectOutput ¶
type DownProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type GetProjectInput ¶
type GetProjectOutput ¶
type GetProjectOutput struct {
Body base.ApiResponse[project.Details]
}
type GetProjectStatusCountsInput ¶
type GetProjectStatusCountsInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
}
type GetProjectStatusCountsOutput ¶
type GetProjectStatusCountsOutput struct {
Body base.ApiResponse[project.StatusCounts]
}
type GetProjectWorkspaceFileOutput ¶
type GetProjectWorkspaceFileOutput struct {
Body base.ApiResponse[workspacetypes.FileContent]
}
type GetProjectWorkspaceOutput ¶
type GetProjectWorkspaceOutput struct {
Body base.ApiResponse[workspacetypes.Workspace]
}
type ListProjectTagsInput ¶
type ListProjectTagsInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
}
ListProjectTagsInput identifies the environment whose tag catalog is requested.
type ListProjectTagsOutput ¶
type ListProjectTagsOutput struct {
Body base.ApiResponse[[]project.TagOption]
}
ListProjectTagsOutput contains the environment's distinct project tag options.
type ListProjectsInput ¶
type ListProjectsInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
Search string `query:"search" doc:"Search query"`
Sort string `query:"sort" doc:"Column to sort by"`
Order string `query:"order" default:"asc" doc:"Sort direction (asc or desc)"`
Start int `query:"start" default:"0" doc:"Start index for pagination"`
Limit int `query:"limit" default:"20" doc:"Number of items per page"`
Status string `query:"status" doc:"Filter by status (comma-separated: running,stopped,partially running)"`
Updates string `query:"updates" doc:"Filter by update status (has_update, up_to_date, error, unknown)"`
Archived string `query:"archived" doc:"Archived filter: 'true' (only archived), 'all' (include archived). Default excludes archived."`
Tags string `query:"tags" doc:"Filter by tag names (comma-separated, OR semantics)"`
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(service *ProjectService, activityService *activity.ActivityService) *Module
func (*Module) RegisterRoutes ¶
func (m *Module) RegisterRoutes(api huma.API, appCtx handlerutil.ActivityAppContext)
func (*Module) Service ¶
func (m *Module) Service() *ProjectService
type ProjectBuildOptions ¶
type ProjectHandler ¶
type ProjectHandler struct {
// contains filtered or unexported fields
}
ProjectHandler provides Huma-based project management endpoints.
func (*ProjectHandler) ArchiveProject ¶
func (h *ProjectHandler) ArchiveProject(ctx context.Context, input *ArchiveProjectInput) (*ArchiveProjectOutput, error)
func (*ProjectHandler) BuildProjectImages ¶
func (h *ProjectHandler) BuildProjectImages(ctx context.Context, input *BuildProjectInput) (*huma.StreamResponse, error)
BuildProjectImages builds compose services with build directives.
func (*ProjectHandler) CreateProject ¶
func (h *ProjectHandler) CreateProject(ctx context.Context, input *CreateProjectInput) (*CreateProjectOutput, error)
CreateProject creates a new Docker Compose project.
func (*ProjectHandler) DeployProject ¶
func (h *ProjectHandler) DeployProject(ctx context.Context, input *DeployProjectInput) (*huma.StreamResponse, error)
func (*ProjectHandler) DestroyProject ¶
func (h *ProjectHandler) DestroyProject(ctx context.Context, input *DestroyProjectInput) (*DestroyProjectOutput, error)
DestroyProject destroys a Docker Compose project.
func (*ProjectHandler) DownProject ¶
func (h *ProjectHandler) DownProject(ctx context.Context, input *DownProjectInput) (*DownProjectOutput, error)
DownProject brings down a Docker Compose project.
func (*ProjectHandler) DownloadProjectWorkspaceFile ¶
func (h *ProjectHandler) DownloadProjectWorkspaceFile(ctx context.Context, input *GetProjectWorkspaceFileInput) (*huma.StreamResponse, error)
func (*ProjectHandler) GetProject ¶
func (h *ProjectHandler) GetProject(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
GetProject returns a project by ID.
func (*ProjectHandler) GetProjectCompose ¶
func (h *ProjectHandler) GetProjectCompose(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
func (*ProjectHandler) GetProjectRuntime ¶
func (h *ProjectHandler) GetProjectRuntime(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
func (*ProjectHandler) GetProjectStatusCounts ¶
func (h *ProjectHandler) GetProjectStatusCounts(ctx context.Context, input *GetProjectStatusCountsInput) (*GetProjectStatusCountsOutput, error)
GetProjectStatusCounts returns counts of projects by status.
func (*ProjectHandler) GetProjectUpdates ¶
func (h *ProjectHandler) GetProjectUpdates(ctx context.Context, input *GetProjectInput) (*GetProjectOutput, error)
func (*ProjectHandler) GetProjectWorkspace ¶
func (h *ProjectHandler) GetProjectWorkspace(ctx context.Context, input *GetProjectWorkspaceInput) (*GetProjectWorkspaceOutput, error)
func (*ProjectHandler) GetProjectWorkspaceFile ¶
func (h *ProjectHandler) GetProjectWorkspaceFile(ctx context.Context, input *GetProjectWorkspaceFileInput) (*GetProjectWorkspaceFileOutput, error)
func (*ProjectHandler) ListProjectTags ¶
func (h *ProjectHandler) ListProjectTags(ctx context.Context, _ *ListProjectTagsInput) (*ListProjectTagsOutput, error)
ListProjectTags returns the reusable project tag catalog for an environment.
func (*ProjectHandler) ListProjects ¶
func (h *ProjectHandler) ListProjects(ctx context.Context, input *ListProjectsInput) (*ListProjectsOutput, error)
ListProjects returns a paginated list of projects.
func (*ProjectHandler) PullProjectImages ¶
func (h *ProjectHandler) PullProjectImages(ctx context.Context, input *PullProjectImagesInput) (*huma.StreamResponse, error)
PullProjectImages pulls all images for a project with streaming progress.
func (*ProjectHandler) RedeployProject ¶
func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployProjectInput) (*huma.StreamResponse, error)
RedeployProject redeploys a Docker Compose project. RedeployProject pulls project images and re-deploys, streaming the raw docker CLI output as NDJSON like DeployProject.
func (*ProjectHandler) RestartProject ¶
func (h *ProjectHandler) RestartProject(ctx context.Context, input *RestartProjectInput) (*RestartProjectOutput, error)
RestartProject restarts the given services in a project (all services when none are specified).
func (*ProjectHandler) UnarchiveProject ¶
func (h *ProjectHandler) UnarchiveProject(ctx context.Context, input *UnarchiveProjectInput) (*UnarchiveProjectOutput, error)
func (*ProjectHandler) UpdateProject ¶
func (h *ProjectHandler) UpdateProject(ctx context.Context, input *UpdateProjectInput) (*UpdateProjectOutput, error)
UpdateProject updates a Docker Compose project.
func (*ProjectHandler) UpdateProjectServices ¶
func (h *ProjectHandler) UpdateProjectServices(ctx context.Context, input *UpdateProjectServicesInput) (*UpdateProjectServicesOutput, error)
UpdateProjectServices pulls the latest images for the given services and recreates them.
func (*ProjectHandler) UpdateProjectTag ¶
func (h *ProjectHandler) UpdateProjectTag(ctx context.Context, input *UpdateProjectTagInput) (*UpdateProjectTagOutput, error)
UpdateProjectTag applies one UI-managed project tag association change.
func (*ProjectHandler) UpdateProjectWorkspace ¶
func (h *ProjectHandler) UpdateProjectWorkspace(ctx context.Context, input *UpdateProjectWorkspaceInput) (*UpdateProjectWorkspaceOutput, error)
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
func NewProjectService ¶
func NewProjectService(db *database.DB, settingsService *settings.SettingsService, eventService *event.EventService, imageService *image.ImageService, dockerService *docker.DockerClientService, buildService buildServiceInternal, lifecycleService *lifecycle.LifecycleService, containerRegistryService *registry.ContainerRegistryService, cfg *config.Config) *ProjectService
func (*ProjectService) ApplyGitSyncEnvToDirectory ¶
func (s *ProjectService) ApplyGitSyncEnvToDirectory(ctx context.Context, projectPath, projectsDirectory string, gitEnvContent *string) (before, after string, err error)
ApplyGitSyncEnvToDirectory applies the same managed three-file environment merge used by single-file project syncs and returns the effective content before and after the update.
func (*ProjectService) ApplyGitSyncProjectFiles ¶
func (*ProjectService) ArchiveProject ¶
func (*ProjectService) BackfillProjectImageRefs ¶
func (s *ProjectService) BackfillProjectImageRefs(ctx context.Context) (int, error)
func (*ProjectService) BuildProjectServices ¶
func (s *ProjectService) BuildProjectServices(ctx context.Context, projectID string, options ProjectBuildOptions, progressWriter io.Writer, user *models.User) error
func (*ProjectService) CountProjectsWithPendingUpdates ¶
func (s *ProjectService) CountProjectsWithPendingUpdates(ctx context.Context, allContainers []container.Summary) (int, error)
CountProjectsWithPendingUpdates counts non-archived projects with at least one image update pending, plus compose projects running on the daemon that Arcane does not track. It deliberately avoids the project-list pipeline: that path builds full project DTOs (live status, icons, URLs, GitOps lookups) and then throws all of them away for a single number, costing several full container lists and a compose parse per project on every dashboard load.
allContainers is the caller's already-fetched container list; pass nil to have it fetched here.
func (*ProjectService) CountServicesFromCompose ¶
func (*ProjectService) CreateGitOpsManagedProject ¶
func (s *ProjectService) CreateGitOpsManagedProject(ctx context.Context, sync *models.GitOpsSync, project *models.Project, actor models.User, logEventOptions ...bool) error
CreateGitOpsManagedProject persists a promoted GitOps project, links both records, updates the compose-name cache, and records the creation event.
func (*ProjectService) CreateProject ¶
func (s *ProjectService) CreateProject(ctx context.Context, name, composeContent string, envContent *string, manifest project.CreateProjectWorkspaceManifest, uploads map[int][]byte, uiTags []string, uiTagColors map[string]project.TagColor, user models.User, allowNameSuffixOptions ...bool) (*models.Project, error)
CreateProject creates a project's directory, files, and DB row. When allowNameSuffix is true a directory-name collision is resolved by appending "-N" (the interactive default). When false a collision returns projects.ErrProjectDirExists (wrapped) so GitOps creates fail loudly instead of minting runaway "-N" duplicate projects on a broken binding.
func (*ProjectService) DeployProject ¶
func (s *ProjectService) DeployProject(ctx context.Context, projectID string, user models.User, options *project.DeployOptions) error
func (*ProjectService) DestroyProject ¶
func (*ProjectService) DownProject ¶
func (*ProjectService) DownloadProjectWorkspaceFile ¶
func (s *ProjectService) DownloadProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (io.ReadCloser, int64, string, error)
func (*ProjectService) EnsureGitOpsProjectLinked ¶
func (s *ProjectService) EnsureGitOpsProjectLinked(ctx context.Context, sync *models.GitOpsSync, project *models.Project) error
EnsureGitOpsProjectLinked persists the bidirectional GitOps/project binding and refreshes the compose-name cache as one domain operation.
func (*ProjectService) EnsureProjectImagesPresent ¶
func (s *ProjectService) EnsureProjectImagesPresent(ctx context.Context, projectID string, progressWriter io.Writer, user models.User, credentials []containerregistry.Credential) error
EnsureProjectImagesPresent checks all compose service images for the project and pulls based on service pull policy: - always/refresh: always pull - missing/if_not_present/default: pull only if local image is missing - never: never pull (fails early if image is missing locally)
func (*ProjectService) EnsureProjectPathUnderRoot ¶
func (s *ProjectService) EnsureProjectPathUnderRoot(ctx context.Context, proj *models.Project, persist bool) error
EnsureProjectPathUnderRoot validates that the project's path is a safe subdirectory of the configured projects root. If not, it normalizes the path to `<projectsRoot>/<dirName or sanitized project name>`. When persist=true, it saves the updated project path to the database.
func (*ProjectService) GetProjectByComposeName ¶
func (*ProjectService) GetProjectContent ¶
func (*ProjectService) GetProjectDetails ¶
func (s *ProjectService) GetProjectDetails(ctx context.Context, projectID string, opts project.DetailsOptions) (project.Details, error)
func (*ProjectService) GetProjectFromDatabaseByID ¶
func (*ProjectService) GetProjectRelativePath ¶
func (s *ProjectService) GetProjectRelativePath(ctx context.Context, projectPath string) string
func (*ProjectService) GetProjectServices ¶
func (s *ProjectService) GetProjectServices(ctx context.Context, projectID string) ([]ProjectServiceInfo, error)
func (*ProjectService) GetProjectStatusCounts ¶
func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCount, runningProjects, stoppedProjects, totalProjects, archivedProjects int, err error)
func (*ProjectService) GetProjectTags ¶
func (s *ProjectService) GetProjectTags(ctx context.Context, projectID string) ([]projecttypes.Tag, error)
GetProjectTags returns the effective UI and Compose tag associations for a project.
func (*ProjectService) GetProjectWorkspace ¶
func (s *ProjectService) GetProjectWorkspace(ctx context.Context, projectID string) (*workspacetypes.Workspace, error)
func (*ProjectService) GetProjectWorkspaceFile ¶
func (s *ProjectService) GetProjectWorkspaceFile(ctx context.Context, projectID, relativePath string) (*workspacetypes.FileContent, error)
func (*ProjectService) GetProjectsDirectory ¶
func (s *ProjectService) GetProjectsDirectory(ctx context.Context) (string, error)
func (*ProjectService) HandleProjectFilesChanged ¶
func (s *ProjectService) HandleProjectFilesChanged(ctx context.Context, paths []string)
func (*ProjectService) ListAllProjects ¶
func (*ProjectService) ListProjectTagOptions ¶
func (s *ProjectService) ListProjectTagOptions(ctx context.Context) ([]projecttypes.TagOption, error)
ListProjectTagOptions returns the distinct tag names and colors available in the current environment.
func (*ProjectService) ListProjects ¶
func (s *ProjectService) ListProjects(ctx context.Context, params pagination.QueryParams) ([]project.Details, pagination.Response, error)
func (*ProjectService) ProjectMetadata ¶
func (s *ProjectService) ProjectMetadata(ctx context.Context, p models.Project, env *projectMetadataEnvInternal) projects.ArcaneComposeMetadata
ProjectMetadata resolves a project's icon sets and service URLs. Results are cached for projectMetadataTTL because deriving them is expensive (compose load with interpolation and .env reads, plus a gitops_syncs query for GitOps-managed projects) and every project row on the list page needs it.
env may be nil, in which case the projects directory and autoInjectEnv setting are resolved here; callers iterating over many projects should resolve them once and pass them in.
func (*ProjectService) PullProjectImages ¶
func (s *ProjectService) PullProjectImages(ctx context.Context, projectID string, progressWriter io.Writer, user models.User, credentials []containerregistry.Credential) error
func (*ProjectService) RecoverProjectRenameJournals ¶
func (s *ProjectService) RecoverProjectRenameJournals(ctx context.Context) error
func (*ProjectService) RedeployProject ¶
func (s *ProjectService) RedeployProject(ctx context.Context, projectID string, user models.User, options *project.DeployOptions) error
func (*ProjectService) ResolveProjectComposeFile ¶
func (*ProjectService) ResolveRegistryCredentials ¶
func (s *ProjectService) ResolveRegistryCredentials(ctx context.Context) ([]containerregistry.Credential, error)
func (*ProjectService) RestartProject ¶
func (*ProjectService) StreamProjectLogs ¶
func (*ProjectService) SyncProjectsFromFileSystem ¶
func (s *ProjectService) SyncProjectsFromFileSystem(ctx context.Context) error
func (*ProjectService) UnarchiveProject ¶
func (*ProjectService) UpdateProject ¶
func (*ProjectService) UpdateProjectServices ¶
func (*ProjectService) UpdateProjectTag ¶
func (s *ProjectService) UpdateProjectTag(ctx context.Context, projectID, name string, color projecttypes.TagColor, attached bool, user models.User) ([]projecttypes.Tag, error)
UpdateProjectTag attaches or detaches a UI-managed tag and rejects Compose-owned names.
func (*ProjectService) UpdateProjectWorkspace ¶
func (s *ProjectService) UpdateProjectWorkspace(ctx context.Context, projectID string, manifest projecttypes.WorkspaceUpdateManifest, uploads map[int][]byte, user models.User) (*workspacetypes.Workspace, error)
func (*ProjectService) ValidateComposeDirectory ¶
func (s *ProjectService) ValidateComposeDirectory(ctx context.Context, projectName, projectPath, composeFileName string) (int, error)
ValidateComposeDirectory loads a staged compose tree with the same settings, Docker path mapping, and validation rules used by managed projects.
func (*ProjectService) WithKVService ¶
func (s *ProjectService) WithKVService(kvService *kv.KVService) *ProjectService
func (*ProjectService) WithRegistryCredentialsProvider ¶
func (s *ProjectService) WithRegistryCredentialsProvider(provider func(context.Context) ([]containerregistry.Credential, error)) *ProjectService
type ProjectServiceInfo ¶
type ProjectServiceInfo struct {
Name string `json:"name"`
Image string `json:"image"`
Status string `json:"status"`
ContainerID string `json:"container_id"`
ContainerName string `json:"container_name"`
Ports []string `json:"ports"`
Health *string `json:"health,omitempty"`
IconLightURL string `json:"icon_light_url,omitempty"`
IconDarkURL string `json:"icon_dark_url,omitempty"`
ServiceConfig *composetypes.ServiceConfig `json:"service_config,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
RedeployDisabled bool `json:"redeploy_disabled,omitempty"`
}
type PullProjectImagesInput ¶
type RedeployProjectInput ¶
type RedeployProjectInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
ProjectID string `path:"projectId" doc:"Project ID"`
Body *project.DeployOptions
}
type RestartProjectInput ¶
type RestartProjectOutput ¶
type RestartProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type UnarchiveProjectInput ¶
type UnarchiveProjectOutput ¶
type UnarchiveProjectOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type UpdateProjectInput ¶
type UpdateProjectInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
ProjectID string `path:"projectId" doc:"Project ID"`
Body project.UpdateProject
}
type UpdateProjectOutput ¶
type UpdateProjectOutput struct {
Body base.ApiResponse[project.Details]
}
type UpdateProjectServicesOutput ¶
type UpdateProjectServicesOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type UpdateProjectTagInput ¶
type UpdateProjectTagInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
ProjectID string `path:"projectId" doc:"Project ID"`
Body project.UpdateTag
}
UpdateProjectTagInput identifies a project and the UI tag mutation to apply.
type UpdateProjectTagOutput ¶
type UpdateProjectTagOutput struct {
Body base.ApiResponse[project.UpdateTagResponse]
}
UpdateProjectTagOutput contains the project's effective tags after mutation.
type UpdateProjectWorkspaceOutput ¶
type UpdateProjectWorkspaceOutput struct {
Body base.ApiResponse[workspacetypes.Workspace]
}