gallery

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package gallery enumerates all snapshot PNGs in a repository's working tree (subject to the configured globs). Unlike internal/gitscan, which is diff-driven, this walks the filesystem and returns every match — including unchanged files — so the gallery UI can browse the full baseline library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFor

func IDFor(path string) string

IDFor returns a stable, short, URL-safe id for a relative path. The same path always yields the same id, so bookmarks survive process restarts.

Types

type Item

type Item struct {
	ID   string            // short, URL-safe; stable across restarts
	Path string            // relative to repo root, slash-separated
	Axes map[string]string // from AxisRegex; empty if no match; nil if no regex
}

Item is one PNG screenshot in the gallery.

type Scanner

type Scanner struct {
	RepoDir   string
	Globs     []string
	AxisRegex *regexp.Regexp
}

Scanner enumerates Items.

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context) ([]Item, []string, error)

Scan walks RepoDir and returns one Item per PNG matching one of Globs. Files matching a glob whose bytes are not a PNG are skipped with a warning.

Jump to

Keyboard shortcuts

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