schedule

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package schedule produces a per-day commit plan over a date range, applying a two-state Markov chain at the week level so that active and quiet streaks emerge naturally instead of independent per-day rolls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TotalCommits

func TotalCommits(days []Day) int

TotalCommits returns the sum of Commits across all days. Useful for previews and progress bars.

Types

type Day

type Day struct {
	Date    time.Time // midnight in the input timezone
	Commits int       // 0 if the day was rolled as inactive
	Active  bool      // whether the containing week was rolled active
}

Day is one rolled day in a plan.

func Plan

func Plan(start, end time.Time, p profile.Profile, rng *rand.Rand) []Day

Plan returns a Day per date in [start, end] inclusive. start and end MUST carry the timezone the user wants for weekend detection and day boundaries.

The rng is consumed deterministically — same seed, same range, same profile produces the same plan, which is what the seed flag promises to users.

Jump to

Keyboard shortcuts

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