Documentation
¶
Overview ¶
Package gitops owns GitOps synchronization, scheduling, persistence, and routes.
Index ¶
- func RegisterGitOpsSyncs(api huma.API, syncService *GitOpsSyncService)
- type BrowseSyncFilesInput
- type BrowseSyncFilesOutput
- type CreateGitOpsSyncInput
- type CreateGitOpsSyncOutput
- type DeleteGitOpsSyncInput
- type DeleteGitOpsSyncOutput
- type GetGitOpsSyncInput
- type GetGitOpsSyncOutput
- type GetSyncStatusInput
- type GetSyncStatusOutput
- type GitOpsSyncHandler
- func (h *GitOpsSyncHandler) BrowseFiles(ctx context.Context, input *BrowseSyncFilesInput) (*BrowseSyncFilesOutput, error)
- func (h *GitOpsSyncHandler) CreateSync(ctx context.Context, input *CreateGitOpsSyncInput) (*CreateGitOpsSyncOutput, error)
- func (h *GitOpsSyncHandler) DeleteSync(ctx context.Context, input *DeleteGitOpsSyncInput) (*DeleteGitOpsSyncOutput, error)
- func (h *GitOpsSyncHandler) GetStatus(ctx context.Context, input *GetSyncStatusInput) (*GetSyncStatusOutput, error)
- func (h *GitOpsSyncHandler) GetSync(ctx context.Context, input *GetGitOpsSyncInput) (*GetGitOpsSyncOutput, error)
- func (h *GitOpsSyncHandler) ImportSyncs(ctx context.Context, input *ImportGitOpsSyncsInput) (*ImportGitOpsSyncsOutput, error)
- func (h *GitOpsSyncHandler) ListSyncs(ctx context.Context, input *ListGitOpsSyncsInput) (*ListGitOpsSyncsOutput, error)
- func (h *GitOpsSyncHandler) PerformSync(ctx context.Context, input *PerformSyncInput) (*PerformSyncOutput, error)
- func (h *GitOpsSyncHandler) UpdateSync(ctx context.Context, input *UpdateGitOpsSyncInput) (*UpdateGitOpsSyncOutput, error)
- type GitOpsSyncService
- func (s *GitOpsSyncService) BrowseFiles(ctx context.Context, environmentID, id string, path string) (*gitops.BrowseResponse, error)
- func (s *GitOpsSyncService) CleanupLeakedScratchDirsOnStartup(ctx context.Context) error
- func (s *GitOpsSyncService) CleanupOrphanedSyncsOnStartup(ctx context.Context) error
- func (s *GitOpsSyncService) CreateSync(ctx context.Context, environmentID string, req gitops.CreateSyncRequest, ...) (*projectpkg.GitOpsSync, error)
- func (s *GitOpsSyncService) DeleteSync(ctx context.Context, environmentID, id string, actor common.User) error
- func (s *GitOpsSyncService) GetSyncByID(ctx context.Context, environmentID, id string) (*projectpkg.GitOpsSync, error)
- func (s *GitOpsSyncService) GetSyncStatus(ctx context.Context, environmentID, id string) (*gitops.SyncStatus, error)
- func (s *GitOpsSyncService) GetSyncsPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]gitops.GitOpsSync, pagination.Response, gitops.SyncCounts, error)
- func (s *GitOpsSyncService) ImportSyncs(ctx context.Context, environmentID string, ...) (*gitops.ImportGitOpsSyncResponse, error)
- func (s *GitOpsSyncService) PerformSync(ctx context.Context, environmentID, id string, actor common.User) (*gitops.SyncResult, error)
- func (s *GitOpsSyncService) ReconcileDirectorySyncProjectsOnStartup(ctx context.Context) error
- func (s *GitOpsSyncService) RegisterAutoSyncJobsOnStartup(ctx context.Context)
- func (s *GitOpsSyncService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, ...) error
- func (s *GitOpsSyncService) UpdateSync(ctx context.Context, environmentID, id string, req gitops.UpdateSyncRequest, ...) (*projectpkg.GitOpsSync, error)
- type ImportGitOpsSyncsInput
- type ImportGitOpsSyncsOutput
- type ListGitOpsSyncsInput
- type ListGitOpsSyncsOutput
- type Module
- type PerformSyncInput
- type PerformSyncOutput
- type UpdateGitOpsSyncInput
- type UpdateGitOpsSyncOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGitOpsSyncs ¶
func RegisterGitOpsSyncs(api huma.API, syncService *GitOpsSyncService)
RegisterGitOpsSyncs registers all GitOps sync endpoints.
Types ¶
type BrowseSyncFilesInput ¶
type BrowseSyncFilesOutput ¶
type BrowseSyncFilesOutput struct {
Body base.ApiResponse[gitops.BrowseResponse]
}
type CreateGitOpsSyncInput ¶
type CreateGitOpsSyncInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
Body gitops.CreateSyncRequest
}
type CreateGitOpsSyncOutput ¶
type CreateGitOpsSyncOutput struct {
Body base.ApiResponse[gitops.GitOpsSync]
}
type DeleteGitOpsSyncInput ¶
type DeleteGitOpsSyncOutput ¶
type DeleteGitOpsSyncOutput struct {
Body base.ApiResponse[base.MessageResponse]
}
type GetGitOpsSyncInput ¶
type GetGitOpsSyncOutput ¶
type GetGitOpsSyncOutput struct {
Body base.ApiResponse[gitops.GitOpsSync]
}
type GetSyncStatusInput ¶
type GetSyncStatusOutput ¶
type GetSyncStatusOutput struct {
Body base.ApiResponse[gitops.SyncStatus]
}
type GitOpsSyncHandler ¶
type GitOpsSyncHandler struct {
// contains filtered or unexported fields
}
GitOpsSyncHandler handles GitOps sync management endpoints.
func (*GitOpsSyncHandler) BrowseFiles ¶
func (h *GitOpsSyncHandler) BrowseFiles(ctx context.Context, input *BrowseSyncFilesInput) (*BrowseSyncFilesOutput, error)
BrowseFiles returns the file tree at the specified path in the repository.
func (*GitOpsSyncHandler) CreateSync ¶
func (h *GitOpsSyncHandler) CreateSync(ctx context.Context, input *CreateGitOpsSyncInput) (*CreateGitOpsSyncOutput, error)
CreateSync creates a new GitOps sync.
func (*GitOpsSyncHandler) DeleteSync ¶
func (h *GitOpsSyncHandler) DeleteSync(ctx context.Context, input *DeleteGitOpsSyncInput) (*DeleteGitOpsSyncOutput, error)
DeleteSync deletes a GitOps sync by ID.
func (*GitOpsSyncHandler) GetStatus ¶
func (h *GitOpsSyncHandler) GetStatus(ctx context.Context, input *GetSyncStatusInput) (*GetSyncStatusOutput, error)
GetStatus returns the current status of a GitOps sync.
func (*GitOpsSyncHandler) GetSync ¶
func (h *GitOpsSyncHandler) GetSync(ctx context.Context, input *GetGitOpsSyncInput) (*GetGitOpsSyncOutput, error)
GetSync returns a GitOps sync by ID.
func (*GitOpsSyncHandler) ImportSyncs ¶
func (h *GitOpsSyncHandler) ImportSyncs(ctx context.Context, input *ImportGitOpsSyncsInput) (*ImportGitOpsSyncsOutput, error)
ImportSyncs imports multiple GitOps syncs.
func (*GitOpsSyncHandler) ListSyncs ¶
func (h *GitOpsSyncHandler) ListSyncs(ctx context.Context, input *ListGitOpsSyncsInput) (*ListGitOpsSyncsOutput, error)
ListSyncs returns a paginated list of GitOps syncs.
func (*GitOpsSyncHandler) PerformSync ¶
func (h *GitOpsSyncHandler) PerformSync(ctx context.Context, input *PerformSyncInput) (*PerformSyncOutput, error)
PerformSync manually triggers a sync operation.
func (*GitOpsSyncHandler) UpdateSync ¶
func (h *GitOpsSyncHandler) UpdateSync(ctx context.Context, input *UpdateGitOpsSyncInput) (*UpdateGitOpsSyncOutput, error)
UpdateSync updates an existing GitOps sync.
type GitOpsSyncService ¶
type GitOpsSyncService struct {
// contains filtered or unexported fields
}
func NewGitOpsSyncService ¶
func NewGitOpsSyncService(db *database.DB, repoService *gitrepo.GitRepositoryService, projectService *projectpkg.ProjectService, swarmService *swarm.SwarmService, eventService *event.EventService, settingsService *settings.SettingsService) *GitOpsSyncService
func (*GitOpsSyncService) BrowseFiles ¶
func (s *GitOpsSyncService) BrowseFiles(ctx context.Context, environmentID, id string, path string) (*gitops.BrowseResponse, error)
func (*GitOpsSyncService) CleanupLeakedScratchDirsOnStartup ¶
func (s *GitOpsSyncService) CleanupLeakedScratchDirsOnStartup(ctx context.Context) error
CleanupLeakedScratchDirsOnStartup removes orphaned GitOps scratch directories (.gitops-sync-stage-*, .gitops-backup-*, and the legacy "<name>.gitops-backup-<digits>" form) left in the projects directory by a crash or container restart that interrupted a sync mid-flight. These are Arcane-internal working dirs; left in place the filesystem discovery imports them as phantom projects. It is safe to run at startup because it executes before any sync job is registered, so nothing is mid-stage.
func (*GitOpsSyncService) CleanupOrphanedSyncsOnStartup ¶
func (s *GitOpsSyncService) CleanupOrphanedSyncsOnStartup(ctx context.Context) error
func (*GitOpsSyncService) CreateSync ¶
func (s *GitOpsSyncService) CreateSync(ctx context.Context, environmentID string, req gitops.CreateSyncRequest, actor common.User) (*projectpkg.GitOpsSync, error)
func (*GitOpsSyncService) DeleteSync ¶
func (*GitOpsSyncService) GetSyncByID ¶
func (s *GitOpsSyncService) GetSyncByID(ctx context.Context, environmentID, id string) (*projectpkg.GitOpsSync, error)
func (*GitOpsSyncService) GetSyncStatus ¶
func (s *GitOpsSyncService) GetSyncStatus(ctx context.Context, environmentID, id string) (*gitops.SyncStatus, error)
func (*GitOpsSyncService) GetSyncsPaginated ¶
func (s *GitOpsSyncService) GetSyncsPaginated(ctx context.Context, environmentID string, params pagination.QueryParams) ([]gitops.GitOpsSync, pagination.Response, gitops.SyncCounts, error)
func (*GitOpsSyncService) ImportSyncs ¶
func (s *GitOpsSyncService) ImportSyncs(ctx context.Context, environmentID string, req []gitops.ImportGitOpsSyncRequest, actor common.User) (*gitops.ImportGitOpsSyncResponse, error)
func (*GitOpsSyncService) PerformSync ¶
func (s *GitOpsSyncService) PerformSync(ctx context.Context, environmentID, id string, actor common.User) (*gitops.SyncResult, error)
func (*GitOpsSyncService) ReconcileDirectorySyncProjectsOnStartup ¶
func (s *GitOpsSyncService) ReconcileDirectorySyncProjectsOnStartup(ctx context.Context) error
func (*GitOpsSyncService) RegisterAutoSyncJobsOnStartup ¶
func (s *GitOpsSyncService) RegisterAutoSyncJobsOnStartup(ctx context.Context)
RegisterAutoSyncJobsOnStartup registers a dynamic job for every auto-sync-enabled sync and kicks an immediate run for any that are overdue. This replaces the old global polling job so existing syncs keep running after upgrade.
func (*GitOpsSyncService) SetScheduler ¶
func (s *GitOpsSyncService) SetScheduler(ctx context.Context, scheduler schedulertypes.DynamicScheduler, admissionGate *actors.Gate[actors.AdmissionKey]) error
SetScheduler injects the job scheduler and the app lifecycle context. It must be called during bootstrap (after the service graph is built) before any per-sync jobs are registered. The lifecycle context is used for background sync kicks so they outlive the request/bootstrap goroutine that triggered them.
func (*GitOpsSyncService) UpdateSync ¶
func (s *GitOpsSyncService) UpdateSync(ctx context.Context, environmentID, id string, req gitops.UpdateSyncRequest, actor common.User) (*projectpkg.GitOpsSync, error)
type ImportGitOpsSyncsInput ¶
type ImportGitOpsSyncsInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
Body []gitops.ImportGitOpsSyncRequest
}
type ImportGitOpsSyncsOutput ¶
type ImportGitOpsSyncsOutput struct {
Body base.ApiResponse[gitops.ImportGitOpsSyncResponse]
}
type ListGitOpsSyncsInput ¶
type ListGitOpsSyncsInput 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"`
Start int `query:"start" default:"0" doc:"Start index"`
Limit int `query:"limit" default:"20" doc:"Items per page"`
}
type ListGitOpsSyncsOutput ¶
type ListGitOpsSyncsOutput struct {
Body base.PaginatedWithCounts[gitops.GitOpsSync, gitops.SyncCounts]
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(service *GitOpsSyncService) *Module
func (*Module) RegisterRoutes ¶
func (*Module) Service ¶
func (m *Module) Service() *GitOpsSyncService
type PerformSyncInput ¶
type PerformSyncOutput ¶
type PerformSyncOutput struct {
Body base.ApiResponse[gitops.SyncResult]
}
type UpdateGitOpsSyncInput ¶
type UpdateGitOpsSyncInput struct {
EnvironmentID string `path:"id" doc:"Environment ID"`
SyncID string `path:"syncId" doc:"Sync ID"`
Body gitops.UpdateSyncRequest
}
type UpdateGitOpsSyncOutput ¶
type UpdateGitOpsSyncOutput struct {
Body base.ApiResponse[gitops.GitOpsSync]
}