snapshot

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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