registrytest

package
v0.7.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthHandler

func AuthHandler(handler http.Handler, cfg *AuthConfig) http.Handler

AuthHandler wraps the given handler with logic that checks that the incoming requests fulfil the auth requirements defined in cfg. If cfg is nil or there are no auth requirements, it returns handler unchanged.

Types

type AuthConfig

type AuthConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthConfig specifies authorization requirements for the server. Currently it only supports basic auth.

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 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.

If there's a file named auth.json in the root directory, it will cause access to the server to be gated by the specified authorization. See the AuthConfig type for details.

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