registrytest

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

func From(fsys fs.FS) (*txtar.Archive, error)

From constructs an Archive with the contents of fsys and an empty Comment. Subsequent changes to fsys are not reflected in the returned archive.

The transformation is lossy. For example, because directories are implicit in txtar archives, empty directories in fsys will be lost, and txtar does not represent file mode, mtime, or other file metadata. From does not guarantee that a.File[i].Data contains no file marker lines. See also warnings on Format. In short, it is unwise to use txtar as a generic filesystem serialization mechanism.

func TxtarFS

func TxtarFS(ar *txtar.Archive) fs.FS

TxtarFS returns an fs.FS which reads from a txtar.Archive.

Types

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New(fsys fs.FS, prefix string) (*Registry, error)

New starts a registry instance that serves modules found inside the _registry path inside fsys. It serves the OCI registry protocol. If prefix is non-empty, all module paths will be prefixed by that, separated by a slash (/).

Each module should be inside a directory named path_vers, where slashes in path have been replaced with underscores and should contain a cue.mod/module.cue file holding the module info.

The Registry should be closed after use.

func (*Registry) Close

func (r *Registry) Close()

func (*Registry) Host

func (r *Registry) Host() string

Host returns the hostname for the registry server; for example localhost:13455.

The connection can be assumed to be insecure.

Jump to

Keyboard shortcuts

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