Documentation
¶
Index ¶
Constants ¶
View Source
const ( EndpointTypeNormal = "normal" EndpointTypeRegex = "regex" ContextKeyReqBody = "requestBody" ContextKeyResBody = "responseBody" )
Variables ¶
View Source
var (
ErrEndpointNotFound = fmt.Errorf("no matching endpoint found")
)
Functions ¶
Types ¶
type Config ¶
type Config struct { ListenIP string `json:"listen_ip"` ListenPort int `json:"listen_port"` ProxyPass string `json:"proxy_pass"` Endpoints []Endpoint `json:"endpoints"` Logging Logging `json:"logging"` }
func OpenConfigFile ¶
type MockHandler ¶
func (MockHandler) MatchEndpoint ¶
func (s MockHandler) MatchEndpoint(r *http.Request) (Endpoint, error)
func (MockHandler) RenderTemplateResponse ¶
func (MockHandler) ServeHTTP ¶
func (s MockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (MockHandler) ValidateConfig ¶
func (s MockHandler) ValidateConfig() error
Click to show internal directories.
Click to hide internal directories.