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 ¶
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 ¶
ServiceState represents a service in sync inventory