test

package
v0.31.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTLSServer added in v0.25.0

func CreateTLSServer() (*httptest.Server, []byte, []byte, []byte, tls.Certificate, error)

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