registryfixture

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package registryfixture assembles the real server for registry protocol suites. Docker and Helm OCI use the same repository, auth and blob-signing boundary without importing root-package test helpers.

Role

Test support, outside the modules, for test/server/artifacts/docker and test/server/artifacts/helmoci.

Inputs

  • The production router from test/server/support/harness (app.NewRouter), an in-memory store and a file-system blob store, and the seeding of test/server/support.
  • Callbacks that adjust the server configuration once the stores and authentication are ready.

Outputs

  • World, from New: the router with the users reader, deployer and user; local, remote and virtual repositories; anonymous read access when asked for; and a blob store that signs download URLs for the storage route.

References

Status

Implemented P9b (issue 673).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type World

type World struct {
	T       *testing.T
	Handler http.Handler
	DB      *inmem.Store
	Blobs   blob.Store
}

World is the production router over an in-memory store and a file-system blob store, built by New for one test. Do sends requests to Handler; DB and Blobs let a test seed state or check what a request left behind. Blobs signs download URLs for the storage route, as a cloud blob store would.

func New

func New(t *testing.T, anonymous bool, tune ...harness.Tune) *World

New builds the same full-router item world used by the root registry tests. The tune callbacks run after stores and authentication are ready.

func (*World) Do

func (w *World) Do(method, path, as, body string, headers ...string) *httptest.ResponseRecorder

Do sends a request to the world's router as the user as, with the password "pw" over Basic, or without credentials when as is empty. headers are name and value pairs; a trailing name without a value is ignored.

func (*World) Item

func (w *World) Item(key string, cached bool, path string) artmodel.Item

Item returns the item at path in the repository key, from its remote cache when cached is true, and fails the test when the store has no such item or cannot read it.

Jump to

Keyboard shortcuts

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