Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPTranslator ¶
type HTTPTranslator struct { }
HTTPTranslator is and adaptor beteewn the http and mock definition.
func (HTTPTranslator) BuildRequestDefinitionFromHTTP ¶
func (t HTTPTranslator) BuildRequestDefinitionFromHTTP(req *http.Request) definition.Request
BuildRequestDefinitionFromHTTP Read the request definition and return a mock request.
func (HTTPTranslator) WriteHTTPResponseFromDefinition ¶
func (t HTTPTranslator) 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 matcher 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.