Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Middleware_type_code_encoding_map = map[MiddlewareType]string{ MiddlewareType_Unknown: "unknown", MiddlewareType_BeforeResponse: "before_response", }
Functions ¶
This section is empty.
Types ¶
type EndpointConfig ¶
type EndpointConfig struct {
Route string `json:"route"`
Method string `json:"method"`
Response EndpointConfigResponse `json:"response"`
ResponseStatusCode int `json:"response_status_code"`
ResponseIf []ResponseIf `json:"response_if"`
Headers map[string]string `json:"response_headers"`
HeadersBase map[string]string `json:"response_headers_base"`
}
type EndpointConfigResponse ¶
type EndpointConfigResponse []byte
func (*EndpointConfigResponse) UnmarshalJSON ¶
func (this *EndpointConfigResponse) UnmarshalJSON(data []byte) (err error)
type Endpoint_content_type ¶
type Endpoint_content_type int
const ( Endpoint_content_type_file Endpoint_content_type = iota Endpoint_content_type_shell Endpoint_content_type_exec Endpoint_content_type_fileserver Endpoint_content_type_json Endpoint_content_type_plaintext Endpoint_content_type_unknown )
type MiddlewareConfig ¶ added in v1.0.0
type MiddlewareConfig struct {
Exec string `json:"exec"`
Type MiddlewareType `json:"type"`
RouteMatch string `json:"route_match"`
Condition *Condition `json:"condition"`
}
type MiddlewareType ¶ added in v1.0.0
type MiddlewareType int
const ( MiddlewareType_Unknown MiddlewareType = iota MiddlewareType_BeforeResponse )
func (*MiddlewareType) UnmarshalJSON ¶ added in v1.0.0
func (this *MiddlewareType) UnmarshalJSON(data []byte) (err error)
type MockFs ¶
type MockFs interface {
StoreRequestRecord(requestRecord *RequestRecord, endpointConfig *EndpointConfig) error
GetRecordsMatchingRoute(route string) ([]RequestRecord, error)
RemoveAllRequestRecords() error
}
type ReadFileFunc ¶ added in v1.0.0
type RequestRecord ¶
type RequestRecord struct {
Route string `json:"route"`
Querystring string `json:"querystring"`
QuerystringParsed map[string]string `json:"querystring_parsed"`
Method string `json:"method"`
Host string `json:"host"`
Https bool `json:"https"`
Headers http.Header `json:"headers"`
Body *[]byte `json:"body"`
RouteParams map[string]string `json:"route_params"`
}
type ResponseIf ¶
type ResponseIf struct {
Response EndpointConfigResponse `json:"response"`
ResponseStatusCode int `json:"response_status_code"`
Condition *Condition `json:"condition"`
Headers map[string]string `json:"response_headers"`
}
Click to show internal directories.
Click to hide internal directories.