Documentation ¶
Index ¶
- func CreateTLSServer() (*httptest.Server, []byte, []byte, []byte, tls.Certificate, error)
- func LoadImages(srv *httptest.Server, imageName string, versions []string, ...) (string, error)
- func NewAuthenticatedRegistryServer(username, pass string) *httptest.Server
- func NewListener(t *testing.T) (net.Listener, string, int)
- func NewProxy(t *testing.T) (string, int)
- func NewRegistryServer() *httptest.Server
- func RegistryName(srv *httptest.Server) string
- type AuthHandler
- type TagListHandler
- type TagListResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTLSServer ¶ added in v0.25.0
func LoadImages ¶
func LoadImages(srv *httptest.Server, imageName string, versions []string, options ...remote.Option) (string, error)
LoadImages uploads images to the local registry, and returns the image repo name. https://github.com/google/go-containerregistry/blob/v0.1.1/pkg/registry/compatibility_test.go has an example of loading a test registry with a random image.
func NewListener ¶ added in v0.33.0
NewListener creates a TCP listener on a random port and returns the listener, the address and the port of this listener. It also registers a cleanup function to close the listener when the test ends.
func NewProxy ¶ added in v0.33.0
NewProxy creates a new goproxy server on a random port and returns the address and the port of this server. It also registers a cleanup functions to close the server and the listener when the test ends.
func NewRegistryServer ¶
set up a local registry for testing scanning
func RegistryName ¶
Get the registry part of an image from the registry server
Types ¶
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func (*AuthHandler) ServeHTTP ¶
func (h *AuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves a request which needs authentication.
type TagListHandler ¶
func (*TagListHandler) ServeHTTP ¶
func (h *TagListHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)