chore: archi package du projet

This commit is contained in:
Laurent Drogou
2021-04-13 14:09:58 +02:00
parent 7544643cfb
commit 8cdf1ca15f
9 changed files with 126 additions and 97 deletions

11
main.go
View File

@@ -6,6 +6,7 @@ import (
"net/http"
"os"
"github.com/ldrogou/goauth20/routeserv"
"github.com/ldrogou/goauth20/store"
)
@@ -19,16 +20,16 @@ func main() {
}
func run() error {
srv := newServer()
srv.store = &store.DbStore{}
srv := routeserv.NewServer()
srv.Store = &store.DbStore{}
err := srv.store.Open()
err := srv.Store.Open()
if err != nil {
return err
}
defer srv.store.Close()
defer srv.Store.Close()
http.HandleFunc("/", srv.serveHTTP)
http.HandleFunc("/", srv.ServeHTTP)
port := 8090
log.Printf("servering http port %v", port)