apimock

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 4 Imported by: 0

README

http-api-mock

Go Report Card Godoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutedEndpointCall

type ExecutedEndpointCall struct {
	HttpMethod        string
	Path              string
	RequestBodyInJson string
	RequestHeaders    map[string][]string
}

type FakeApi

type FakeApi struct {
	ExecutedEndpointCalls []ExecutedEndpointCall
	HttpTestServer        *httptest.Server
}

func StartFakeAPIServer

func StartFakeAPIServer(t *testing.T, fakeEndpoints []*FakeEndpoint) *FakeApi

func (*FakeApi) AddExecutedEndpointCall

func (fakeApi *FakeApi) AddExecutedEndpointCall(item ExecutedEndpointCall) []ExecutedEndpointCall

type FakeEndpoint

type FakeEndpoint struct {
	HttpMethod   string
	Path         string
	ResponseJson string
	ResponseCode int
}

Jump to

Keyboard shortcuts

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