refresh

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactReader added in v0.2.13

type ArtifactReader interface {
	ListByCollection(
		ctx context.Context,
		ref collection.CollectionRef,
	) ([]artifact.Artifact, error)

	ListSuppressions(
		ctx context.Context,
		ref collection.CollectionRef,
	) ([]artifact.Suppression, error)
}

type CollectionReader added in v0.2.13

type CollectionReader interface {
	Get(
		ctx context.Context,
		ref collection.CollectionRef,
	) (collection.Collection, error)

	ListAttachments(
		ctx context.Context,
		ref collection.CollectionRef,
	) ([]collection.Attachment, error)
}

type Publication

type Publication struct {
	Ref collection.CollectionRef

	// ExpectedCatalogRevision is zero when the root has no prior publication.
	// It prevents a concurrent refresh from replacing a newer catalog with an
	// older source observation.
	ExpectedCatalogRevision     uint64
	ExpectedCollectionRevision  uint64
	ExpectedAttachmentRevisions map[basespec.SourceID]uint64
	ExpectedSourceRevisions     map[basespec.SourceID]uint64

	// SourceGenerations contains one confirmed generation for every Source
	// whose attachment and Source are enabled at publication time. Publisher
	// verifies that set against persisted metadata.
	SourceGenerations map[basespec.SourceID]string

	PlanFingerprint    cryptoutil.Digest
	DecoderFingerprint cryptoutil.Digest
	Occurrences        []catalog.Occurrence
	ArtifactCreates    []artifact.Artifact
	ArtifactUpdates    []artifact.SourceStateUpdate
	Diagnostics        []diagnostic.Diagnostic
	PublishedAt        time.Time
}

func (Publication) Validate

func (p Publication) Validate() error

type Publisher

type Publisher interface {
	Publish(
		ctx context.Context,
		publication Publication,
	) (catalog.Snapshot, error)
}

type Result

type Result struct {
	Catalog          catalog.Snapshot
	CreatedArtifacts []basespec.ArtifactID
	UpdatedArtifacts []basespec.ArtifactID
	Diagnostics      []diagnostic.Diagnostic
	Candidates       int
}

type Runner

type Runner interface {
	Refresh(
		ctx context.Context,
		ref collection.CollectionRef,
		plan discovery.Plan,
		policy artifact.Policy,
	) (Result, error)
}

type Service

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

func NewService

func NewService(
	collections CollectionReader,
	catalogs catalog.Reader,
	sources source.Runtime,
	artifacts ArtifactReader,
	discoveryEngine *discovery.Engine,
	definitions definition.Repository,
	reconciler *artifact.Reconciler,
	publisher Publisher,
	timeClock clockutil.Clock,
	policy protection.RootPolicy,
) (*Service, error)

func (*Service) Refresh

func (s *Service) Refresh(
	ctx context.Context,
	ref collection.CollectionRef,
	plan discovery.Plan,
	policy artifact.Policy,
) (Result, error)

Jump to

Keyboard shortcuts

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