Skip to content

Commit

Permalink
QuackPipe
Browse files Browse the repository at this point in the history
architecture for quackpipe.
  • Loading branch information
afzalabbasi committed Jul 22, 2024
1 parent 1a7a94e commit 5f0ec47
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"os"
"quackpipe/model"
"quackpipe/route"
"quackpipe/router"
"quackpipe/utils"
)

Expand Down Expand Up @@ -45,7 +45,7 @@ func main() {
}

} else {
r := route.NewRouter(appFlags)
r := router.NewRouter(appFlags)
fmt.Printf("QuackPipe API Running: %s:%s\n", *appFlags.Host, *appFlags.Port)
if err := http.ListenAndServe(*appFlags.Host+":"+*appFlags.Port, r); err != nil {
panic(err)
Expand Down
6 changes: 3 additions & 3 deletions route/rootRouter.go → router/apiRouter.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package route
package router

import (
"github.com/gorilla/mux"
handlers "quackpipe/handler"
"quackpipe/model"
)

// RootHandler function for the root endpoint
func RootHandler(router *mux.Router, FlagInformation *model.CommandLineFlags) handlers.Handler {
// APIHandler function for the root endpoint
func APIHandler(router *mux.Router, FlagInformation *model.CommandLineFlags) handlers.Handler {
HandlerInfo := handlers.Handler{FlagInformation: FlagInformation}
router.HandleFunc("/", HandlerInfo.Handlers).Methods("POST", "GET")
return HandlerInfo
Expand Down
4 changes: 2 additions & 2 deletions route/route.go → router/route.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package route
package router

import (
"github.com/gorilla/mux"
Expand All @@ -8,6 +8,6 @@ import (
func NewRouter(flagInformation *model.CommandLineFlags) *mux.Router {
router := mux.NewRouter()
// Register module routes
RootHandler(router, flagInformation)
APIHandler(router, flagInformation)
return router
}

0 comments on commit 5f0ec47

Please sign in to comment.