// Package scraper defines one-shot metrics scrapers and supervises their
// scheduling.
package scraper

import (
	"context"
	"time"
)

// Scraper performs one collection. Each implementation obtains its own target
// category from discovery. Scrape must return when ctx is cancelled. The
// Manager serializes calls to each Scraper, while different Scrapers run
// independently.
type Scraper interface {
	Scrape(ctx context.Context) error
}

// ManagerConfig configures scrape scheduling.
type ManagerConfig struct {
	Interval time.Duration
}

// Manager schedules a fixed set of one-shot Scrapers.
type Manager interface {
	Start(ctx context.Context) error
	NeedLeaderElection() bool
}
