fixture

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 10 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 fixture builds synthetic images and indexes for tests, so lineage, staleness and query tests can describe a registry in a few lines instead of crawling one.

Index

Constants

This section is empty.

Variables

View Source
var Epoch = time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC)

Epoch is the reference time fixtures are created relative to.

Functions

func Created

func Created(img *model.Image, days int) *model.Image

Created sets the image's creation time to Epoch plus days.

func Digest

func Digest(name string) string

Digest returns a deterministic sha256 digest for name.

func Event

func Event(repo, tag, digest string, days int) model.TagEvent

Event records repo:tag pointing at digest at Epoch plus days.

func Image

func Image(name, repo string, layers ...string) *model.Image

Image builds a linux/amd64 image in repo whose layers are named by layers; equal names give equal diff IDs. name makes the digest unique.

func Label

func Label(img *model.Image, k, v string) *model.Image

Label sets a label on the image.

func Open

func Open(t testing.TB, b *store.Batch) *store.Store

Open returns an in-memory store holding batch, closed when the test ends.

func Org added in v0.2.0

func Org(n int) *store.Batch

Org builds a store batch of n images in a three-level organization: a few OS bases, language bases on each, and applications on those, spread over repos of ten tags each with one tag per image. Benchmarks use it to size refresh and queries without crawling.

func Tag

func Tag(img *model.Image, tag string, days int) model.Tag

Tag points repo:tag at the image, at Epoch plus days.

Types

This section is empty.

Jump to

Keyboard shortcuts

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