Merge pull request #21 from george-e-shaw-iv/master

refactoring/following conventions/fixing packages/fixing architecture
This commit is contained in:
George Shaw 2017-10-23 14:49:23 -05:00 committed by GitHub
commit dd21044181
10 changed files with 18 additions and 18 deletions

14
main.go
View file

@ -4,21 +4,21 @@ import (
"log"
"net/http"
"github.com/Ennovar/gPanel/private_server"
"github.com/Ennovar/gPanel/public_server"
"github.com/Ennovar/gPanel/public"
"github.com/Ennovar/gPanel/webhost"
)
func main() {
private := private_server.NewPrivateHost()
public := public_server.NewPublicWeb()
webhost := webhost.NewPrivateHost()
public := public.NewPublicWeb()
log.Printf("To Exit: CTRL+C")
go func() {
log.Print("Listening (private) on localhost:2082, serving out of the private/ directory...")
http.ListenAndServe("localhost:2082", &private)
log.Print("Listening (private) on localhost:2082, serving out of the document_roots/webhost/ directory...")
http.ListenAndServe("localhost:2082", &webhost)
}()
log.Print("Listening (public) on localhost:3000, serving out of the public/ directory...")
log.Print("Listening (public) on localhost:3000, serving out of the document_roots/public/ directory...")
http.ListenAndServe("localhost:3000", &public)
}

View file

@ -5,7 +5,7 @@ import (
"log"
"strings"
"github.com/Ennovar/gPanel/general/networking"
"github.com/Ennovar/gPanel/pkg/networking"
)
const (

View file

@ -1,13 +1,13 @@
// Package public_server handles the logic of the public facing website
package public_server
// Package public handles the logic of the public facing website
package public
import (
"bufio"
"net/http"
"os"
"github.com/Ennovar/gPanel/general/logging"
"github.com/Ennovar/gPanel/general/routing"
"github.com/Ennovar/gPanel/pkg/logging"
"github.com/Ennovar/gPanel/pkg/routing"
)
type PublicWeb struct {
@ -17,7 +17,7 @@ type PublicWeb struct {
// NewPublicWeb returns a new PublicWeb type.
func NewPublicWeb() PublicWeb {
return PublicWeb{
Directory: "public/",
Directory: "document_roots/public/",
}
}

View file

@ -1,13 +1,13 @@
// Package private_server handles the logic of the private_server
package private_server
// Package webhost handles the logic of the webhosting panel
package webhost
import (
"bufio"
"net/http"
"os"
"github.com/Ennovar/gPanel/general/logging"
"github.com/Ennovar/gPanel/general/routing"
"github.com/Ennovar/gPanel/pkg/logging"
"github.com/Ennovar/gPanel/pkg/routing"
)
type PrivateHost struct {
@ -19,7 +19,7 @@ type PrivateHost struct {
func NewPrivateHost() PrivateHost {
return PrivateHost{
Auth: 1,
Directory: "private/",
Directory: "document_roots/webhost/",
}
}