mock

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IEndpoint

type IEndpoint interface {
	Reply() IReply
	CustomReply(handler func(reply IReply, request *http.Request)) IEndpoint
	CustomVerify(handler func(request *http.Request)) IEndpoint
	Once() IEndpoint
	Never() IEndpoint
	Times(count int) IEndpoint
	SetVerbose() IEndpoint
}

IEndpoint interface

type IReply

type IReply interface {
	JSONBody(body interface{}) IReply
	Content(content string) IReply
	Code(code int) IReply
	Header(key, value string) IReply
	RawBody(body []byte) IReply
	StringBody(body string) IReply
	XMLBody(body interface{}) IReply
	FullHeader(header map[string]string) IReply
	Delay(delayTime int) IReply
}

IReply interface

type IServer

type IServer interface {
	Start(port int)
	Stop(t *testing.T)
	Endpoint(name, method, path string) IEndpoint
	Verify(t *testing.T)
}

IServer interface

func CreateServer

func CreateServer(name string, defaultReply int, partialMockServerAddress string, log log.ILog) IServer

CreateServer creates the server

Jump to

Keyboard shortcuts

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