Move source file to the root of pkg

I do not yet know how i will need to organize them, if indeed i need to
organize them to a finer granularity than single files, so there is no
point on doing Java-like packages.
This commit is contained in:
jordi fita mas 2023-01-17 10:40:22 +01:00
parent 6d48aa6630
commit 989cdd7da7
3 changed files with 5 additions and 6 deletions

View File

@ -11,7 +11,7 @@ import (
"github.com/jackc/pgx/v4/pgxpool"
"dev.tandem.ws/tandem/numerus/pkg/router"
numerus "dev.tandem.ws/tandem/numerus/pkg"
)
func main() {
@ -23,7 +23,7 @@ func main() {
srv := http.Server{
Addr: ":8080",
Handler: router.NewRouter(dbpool),
Handler: numerus.NewRouter(dbpool),
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 2 * time.Minute,

View File

@ -1,4 +1,4 @@
package logger
package pkg
import (
"log"

View File

@ -1,4 +1,4 @@
package router
package pkg
import (
"context"
@ -6,7 +6,6 @@ import (
"log"
"net/http"
"dev.tandem.ws/tandem/numerus/pkg/logger"
"github.com/jackc/pgx/v4/pgxpool"
)
@ -47,6 +46,6 @@ func NewRouter(db *pgxpool.Pool) http.Handler {
}
})
var handler http.Handler = router
handler = logger.Logger(handler)
handler = Logger(handler)
return handler
}