router/prototype.go

42 lines
705 B
Go

package router
import "io"
type RequestBuilder interface {
Allowed(method string) ErrorResponse
Header(Header) ErrorResponse
Body(body io.ReadCloser) ErrorResponse
Values(values Values) ErrorResponse
}
type PrototypeRequestBuilder interface {
RequestBuilder() RequestBuilder
}
type Response interface {
Header() Header
Response() (body []byte)
}
type PrototypeResponse interface {
Response() Response
}
type ErrorResponse interface {
Ok() bool
HttpStatus() int
ErrorResponse() []byte
String() string
Error() string
}
type PrototypeErrorResponse interface {
ErrorResponse() ErrorResponse
}
type Prototype struct {
PrototypeRequestBuilder
PrototypeResponse
PrototypeErrorResponse
}