Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImposterHandler ¶
func ImposterHandler(imposter Imposter) http.HandlerFunc
ImposterHandler create specific handler for the received imposter
func MatcherBySchema ¶
func MatcherBySchema(imposter Imposter) mux.MatcherFunc
MatcherBySchema check if the request matching with the schema file
Types ¶
type Imposter ¶
type Imposter struct { BasePath string Request Request `json:"request"` Response Response `json:"response"` }
Imposter define an imposter structure
func (*Imposter) CalculateFilePath ¶
CalculateFilePath calculate file path based on basePath of imposter directory
type Request ¶
type Request struct { Method string `json:"method"` Endpoint string `json:"endpoint"` SchemaFile *string `json:"schemaFile"` Params *map[string]string `json:"params"` Headers *map[string]string `json:"headers"` }
Request represent the structure of real request
type Response ¶
type Response struct { Status int `json:"status"` Body string `json:"body"` BodyFile *string `json:"bodyFile"` Headers *map[string]string `json:"headers"` }
Response represent the structure of real response
Click to show internal directories.
Click to hide internal directories.