mirror of
https://github.com/donl/gPanel.git
synced 2026-06-30 06:12:06 -06:00
refactoring/following conventions/fixing packages/fixing architecture
This commit is contained in:
parent
21275c8606
commit
1f276ec5ae
10 changed files with 18 additions and 18 deletions
14
main.go
14
main.go
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/Ennovar/gPanel/general/networking"
|
||||
"github.com/Ennovar/gPanel/pkg/networking"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -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/",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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/",
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue