snapshot

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: Apache-2.0 Imports: 15 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 snapshot builds shareable mirror copies for demos and benchmarks. See specs/000-product/contracts/sync.md "Snapshot generation".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseWindow

func ParseWindow(s string) (time.Duration, error)

ParseWindow parses a human window like "90d", "12w", "720h", or any time.ParseDuration string. Empty returns (0, nil).

Types

type Options

type Options struct {
	From   string
	Out    string
	Spread time.Duration // 0 = keep source timestamps
	Scale  int           // target issue count; ≤ source count means no cloning
	Seed   int64         // reserved for determinism; algorithm itself is seed-stable
	Force  bool
	Now    time.Time
}

Options controls snapshot generation. Now is injectable for deterministic tests.

type Result

type Result struct {
	Path      string
	Issues    int
	Comments  int
	Changelog int
	Spread    time.Duration
	Scale     int
	Bytes     int64
}

Result is the human-readable summary of a successful Build.

func Build

func Build(opts Options) (Result, error)

Build creates a new shareable database at opts.Out from opts.From. Output is written via a temp file and renamed only after a credential scan.

Jump to

Keyboard shortcuts

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