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:
parent
6d48aa6630
commit
989cdd7da7
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/jackc/pgx/v4/pgxpool"
|
"github.com/jackc/pgx/v4/pgxpool"
|
||||||
|
|
||||||
"dev.tandem.ws/tandem/numerus/pkg/router"
|
numerus "dev.tandem.ws/tandem/numerus/pkg"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -23,7 +23,7 @@ func main() {
|
||||||
|
|
||||||
srv := http.Server{
|
srv := http.Server{
|
||||||
Addr: ":8080",
|
Addr: ":8080",
|
||||||
Handler: router.NewRouter(dbpool),
|
Handler: numerus.NewRouter(dbpool),
|
||||||
ReadTimeout: 5 * time.Second,
|
ReadTimeout: 5 * time.Second,
|
||||||
WriteTimeout: 10 * time.Second,
|
WriteTimeout: 10 * time.Second,
|
||||||
IdleTimeout: 2 * time.Minute,
|
IdleTimeout: 2 * time.Minute,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package logger
|
package pkg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
|
@ -1,4 +1,4 @@
|
||||||
package router
|
package pkg
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
@ -6,7 +6,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"dev.tandem.ws/tandem/numerus/pkg/logger"
|
|
||||||
"github.com/jackc/pgx/v4/pgxpool"
|
"github.com/jackc/pgx/v4/pgxpool"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -47,6 +46,6 @@ func NewRouter(db *pgxpool.Pool) http.Handler {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
var handler http.Handler = router
|
var handler http.Handler = router
|
||||||
handler = logger.Logger(handler)
|
handler = Logger(handler)
|
||||||
return handler
|
return handler
|
||||||
}
|
}
|
Loading…
Reference in New Issue