http

package
v0.0.0-...-20af522 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerDistributionHeaderName defines the header used by clients to verify if the
	// registry implements the OCI Distribution spec.
	DockerDistributionHeaderName = "Docker-Distribution-Api-Version"

	// DockerDistributionHeaderValue defines the value of
	// DockerDistributionHeaderName
	DockerDistributionHeaderValue = "registry/2.0"
)

Variables

This section is empty.

Functions

func Handler

func Handler(props *stori.HandlerProperties, opts *HandlerOpts) http.Handler

Handler returns an http.Handler for the Stori API.

func OCIHandler

func OCIHandler(props *stori.HandlerProperties) http.Handler

OCIHandler returns an http.Handler for the API. This can be used on its own to mount an OCI-compliant image registry within another web server.

func TestServer

func TestServer(tb testing.TB, reg *stori.Registry) (net.Listener, string)

TestServer returns a stori registry server.

Types

type HandlerOpts

type HandlerOpts struct {

	// TLSAuth if enabled, uses the Common Name of the certificate provided by
	// the client to authenticate the request.
	TLSAuth bool

	// Metrics if enable, configures the server to expose Prometheus metrics.
	Metrics bool
}

HandlerOpts defines what supplemental endpoints and middleware to add to the handler.

Jump to

Keyboard shortcuts

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