httptestfixture

package module
v0.0.0-...-a4e273a Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONMocker

type JSONMocker struct {
	// contains filtered or unexported fields
}

func New

func New(path string) (*JSONMocker, error)

func (*JSONMocker) Server

func (jm *JSONMocker) Server(t *testing.T, fixtureName string) *httptest.Server

type Request

type Request struct {
	Path    string            `json:"path"`
	Method  string            `json:"method"`
	Headers map[string]string `json:"headers"`
}

type Response

type Response struct {
	Headers map[string]string      `json:"headers"`
	Status  int                    `json:"status"`
	Body    map[string]interface{} `json:"body"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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