detect

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package detect is the scheduler's Checker: it fetches a target through the source registered for its kind and commits what it found (known set, held versions, events, deliveries) through event.Commit, the transactional outbox. It is the glue of detect -> normalize that the scheduler leaves out so as not to import the pipeline (scheduler.Checker).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	// Store commits a check in one transaction; the SQLite store implements it.
	Store event.Committer
	// Sources lists the upstream versions of a target. Production passes a
	// registry whose sources fetch through the netguard client.
	Sources Sources
	// Instance is instance.name, the <instance> of every event's source.
	Instance string
	// RegistryURL returns the configured base URL of a source (its name: a
	// kind, or an instance) when it is not the public registry, otherwise ""
	// (event.CheckInput.RegistryURL). Nil means "" for every source.
	RegistryURL func(name string) string
	// Matcher caches the compiled subscriptions across checks; nil loads
	// them on every commit.
	Matcher *event.MatcherCache
	// Now stamps the check; nil means time.Now.
	Now    func() time.Time
	Logger *slog.Logger
}

Checker implements scheduler.Checker. Its fields are read-only after the scheduler starts, so one Checker serves every worker.

func (*Checker) Check

func (c *Checker) Check(ctx context.Context, t store.Target) (scheduler.Outcome, error)

Check implements scheduler.Checker. A source error, an unknown kind or a failed commit is returned (the scheduler backs off); nothing is committed then, and the fetch state is kept.

type Sources

type Sources interface {
	Get(kind string) (source.Source, error)
}

Sources finds the Source registered under a name, which is a source kind or the name of an instance of one; *source.Registry implements it. The Source's Kind is the base kind.

Jump to

Keyboard shortcuts

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