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: 0

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