collector

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package collector defines the Collector interface and a registry for managing available collectors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() []string

List returns the names of all registered collectors in no particular order.

func Register

func Register(c Collector)

Register adds a collector to the global registry. It panics if a collector with the same name is already registered.

Types

type Collector

type Collector interface {
	// Name returns the unique name of this collector (e.g., "todos", "gitlog").
	Name() string

	// Collect scans the repository at repoPath and returns discovered signals.
	Collect(ctx context.Context, repoPath string, opts signal.CollectorOpts) ([]signal.RawSignal, error)
}

Collector extracts raw signals from a repository.

func Get

func Get(name string) Collector

Get returns the collector with the given name, or nil if not found.

type MetricsProvider added in v0.5.0

type MetricsProvider interface {
	Metrics() any
}

MetricsProvider is an optional interface that collectors can implement to expose structured metrics from their analysis. The pipeline checks for this interface after Collect() returns and stores the result in CollectorResult.

Jump to

Keyboard shortcuts

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