From dfbf9c4542102a8980e6d784dbb7e64224e25152 Mon Sep 17 00:00:00 2001 From: Tank Date: Sun, 24 May 2020 11:28:57 +0800 Subject: [PATCH] style: adjust frps files (#1820) --- server/controller/resource.go | 3 ++- server/service.go | 3 ++- server/{controller => visitor}/visitor.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) rename server/{controller => visitor}/visitor.go (99%) diff --git a/server/controller/resource.go b/server/controller/resource.go index b0c6ea2..98299d0 100644 --- a/server/controller/resource.go +++ b/server/controller/resource.go @@ -19,6 +19,7 @@ import ( plugin "github.com/fatedier/frp/models/plugin/server" "github.com/fatedier/frp/server/group" "github.com/fatedier/frp/server/ports" + "github.com/fatedier/frp/server/visitor" "github.com/fatedier/frp/utils/tcpmux" "github.com/fatedier/frp/utils/vhost" ) @@ -26,7 +27,7 @@ import ( // All resource managers and controllers type ResourceController struct { // Manage all visitor listeners - VisitorManager *VisitorManager + VisitorManager *visitor.VisitorManager // Tcp Group Controller TcpGroupCtl *group.TcpGroupCtl diff --git a/server/service.go b/server/service.go index 4f1c702..b9e3525 100644 --- a/server/service.go +++ b/server/service.go @@ -41,6 +41,7 @@ import ( "github.com/fatedier/frp/server/metrics" "github.com/fatedier/frp/server/ports" "github.com/fatedier/frp/server/proxy" + "github.com/fatedier/frp/server/visitor" "github.com/fatedier/frp/utils/log" frpNet "github.com/fatedier/frp/utils/net" "github.com/fatedier/frp/utils/tcpmux" @@ -104,7 +105,7 @@ func NewService(cfg config.ServerCommonConf) (svr *Service, err error) { pxyManager: proxy.NewProxyManager(), pluginManager: plugin.NewManager(), rc: &controller.ResourceController{ - VisitorManager: controller.NewVisitorManager(), + VisitorManager: visitor.NewVisitorManager(), TcpPortManager: ports.NewPortManager("tcp", cfg.ProxyBindAddr, cfg.AllowPorts), UdpPortManager: ports.NewPortManager("udp", cfg.ProxyBindAddr, cfg.AllowPorts), }, diff --git a/server/controller/visitor.go b/server/visitor/visitor.go similarity index 99% rename from server/controller/visitor.go rename to server/visitor/visitor.go index 22ff694..c055dd1 100644 --- a/server/controller/visitor.go +++ b/server/visitor/visitor.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package controller +package visitor import ( "fmt"