registry

package
v0.0.0-...-08a0481 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadGateway = &Error{http.StatusBadGateway}

ErrBadGateway signals an unexpected upstream error.

View Source
var ErrGatewayTimeout = &Error{http.StatusGatewayTimeout}

ErrGatewayTimeout signals the remote registry did not respond before the timeout duration.

View Source
var ErrNotFound = &Error{http.StatusNotFound}

ErrNotFound signals a package and version combination is not found.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Archive writes a zip archive of the package contents at path to out.
	Archive(name, version, path string, out io.Writer) (err error)
	// Directory reads files and sub-directories at the given path.
	Directory(name, version, path string) (dirs, files []string, err error)
	// Download writes a package's contents to a temporary directory and returns its path.
	Download(name, version string) (dir string, err error)
	// File reads a file's contents at the given path.
	File(name, version, path string) (file string, err error)
	// Versions fetches all package versions from the registry.
	Versions(name string) (versions []string, latest string, err error)
}

Client defines the required interface for a registry.

type Error

type Error struct {
	StatusCode int
}

Error indicates the appropriate status code return to the user.

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface and provides a short description of the error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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