Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
Name string `yaml:"name" json:"name" validate:"required"`
Path string `yaml:"path" json:"path" validate:"required,validHTTPPath"`
Method string `yaml:"method" json:"method" validate:"required,oneof=GET POST PUT PATCH DELETE OPTIONS HEAD"`
Request Request `yaml:"request" json:"request" validate:"dive"`
Response Response `yaml:"response" json:"response" validate:"required,dive"`
}
Mock is a struct for building endpoints for mocking
type Mocks ¶
type Mocks struct {
Mocks []Mock `yaml:"mocks" validate:"dive"`
}
Mocks is a slice of Mock
type Request ¶
type Request struct {
Headers map[string]string `yaml:"headers" json:"headers"`
QueryParams map[string]string `yaml:"query_params" json:"query_params"`
Cookies map[string]string `yaml:"cookies" json:"cookies"`
Body string `yaml:"body" json:"body"`
}
Request is the request for getting Response
type Response ¶
type Response struct {
Status int `yaml:"status" json:"status" validate:"required,min=100,max=599"`
Headers map[string]string `yaml:"headers" json:"headers"`
Cookies map[string]string `yaml:"cookies" json:"cookies"`
Body string `yaml:"body" json:"body"`
}
Response is the response for Request
Click to show internal directories.
Click to hide internal directories.