37 lines
703 B
Go
37 lines
703 B
Go
package router
|
|
|
|
import "io"
|
|
|
|
type RequestBuilder interface {
|
|
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 {
|
|
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 Prototype struct {
|
|
PrototypeRequestBuilder
|
|
PrototypeResponse
|
|
}
|