go_httpfake

package module
v0.0.0-...-8d68a7d Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPFake

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

HTTPFake is the workhorse used to add, delete routes and to start a fake server

func New

func New() *HTTPFake

New return an instance of HTTPFake

func (*HTTPFake) AddRoute

func (h *HTTPFake) AddRoute(route string, method string, requestParams map[string]string, returnStatus int, returnBody string, returnHeaders map[string]string) bool

AddRoute is using to add a new route

func (*HTTPFake) Close

func (h *HTTPFake) Close()

Close is using to close a fake server

func (*HTTPFake) DelRoute

func (h *HTTPFake) DelRoute(route string, method string) bool

DelRoute is using to delete a route

func (*HTTPFake) Start

func (h *HTTPFake) Start() *httptest.Server

Start is using to start a new fake server

type RequestResponse

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

RequestResponse is the structure where routes are saving

Jump to

Keyboard shortcuts

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