Documentation ¶
Overview ¶
Package fakeserver provides a fake HTTP server for testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeServer ¶
type FakeServer struct { // Reqs contain the requests made to the server, in order. Reqs []*http.Request // Resps will be returned in order when calls are made to the server. Resps []string // contains filtered or unexported fields }
FakeServer contains a fake HTTP server for testing.
func (*FakeServer) AddOnClose ¶
func (s *FakeServer) AddOnClose(f func())
AddOnClose adds a function to be run when Close() is called.
func (*FakeServer) Close ¶
func (s *FakeServer) Close()
Close closes the server and calls functions registered by AddOnClose()
func (*FakeServer) Reset ¶
func (s *FakeServer) Reset()
Reset resets the server's response to its default.
Click to show internal directories.
Click to hide internal directories.