sync

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRepositoryCondition

func SetRepositoryCondition(ctx context.Context, coreClient client.WithWatch, repoKey repository.RepositoryKey, status util.RepositoryStatus, syncError error, nextSyncTime *time.Time) error

SetRepositoryCondition sets the repository condition status

Types

type SyncHandler

type SyncHandler interface {
	// SyncOnce performs a single sync operation
	SyncOnce(ctx context.Context) error
	// Key returns the repository key
	Key() repository.RepositoryKey
	// GetSpec returns the repository spec
	GetSpec() *configapi.Repository
}

SyncHandler defines the interface for repository sync operations

type SyncManager

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

SyncManager handles repository synchronization with scheduling

func NewSyncManager

func NewSyncManager(handler SyncHandler, coreClient client.WithWatch) *SyncManager

NewSyncManager creates a new sync manager

func (*SyncManager) GetLastSyncError

func (m *SyncManager) GetLastSyncError() error

GetLastSyncError returns the last sync error

func (*SyncManager) SetRepositoryCondition

func (m *SyncManager) SetRepositoryCondition(ctx context.Context, status util.RepositoryStatus) error

func (*SyncManager) Start

func (m *SyncManager) Start(ctx context.Context, defaultSyncFrequency time.Duration)

Start begins the sync process with periodic and one-time scheduling

func (*SyncManager) Stop

func (m *SyncManager) Stop()

Stop stops the sync manager

Jump to

Keyboard shortcuts

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