Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTP ¶
type HTTP struct { }
HTTP is and adaptor beteewn the http and mock definition.
func (HTTP) BuildRequestDefinitionFromHTTP ¶
func (t HTTP) BuildRequestDefinitionFromHTTP(req *http.Request) definition.Request
BuildRequestDefinitionFromHTTP Read the request definition and return a mock request.
func (HTTP) WriteHTTPResponseFromDefinition ¶
func (t HTTP) WriteHTTPResponseFromDefinition(fr *definition.Response, w http.ResponseWriter)
WriteHTTPResponseFromDefinition read a mock response and write a http response.
type MessageTranslator ¶
type MessageTranslator interface { MockRequestBuilder MockResponseWriter }
MessageTranslator defines the translator contract between http and mock and viceversa. this translation decople the mock checker from the specific http implementation.
type MockRequestBuilder ¶
type MockRequestBuilder interface {
BuildRequestDefinitionFromHTTP(req *http.Request) definition.Request
}
MockRequestBuilder defines the translator from http.Request to definition.Request
type MockResponseWriter ¶
type MockResponseWriter interface {
WriteHTTPResponseFromDefinition(fr *definition.Response, w http.ResponseWriter)
}
MockResponseWriter defines the translator from definition.Response to http.ResponseWriter
Click to show internal directories.
Click to hide internal directories.