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