testing

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeIceServer

type FakeIceServer struct {
	// contains filtered or unexported fields
}

FakeIceServer is a test server that replicates an iCE registry server interface.

func NewFakeIceServer

func NewFakeIceServer() *FakeIceServer

NewFakeIceServer is a constructor that provides a reference to a FakeIceServer instance.

func (*FakeIceServer) Endpoint

func (s *FakeIceServer) Endpoint() string

Endpoint returns the URL of the test server. The test server picks a random port every time it starts.

func (*FakeIceServer) Handle

func (s *FakeIceServer) Handle(method, path string, handlerFunc HandlerFunc)

Handle registers a HandleFunc for requests directed to the provided path and HTTP verb.

func (*FakeIceServer) ServeHTTP

func (s *FakeIceServer) ServeHTTP(resp http.ResponseWriter, req *http.Request)

func (*FakeIceServer) Start

func (s *FakeIceServer) Start()

Start starts the test server.

func (*FakeIceServer) Stop

func (s *FakeIceServer) Stop()

Stop kills the connections to the test server and stops the server.

type HandlerFunc

type HandlerFunc func(resp http.ResponseWriter, req *http.Request)

HandlerFunc is the signature of any function used to handle HTTP requests in the test server.

Jump to

Keyboard shortcuts

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