Documentation
¶
Index ¶
- type Route
- type Router
- func (r *Router) Get(uri string, controller controller.Controller)
- func (r *Router) Post(uri string, controller controller.Controller)
- func (r *Router) Put(uri string, controller controller.Controller)
- func (r *Router) ServeHTTP(response http.ResponseWriter, request *http.Request)
- func (r *Router) StartAndServe(server Server) error
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
Route A route contains a method (GET), URI, and a controller
type Router ¶
type Router struct {
Container interface{}
Routes []Route
ErrorController controller.Controller
}
Router A router contains routes and links back to the application and implements the ServeHTTP interface
func (*Router) Get ¶
func (r *Router) Get(uri string, controller controller.Controller)
Get Create and add a new route into the router to handle a GET request
func (*Router) Post ¶
func (r *Router) Post(uri string, controller controller.Controller)
Post Create and add a new route into the router to handle a POST request
func (*Router) Put ¶
func (r *Router) Put(uri string, controller controller.Controller)
Put Create and add a new route into the router to handle a PUT request
func (*Router) ServeHTTP ¶
func (r *Router) ServeHTTP(response http.ResponseWriter, request *http.Request)
ServeHTTP Serve a given HTTP request
func (*Router) StartAndServe ¶
StartAndServe Start the HTTP server and listen for connections
Click to show internal directories.
Click to hide internal directories.