sync

package
v12.0.403 Latest Latest
Warning

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

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

Documentation

Overview

Package sync implements the REST API handlers for sync operations. STRATEGY: Partial Sync - Only sweep/resurrect releases in the sync payload

Package sync defines the REST API types for sync operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostSyncWithEndpoint

func PostSyncWithEndpoint(db database.DBConnection) fiber.Handler

PostSyncWithEndpoint handles POST requests for syncing multiple releases to an endpoint

func ProcessSync added in v12.0.165

func ProcessSync(
	ctx context.Context,
	db database.DBConnection,
	endpointName string,
	releaseName string,
	releaseVersion string,
	sbomCVEs []lifecycle.CVEInfo,
	syncedAt time.Time,
) error

ProcessSync handles sync event and updates lifecycle tracking using version snapshots.

Types

type ReleaseKey

type ReleaseKey struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

ReleaseKey represents a unique release identifier

type ReleaseMetadata

type ReleaseMetadata struct {
	Name              string `json:"name"`
	Version           string `json:"version"`
	VersionMajor      *int   `json:"version_major"`
	VersionMinor      *int   `json:"version_minor"`
	VersionPatch      *int   `json:"version_patch"`
	VersionPrerelease string `json:"version_prerelease"`
}

ReleaseMetadata holds full release metadata

type ReleaseResult

type ReleaseResult struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Status  string `json:"status"` // "synced", "created", "created_with_sbom", "updated", "updated_with_sbom", "unchanged", "error"
	SyncKey string `json:"sync_key,omitempty"`
	Message string `json:"message"`
}

ReleaseResult tracks the outcome of processing each release

type Request added in v12.0.154

type Request struct {
	ReleaseName    string `json:"release_name"`
	ReleaseVersion string `json:"release_version"`
	EndpointName   string `json:"endpoint_name"`
	SyncStatus     string `json:"sync_status,omitempty"`
	SyncMessage    string `json:"sync_message,omitempty"`
}

Request represents the request body for creating a sync

type Response added in v12.0.154

type Response struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	SyncKey string `json:"sync_key,omitempty"`
}

Response represents the response for sync operations

type ServiceInventory

type ServiceInventory struct {
	Name       string        `json:"name"`
	Current    ServiceState  `json:"current"`
	Previous   *ServiceState `json:"previous"`
	ReleaseDoc struct {
		ScorecardScore *float64 `json:"openssf_scorecard_score"`
		ProjectType    string   `json:"project_type"`
	} `json:"release_doc"`
}

ServiceInventory represents service metadata

type ServiceState

type ServiceState struct {
	Version  string `json:"version"`
	SyncedAt string `json:"synced_at"`
}

ServiceState represents a service in sync inventory

Jump to

Keyboard shortcuts

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