core: format
This commit is contained in:
parent
0ed626e351
commit
0a5e329aa4
@ -30,33 +30,33 @@ func NewCore() *Core {
|
||||
// Get is a simple get router
|
||||
func (c *Core) Get(url string, handler ControllerHandler) {
|
||||
upperUrl := strings.ToUpper(url)
|
||||
if err := c.router["GET"].AddRouter(upperUrl, handler); err != nil{
|
||||
log.Println(err)
|
||||
}
|
||||
if err := c.router["GET"].AddRouter(upperUrl, handler); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Post is a simple post router
|
||||
func (c *Core) Post(url string, handler ControllerHandler) {
|
||||
upperUrl := strings.ToUpper(url)
|
||||
if err := c.router["POST"].AddRouter(upperUrl, handler); err != nil{
|
||||
log.Println(err)
|
||||
}
|
||||
if err := c.router["POST"].AddRouter(upperUrl, handler); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Put is a simple put router
|
||||
func (c *Core) Put(url string, handler ControllerHandler) {
|
||||
upperUrl := strings.ToUpper(url)
|
||||
if err := c.router["PUT"].AddRouter(upperUrl, handler); err != nil{
|
||||
log.Println(err)
|
||||
}
|
||||
if err := c.router["PUT"].AddRouter(upperUrl, handler); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete is a simple delete router
|
||||
func (c *Core) Delete(url string, handler ControllerHandler) {
|
||||
upperUrl := strings.ToUpper(url)
|
||||
if err := c.router["DELETE"].AddRouter(upperUrl, handler); err != nil{
|
||||
log.Println(err)
|
||||
}
|
||||
if err := c.router["DELETE"].AddRouter(upperUrl, handler); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
||||
// FindRouteByRequest finds route using the request
|
||||
|
Loading…
Reference in New Issue
Block a user