Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrResponseNotImplemented = errors.New("response type not implemented") ErrInvalidRouteResponseType = errors.New("invalid route response type") )
Functions ¶
Types ¶
type RouteDefinition ¶
type RouteDefinition struct { Path string Method string Response RouteResponse }
func NewRouteDefinition ¶
func NewRouteDefinition(path, method string, response RouteResponse) *RouteDefinition
type RouteResponse ¶
type RouteResponse struct { Type RouteResponseType StatusCode int Body string Headers map[string]string Delay time.Duration }
func NewRouteResponse ¶
func NewRouteResponse(t RouteResponseType, statusCode int, body string, headers map[string]string, delay time.Duration) *RouteResponse
func (RouteResponse) BuildResponse ¶
func (rr RouteResponse) BuildResponse(r *http.Request) (Result, error)
type RouteResponseType ¶
type RouteResponseType string
const ( RESPONSE_TYPE_STATIC RouteResponseType = "STATIC" RESPONSE_TYPE_DYNAMIC RouteResponseType = "DYNAMIC" )
func NewRouteResponseType ¶
func NewRouteResponseType(t string) (RouteResponseType, error)
func (RouteResponseType) String ¶
func (rr RouteResponseType) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.