mock

package
v0.0.0-...-f24e808 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONData

type JSONData string

JSONData is aliased to string, to signal intent of usage

type MockedURL

type MockedURL string

MockedURL is aliased to string, to signal intent of usage

type Server

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

Server makes it possible to redirect remote http calls to local calls

func NewMockServer

func NewMockServer() *Server

NewMockServer returns a MockServer reading test data from json mock data

func (*Server) Close

func (ms *Server) Close()

Close closes the underlying http test server

func (*Server) SwitchHostAndScheme

func (ms *Server) SwitchHostAndScheme(sourceURL, data string) (string, error)

SwitchHostAndScheme informs the Server of an url to mock, provides it with the mocking data and returns the mocked url

Jump to

Keyboard shortcuts

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