timeline

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package timeline provides a library-friendly timeline analysis pipeline. This is the public API for timeline analysis without CLI dependencies (no spinner, color, cache, flag parsing).

Index

Constants

This section is empty.

Variables

View Source
var (
	BuildTimeline     = timeline.BuildTimeline
	DetectTransitions = timeline.DetectTransitions
	BuildTeamTimeline = timeline.BuildTeamTimeline
)

Functions

func BuildTeamPeriodResults

func BuildTeamPeriodResults(d string, periods []PeriodResult, cfg *config.Config) map[string][]timeline.TeamPeriodResult

BuildTeamPeriodResults aggregates per-period scored results into TeamPeriodResults. Returns map[teamName][]TeamPeriodResult.

func ParseSpan

func ParseSpan(s string) (months int, days int, err error)

ParseSpan converts a span string to a SpanDuration. Supported values: "1w", "1m", "3m", "6m", "1y".

func PeriodLabel

func PeriodLabel(start time.Time, spanMonths, spanDays int) string

PeriodLabel generates a human-readable label for a period.

Types

type AuthorPeriod

type AuthorPeriod = timeline.AuthorPeriod

type AuthorTimeline

type AuthorTimeline = timeline.AuthorTimeline

type Callbacks

type Callbacks struct {
	OnRepoStart     func(repoName string, domain string)
	OnRepoSkipped   func(repoName, reason string)
	OnPeriodStart   func(periodLabel string, index, total int)
	OnBlameProgress func(repoName string, done, total int)
	OnVerbose       func(msg string)
}

Callbacks for progress reporting during timeline analysis.

type DomainTimeline

type DomainTimeline struct {
	Domain  string
	Periods []PeriodResult
}

DomainTimeline holds timeline results for one domain.

func Run

func Run(opts Options, repoPaths []string, cfg *config.Config, cb *Callbacks) ([]DomainTimeline, error)

Run executes the timeline analysis pipeline on the given repository paths. It returns per-domain timeline results without any CLI-specific behavior.

type Options

type Options struct {
	Span         string // "1w", "1m", "3m", "6m", "1y"
	Periods      int    // number of periods to show (0 = all history)
	Since        string // ISO date (e.g. "2024-01-01"), overrides Periods
	Workers      int
	DomainFilter string
	PressureMode string // "include" or "ignore"
	Tau          float64
	SampleSize   int
	ActiveDays   int
	CacheEnabled bool // enable disk cache for blame/log results
}

Options controls timeline analysis behavior.

type PeriodResult

type PeriodResult = timeline.PeriodResult

type TeamPeriodResult

type TeamPeriodResult = timeline.TeamPeriodResult

type TeamPeriodSnapshot

type TeamPeriodSnapshot = timeline.TeamPeriodSnapshot

type TeamTimeline

type TeamTimeline = timeline.TeamTimeline

type TimeWindow

type TimeWindow struct {
	Label string
	Start time.Time
	End   time.Time
}

TimeWindow represents a time period for timeline analysis.

func BuildPeriods

func BuildPeriods(spanMonths, spanDays, numPeriods int, since time.Time, now time.Time) []TimeWindow

BuildPeriods creates time windows from now backwards (or from since forward).

type Transition

type Transition = timeline.Transition

Jump to

Keyboard shortcuts

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