mirror of
https://github.com/donl/gPanel.git
synced 2026-06-30 06:12:06 -06:00
export types PrivateHost and PublicWeb
golint specifically advises: "exported func NewPublicWeb returns unexported type public_server.publicWeb, which can be annoying to use"
This commit is contained in:
parent
86454f35d3
commit
03c97bfdfe
2 changed files with 8 additions and 8 deletions
|
|
@ -10,19 +10,19 @@ import (
|
|||
"github.com/Ennovar/gPanel/general/routing"
|
||||
)
|
||||
|
||||
type privateHost struct {
|
||||
type PrivateHost struct {
|
||||
Auth int
|
||||
Directory string
|
||||
}
|
||||
|
||||
func NewPrivateHost() privateHost {
|
||||
return privateHost{
|
||||
func NewPrivateHost() PrivateHost {
|
||||
return PrivateHost{
|
||||
Auth: 1,
|
||||
Directory: "private/",
|
||||
}
|
||||
}
|
||||
|
||||
func (priv *privateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func (priv *PrivateHost) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path[1:]
|
||||
path = (priv.Directory + path)
|
||||
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@ import (
|
|||
"github.com/Ennovar/gPanel/general/routing"
|
||||
)
|
||||
|
||||
type publicWeb struct {
|
||||
type PublicWeb struct {
|
||||
Directory string
|
||||
}
|
||||
|
||||
func NewPublicWeb() publicWeb {
|
||||
return publicWeb{
|
||||
func NewPublicWeb() PublicWeb {
|
||||
return PublicWeb{
|
||||
Directory: "public/",
|
||||
}
|
||||
}
|
||||
|
||||
func (pub *publicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
func (pub *PublicWeb) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
path := req.URL.Path[1:]
|
||||
path = (pub.Directory + path)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue