testutil

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: BSD-2-Clause, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expect

func Expect(t *testing.T, a interface{}, b interface{})

func NewTestingServer

func NewTestingServer(status int, body string) (*http.Server, func())

NewTestingServer - testing server and teardown func

func Refute

func Refute(t *testing.T, a interface{}, b interface{})

Types

type StoppableListener

type StoppableListener struct {
	net.Listener
	Stop      chan bool // Any message to this channel will gracefully stop the server
	Stopped   bool      // True if the server was stopped gracefully
	ConnCount counter   // Number of active client connections
}

StoppableListener - stoppable listener for testing purposes

func Handle

func Handle(l net.Listener) (sl *StoppableListener)

Handle - stoppable listener

func (*StoppableListener) Accept

func (sl *StoppableListener) Accept() (c net.Conn, err error)

Jump to

Keyboard shortcuts

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