Help us shape the future of Go! Take the 2026 Go Developer Survey

test

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewAuthenticatedRegistryServer

func NewAuthenticatedRegistryServer(username, pass string) *httptest.Server

func NewRegistryServer

func NewRegistryServer() *httptest.Server

set up a local registry for testing scanning

func RegistryName

func RegistryName(srv *httptest.Server) string

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

type TagListHandler struct {
	RegistryHandler http.Handler
	Imagetags       map[string][]string
}

func (*TagListHandler) ServeHTTP

func (h *TagListHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TagListResult

type TagListResult struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

Jump to

Keyboard shortcuts

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