Documentation
¶
Index ¶
- Variables
- func BuildVars(state *types.State, responseStatusCode int, requestRecord *types.RequestRecord, ...) (map[string]string, error)
- func ExtractHeadersFromFile(filePath string, readFile types.ReadFileFunc) (map[string]string, error)
- func ParseAssertRequest(req *http.Request) (*AssertOptions, error)
- func Validate(mockFs types.MockFs, assertOptions *AssertOptions) (*[]ValidationError, error)
- func VerifyCondition(requestRecord *types.RequestRecord, condition *Condition, ...) bool
- type EndpointConfigError
- type EndpointConfigErrorCode
- type ExecFunc
- type ExecOptions
- type ExecResult
- type HandlerFiles
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrResponseFileDoesNotExist = errors.New("ErrResponseFileDoesNotExist")
Functions ¶
func ExtractHeadersFromFile ¶ added in v1.4.0
func ParseAssertRequest ¶
func VerifyCondition ¶ added in v1.1.0
func VerifyCondition(requestRecord *types.RequestRecord, condition *Condition, requestRecords []types.RequestRecord) bool
Types ¶
type EndpointConfigError ¶
type EndpointConfigError struct {
Code EndpointConfigErrorCode
EndpointIndex int
Metadata map[string]string
}
func ValidateEndpointConfigs ¶
func ValidateEndpointConfigs( endpointConfigs []types.EndpointConfig, readFile types.ReadFileFunc, configDirPath string, ) ([]EndpointConfigError, error)
type EndpointConfigErrorCode ¶
type EndpointConfigErrorCode int
const ( EndpointConfigErrorCode_Unknown EndpointConfigErrorCode = iota EndpointConfigErrorCode_EndpointDuplicate EndpointConfigErrorCode_FileUnreadable EndpointConfigErrorCode_InvalidMethod EndpointConfigErrorCode_RouteWithQuerystring )
type ExecFunc ¶ added in v0.2.0
type ExecFunc = func(command string, options *ExecOptions) (*ExecResult, error)
type ExecOptions ¶ added in v1.0.0
type ExecResult ¶ added in v0.2.0
type ExecResult struct {
Output []byte
}
type HandlerFiles ¶ added in v1.4.4
type HandlerFiles struct {
Headers string
Body string
ResponseBody string
ResponseHeaders string
ResponseStatusCode string
}
func BuildHandlerFiles ¶ added in v1.4.4
type Response ¶
type Response struct {
Body []byte
EndpointContentType types.Endpoint_content_type
StatusCode int
Headers map[string]string
}
func ResolveEndpointResponse ¶
func ResolveEndpointResponse( readFile types.ReadFileFunc, exec ExecFunc, requestBody []byte, state *types.State, endpointConfig *types.EndpointConfig, envVars map[string]string, endpointParams map[string]string, requestRecord *types.RequestRecord, requestRecords []types.RequestRecord, baseApi string, cache map[string]string, ) (*Response, map[string]string, error)
Click to show internal directories.
Click to hide internal directories.