package router import "io" type RequestBuilder interface { Prototype() (req PrototypeRequestBuilder) Allowed(method string) (errRes ErrorResponse) Header(header Header) (errRes ErrorResponse) ReadBody(body io.ReadCloser) (errRes ErrorResponse) Values(values Values) (errRes ErrorResponse) } type PrototypeRequestBuilder interface { RequestBuilder() (req RequestBuilder) } type Response interface { Prototype() (req PrototypeResponse) Header() (header Header) BodyBytes() (body []byte) } type PrototypeResponse interface { Response() (res Response) } type ErrorResponse interface { Ok() (ok bool) HttpStatus() (code int) BodyBytes() (body []byte) String() (out string) Error() (out string) } type ErrorHandler interface { ErrorResponse ErrorResponse(errorResponse ErrorResponse) ErrorResponse } type Prototype struct { PrototypeRequestBuilder PrototypeResponse }