Help us shape the future of Go! Take the 2026 Go Developer Survey

sync

package
v2.17.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Overview

Package sync applies deployment GitOps syncs: it clones the source, stages and promotes project files, and redeploys the linked project or stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service runs deployment syncs. Shared sync limits, error events and job registration stay with the parent and arrive as callbacks.

func New

func New(
	db *database.DB,
	repoService *gitrepo.GitRepositoryService,
	projectService *projectpkg.ProjectService,
	swarmService *swarm.SwarmService,
	eventService *event.EventService,
	limits func(context.Context, *projectpkg.GitOpsSync) (int, int64, int64),
	logError func(context.Context, *projectpkg.GitOpsSync, user.Actor, string),
	unregisterJob func(context.Context, string),
) *Service

func (*Service) DirectoryProject

func (s *Service) DirectoryProject(ctx context.Context, sync *projectpkg.GitOpsSync) (*projectpkg.Project, error)

DirectoryProject resolves the linked project for a directory sync, relinking or recovering it when the stored reference is stale. A sync whose project is gone and cannot be recovered has a broken binding.

func (*Service) Run

func (s *Service) Run(ctx context.Context, sync *projectpkg.GitOpsSync, actor user.Actor, result *gitops.SyncResult) (*gitops.SyncResult, error)

Run clones the sync source and applies it to its project or Swarm stack. A retry replays the revision its run pinned, and redeploys it unless the record already confirms that revision.

Jump to

Keyboard shortcuts

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