testing

package
v0.0.0-...-1b7c243 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RegistryServer

type RegistryServer struct {
	Repos []Repository
	// contains filtered or unexported fields
}

func NewServer

func NewServer(bind string) (*RegistryServer, error)

NewServer returns a new instance of the fake server.

It receives the bind address (use 127.0.0.1:0 for getting an available port on the host)

func (*RegistryServer) AddRepo

func (s *RegistryServer) AddRepo(r Repository)

func (*RegistryServer) Addr

func (s *RegistryServer) Addr() string

Addr returns the Address of the server.

func (*RegistryServer) Reset

func (s *RegistryServer) Reset()

Reset resets all internal information of the server.

func (*RegistryServer) ServeHTTP

func (s *RegistryServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handler HTTP requests, dealing with prepared failures before dispatching the request to the proper internal handler.

func (*RegistryServer) SetStorageDelete

func (s *RegistryServer) SetStorageDelete(sd bool)

func (*RegistryServer) Stop

func (s *RegistryServer) Stop() error

Stop stops the server, cleaning the internal listener and freeing the allocated port.

type Repository

type Repository struct {
	Name string
	Tags map[string]string
}

Jump to

Keyboard shortcuts

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