ociregistry

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) string

BasicAuth generates the Authorization header for basic auth with the given username and password.

Types

type Server

type Server struct {
	// Upstream is the partial url for the upstream, for instance, https://hub.docker.io
	Upstream string

	// Logger is the hclog Logger to log with.
	Logger hclog.Logger

	// AuthConfig is used to authenticate with the target repository
	AuthConfig authn.AuthConfig

	// Indicates that the entrypoint should not be pulled into the image.
	DisableEntrypoint bool
	// contains filtered or unexported fields
}

Server is an http.Handler that provides an OCI registry proxy. The proxy can inject the waypoint entrypoint directly into the image as it passes through the proxy.

func (*Server) FetchBlob

func (s *Server) FetchBlob(name string, id string) ([]byte, error)

FetchBlob will read a blob in the OCI digest format from the upstream repo.

func (*Server) Negotiate

func (s *Server) Negotiate(repo string) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) SetupEntrypointLayer

func (s *Server) SetupEntrypointLayer(name string, epData []byte) error

SetupEntrypointLayer should be called before the server is in use. This will write the entrypoint as a layer into the upstream, so that it doesn't have to be written while attempting to update the manifest. The entrypoint could be large and writing it mid-manifest update could cause a timeout on the client side.

Jump to

Keyboard shortcuts

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