diff --git a/Makefile b/Makefile index 691cee26f0f96177726757456c7051c06313d2ac..b3035dd318684af32ecb80d457c66ff6e6e29127 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,10 @@ test: gotest gotest: go test -v --cover ./assets/... - go test -v --cover ./client/... go test -v --cover ./cmd/... - go test -v --cover ./models/... + go test -v --cover ./client/... go test -v --cover ./server/... - go test -v --cover ./utils/... + go test -v --cover ./pkg/... ci: go test -count=1 -p=1 -v ./tests/... diff --git a/client/admin.go b/client/admin.go index 52babe2353a262cceb81ccc972fa1c23cc0286e5..fdef060f3c1c7977b16bc04612242e0056e7eb60 100644 --- a/client/admin.go +++ b/client/admin.go @@ -21,7 +21,7 @@ import ( "time" "github.com/fatedier/frp/assets" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/gorilla/mux" ) diff --git a/client/admin_api.go b/client/admin_api.go index 14626736f4d0ad67c5658f722b5efa6430d2022f..3977df1f04d0c8536eb37d5b907aefdd8dd0e508 100644 --- a/client/admin_api.go +++ b/client/admin_api.go @@ -23,8 +23,8 @@ import ( "strings" "github.com/fatedier/frp/client/proxy" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/utils/log" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/util/log" ) type GeneralResponse struct { diff --git a/client/control.go b/client/control.go index 861c9777fb600550202253f0275631713852ab9c..c8ad7ed272d306b35f7e577ef197e22d13fcdddc 100644 --- a/client/control.go +++ b/client/control.go @@ -25,12 +25,12 @@ import ( "time" "github.com/fatedier/frp/client/proxy" - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/models/transport" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/transport" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/control/shutdown" "github.com/fatedier/golib/crypto" diff --git a/client/event/event.go b/client/event/event.go index 71d617336220ba0badac3131f9ede84ab4f3ec61..f97184488230309c03d3bcc7218735a966f7eb60 100644 --- a/client/event/event.go +++ b/client/event/event.go @@ -3,7 +3,7 @@ package event import ( "errors" - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/msg" ) type Type int diff --git a/client/health/health.go b/client/health/health.go index d2ae91037baff9b0becc73ad4c3688e9ed928e4f..5a7b3691c86e5ee239c8540af55912604ac2a6fc 100644 --- a/client/health/health.go +++ b/client/health/health.go @@ -24,7 +24,7 @@ import ( "net/http" "time" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/util/xlog" ) var ( diff --git a/client/proxy/proxy.go b/client/proxy/proxy.go index cb7d5177d8518ec53042bda7d5030d2f2459516b..3e97784aa01e02c6b731d591bb7ce6ce57e5d304 100644 --- a/client/proxy/proxy.go +++ b/client/proxy/proxy.go @@ -26,13 +26,13 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - plugin "github.com/fatedier/frp/models/plugin/client" - "github.com/fatedier/frp/models/proto/udp" - "github.com/fatedier/frp/utils/limit" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + plugin "github.com/fatedier/frp/pkg/plugin/client" + "github.com/fatedier/frp/pkg/proto/udp" + "github.com/fatedier/frp/pkg/util/limit" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/errors" frpIo "github.com/fatedier/golib/io" diff --git a/client/proxy/proxy_manager.go b/client/proxy/proxy_manager.go index 9a78f0f05ee8d01397120ad7f5c4c943e4fefced..98c17faa9842a0b556a8560dedaa9a22ee5d0aaf 100644 --- a/client/proxy/proxy_manager.go +++ b/client/proxy/proxy_manager.go @@ -7,9 +7,9 @@ import ( "sync" "github.com/fatedier/frp/client/event" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/errors" ) diff --git a/client/proxy/proxy_wrapper.go b/client/proxy/proxy_wrapper.go index b3b375e8bfcfc5387be97036932ccad4214d59d4..f1cd7659a07f633b67f76d15455ca04d63ea5703 100644 --- a/client/proxy/proxy_wrapper.go +++ b/client/proxy/proxy_wrapper.go @@ -10,9 +10,9 @@ import ( "github.com/fatedier/frp/client/event" "github.com/fatedier/frp/client/health" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/errors" ) diff --git a/client/service.go b/client/service.go index e6451ff1ccabc7ef40a207a7e10ff5162221db9f..f50391890a4a068084ddda8ea9f117616f0db1aa 100644 --- a/client/service.go +++ b/client/service.go @@ -18,7 +18,6 @@ import ( "context" "crypto/tls" "fmt" - "github.com/fatedier/frp/models/transport" "io/ioutil" "net" "runtime" @@ -27,13 +26,14 @@ import ( "time" "github.com/fatedier/frp/assets" - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/log" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/version" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/transport" + "github.com/fatedier/frp/pkg/util/log" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/version" + "github.com/fatedier/frp/pkg/util/xlog" fmux "github.com/hashicorp/yamux" ) diff --git a/client/visitor.go b/client/visitor.go index ce5625f0e957b287cb257d144964d4a36096eea7..85f6a153df68c4899dce7e3060e912d902c15309 100644 --- a/client/visitor.go +++ b/client/visitor.go @@ -24,12 +24,12 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/models/proto/udp" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/proto/udp" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/errors" frpIo "github.com/fatedier/golib/io" diff --git a/client/visitor_manager.go b/client/visitor_manager.go index ea32eac0f37de47a29e789d413e3c2c6e19ef97f..642b21e8f2f86810e729cd6831ba59c5a830300e 100644 --- a/client/visitor_manager.go +++ b/client/visitor_manager.go @@ -19,8 +19,8 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/util/xlog" ) type VisitorManager struct { diff --git a/cmd/frpc/sub/http.go b/cmd/frpc/sub/http.go index 801ac5b5cb824d3d599f8c8c82a0ebbd70513be6..d1286b2e9a9433552ef490c6fda7b7e26cbf5388 100644 --- a/cmd/frpc/sub/http.go +++ b/cmd/frpc/sub/http.go @@ -19,10 +19,10 @@ import ( "os" "strings" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/https.go b/cmd/frpc/sub/https.go index 0c01f55860de7d6cc5a82a08f494825eb87730d1..99a22953bd931903dde1c565f9f14add208f6c0e 100644 --- a/cmd/frpc/sub/https.go +++ b/cmd/frpc/sub/https.go @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" ) func init() { diff --git a/cmd/frpc/sub/reload.go b/cmd/frpc/sub/reload.go index f351475444a2255599579d6d29d5235b85d1eaa6..44b167704a0fd0966a6347c248a5b74f1e9a4f17 100644 --- a/cmd/frpc/sub/reload.go +++ b/cmd/frpc/sub/reload.go @@ -22,9 +22,9 @@ import ( "os" "strings" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" - "github.com/fatedier/frp/models/config" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/root.go b/cmd/frpc/sub/root.go index 4490476833b1669ab265a3f8d35632f0d36130ab..d84ce827c0c0bf5b0266115db98bab440ff61f95 100644 --- a/cmd/frpc/sub/root.go +++ b/cmd/frpc/sub/root.go @@ -25,13 +25,13 @@ import ( "syscall" "time" - "github.com/spf13/cobra" - "github.com/fatedier/frp/client" - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/version" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/version" + + "github.com/spf13/cobra" ) const ( diff --git a/cmd/frpc/sub/status.go b/cmd/frpc/sub/status.go index a9123f9ffc053ddba3bf69d3741d9db09973007e..774de53fca39afd43b9cf4f0d4c13a22961b3c1c 100644 --- a/cmd/frpc/sub/status.go +++ b/cmd/frpc/sub/status.go @@ -23,11 +23,11 @@ import ( "os" "strings" + "github.com/fatedier/frp/client" + "github.com/fatedier/frp/pkg/config" + "github.com/rodaine/table" "github.com/spf13/cobra" - - "github.com/fatedier/frp/client" - "github.com/fatedier/frp/models/config" ) func init() { diff --git a/cmd/frpc/sub/stcp.go b/cmd/frpc/sub/stcp.go index 24e881d45f57fb794fd439a76f413bee53152450..1b4ac0f11dabe4502a56eabe65568016e88536e8 100644 --- a/cmd/frpc/sub/stcp.go +++ b/cmd/frpc/sub/stcp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/sudp.go b/cmd/frpc/sub/sudp.go index 399a562788be141bcb7694c083add2dec8101893..d73067710c8478654a0e87f8b3783c7141e60e1f 100644 --- a/cmd/frpc/sub/sudp.go +++ b/cmd/frpc/sub/sudp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/tcp.go b/cmd/frpc/sub/tcp.go index ee30669c8cb2e40ffb8f5015fa1bed4a82f7ef84..e6f310fd08dca46f6bf9bd528cb611b097dce563 100644 --- a/cmd/frpc/sub/tcp.go +++ b/cmd/frpc/sub/tcp.go @@ -20,8 +20,8 @@ import ( "github.com/spf13/cobra" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" ) func init() { diff --git a/cmd/frpc/sub/tcpmux.go b/cmd/frpc/sub/tcpmux.go index 7a150949ef2cc93bbdd094c594b93a05bfd44116..065bf9c1e13c2d5d6c419c98464e3bcbaf7b12f1 100644 --- a/cmd/frpc/sub/tcpmux.go +++ b/cmd/frpc/sub/tcpmux.go @@ -21,8 +21,8 @@ import ( "github.com/spf13/cobra" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" ) func init() { diff --git a/cmd/frpc/sub/udp.go b/cmd/frpc/sub/udp.go index 01ff466cce775d80d5d102930704fb2783390742..c521996067d6f7d2d17a9e9186cbec0764bd98f1 100644 --- a/cmd/frpc/sub/udp.go +++ b/cmd/frpc/sub/udp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frpc/sub/xtcp.go b/cmd/frpc/sub/xtcp.go index 018cbf360615771a565f1d5e3b41047b05e71a1e..6e66f9532e602677d2e86721dfe3894891230e8f 100644 --- a/cmd/frpc/sub/xtcp.go +++ b/cmd/frpc/sub/xtcp.go @@ -18,10 +18,10 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" + "github.com/spf13/cobra" ) func init() { diff --git a/cmd/frps/main.go b/cmd/frps/main.go index 50be58628f2cfa5b6c0505b61d85a191bbb6ecd8..d95d8427c1ca5cdfad75a7ba2d9bdb96b7ac2d17 100644 --- a/cmd/frps/main.go +++ b/cmd/frps/main.go @@ -21,7 +21,7 @@ import ( "github.com/fatedier/golib/crypto" _ "github.com/fatedier/frp/assets/frps/statik" - _ "github.com/fatedier/frp/models/metrics" + _ "github.com/fatedier/frp/pkg/metrics" ) func main() { diff --git a/cmd/frps/root.go b/cmd/frps/root.go index b6fb362af3e5356a52b8609095503be400da1213..fb4fbd0221c77c0ecaedf6c7852d7fcad447be30 100644 --- a/cmd/frps/root.go +++ b/cmd/frps/root.go @@ -18,14 +18,14 @@ import ( "fmt" "os" - "github.com/spf13/cobra" - - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/version" "github.com/fatedier/frp/server" - "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/version" + + "github.com/spf13/cobra" ) const ( diff --git a/models/auth/auth.go b/pkg/auth/auth.go similarity index 98% rename from models/auth/auth.go rename to pkg/auth/auth.go index adbcb3d9ab96a361fda00d87bba4f29944c0f4dd..a77123fb3bbb027b2a4dda7ec32000f427c9e7a0 100644 --- a/models/auth/auth.go +++ b/pkg/auth/auth.go @@ -17,8 +17,8 @@ package auth import ( "fmt" - "github.com/fatedier/frp/models/consts" - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/consts" + "github.com/fatedier/frp/pkg/msg" "github.com/vaughan0/go-ini" ) diff --git a/models/auth/oidc.go b/pkg/auth/oidc.go similarity index 99% rename from models/auth/oidc.go rename to pkg/auth/oidc.go index 91c70be051491c84abc45430d0a9a631a614a28c..a1e791aa7f7328d4089536e2c867fa0f8f7fc6cb 100644 --- a/models/auth/oidc.go +++ b/pkg/auth/oidc.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/msg" "github.com/coreos/go-oidc" "github.com/vaughan0/go-ini" diff --git a/models/auth/token.go b/pkg/auth/token.go similarity index 97% rename from models/auth/token.go rename to pkg/auth/token.go index 4c680d74d5d920f8e7db8b2ed353d896a367a8ec..02faf2f960c5ec7d7d3063a19007e7a44399a2f1 100644 --- a/models/auth/token.go +++ b/pkg/auth/token.go @@ -18,8 +18,8 @@ import ( "fmt" "time" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/util" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/util/util" "github.com/vaughan0/go-ini" ) diff --git a/models/config/client_common.go b/pkg/config/client_common.go similarity index 99% rename from models/config/client_common.go rename to pkg/config/client_common.go index 505b988f0e72fe19246e5d4494dfde347e44431a..1af90746933b0b7822d7d8271c40b34de69d2d33 100644 --- a/models/config/client_common.go +++ b/pkg/config/client_common.go @@ -20,9 +20,9 @@ import ( "strconv" "strings" - ini "github.com/vaughan0/go-ini" + "github.com/fatedier/frp/pkg/auth" - "github.com/fatedier/frp/models/auth" + ini "github.com/vaughan0/go-ini" ) // ClientCommonConf contains information for a client service. It is diff --git a/models/config/proxy.go b/pkg/config/proxy.go similarity index 99% rename from models/config/proxy.go rename to pkg/config/proxy.go index 7c143a1a6f9ec221665aa375d31a041100f9443c..ad5b64b7c449c1c39468836b5f7fcf3d12974d9e 100644 --- a/models/config/proxy.go +++ b/pkg/config/proxy.go @@ -20,9 +20,9 @@ import ( "strconv" "strings" - "github.com/fatedier/frp/models/consts" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/util" + "github.com/fatedier/frp/pkg/consts" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/util/util" ini "github.com/vaughan0/go-ini" ) diff --git a/models/config/server_common.go b/pkg/config/server_common.go similarity index 99% rename from models/config/server_common.go rename to pkg/config/server_common.go index 1690aa0e78da064e8b7d025895fdc3a30ac9aec4..594ad31bfc1f11a5ca5fb9d0210920083d493024 100644 --- a/models/config/server_common.go +++ b/pkg/config/server_common.go @@ -19,11 +19,11 @@ import ( "strconv" "strings" - ini "github.com/vaughan0/go-ini" + "github.com/fatedier/frp/pkg/auth" + plugin "github.com/fatedier/frp/pkg/plugin/server" + "github.com/fatedier/frp/pkg/util/util" - "github.com/fatedier/frp/models/auth" - plugin "github.com/fatedier/frp/models/plugin/server" - "github.com/fatedier/frp/utils/util" + ini "github.com/vaughan0/go-ini" ) // ServerCommonConf contains information for a server service. It is diff --git a/models/config/types.go b/pkg/config/types.go similarity index 100% rename from models/config/types.go rename to pkg/config/types.go diff --git a/models/config/types_test.go b/pkg/config/types_test.go similarity index 100% rename from models/config/types_test.go rename to pkg/config/types_test.go diff --git a/models/config/value.go b/pkg/config/value.go similarity index 100% rename from models/config/value.go rename to pkg/config/value.go diff --git a/models/config/visitor.go b/pkg/config/visitor.go similarity index 99% rename from models/config/visitor.go rename to pkg/config/visitor.go index a35684107f454c7ad51f2a345b7fe1611654d70b..39958ea5c83bee1c20d7001c21f0ac5079f685fd 100644 --- a/models/config/visitor.go +++ b/pkg/config/visitor.go @@ -19,7 +19,7 @@ import ( "reflect" "strconv" - "github.com/fatedier/frp/models/consts" + "github.com/fatedier/frp/pkg/consts" ini "github.com/vaughan0/go-ini" ) diff --git a/models/consts/consts.go b/pkg/consts/consts.go similarity index 100% rename from models/consts/consts.go rename to pkg/consts/consts.go diff --git a/models/errors/errors.go b/pkg/errors/errors.go similarity index 100% rename from models/errors/errors.go rename to pkg/errors/errors.go diff --git a/models/metrics/aggregate/server.go b/pkg/metrics/aggregate/server.go similarity index 95% rename from models/metrics/aggregate/server.go rename to pkg/metrics/aggregate/server.go index 39549f97e81cc59c26879c1f784ff5a732ad7d6c..1ff15e42d0e74d37f36878ac35eb0f17f0190b24 100644 --- a/models/metrics/aggregate/server.go +++ b/pkg/metrics/aggregate/server.go @@ -15,8 +15,8 @@ package aggregate import ( - "github.com/fatedier/frp/models/metrics/mem" - "github.com/fatedier/frp/models/metrics/prometheus" + "github.com/fatedier/frp/pkg/metrics/mem" + "github.com/fatedier/frp/pkg/metrics/prometheus" "github.com/fatedier/frp/server/metrics" ) diff --git a/models/metrics/mem/server.go b/pkg/metrics/mem/server.go similarity index 98% rename from models/metrics/mem/server.go rename to pkg/metrics/mem/server.go index 307583ad55a08900f113cec3cd2b4da535ce28ae..f3c8559c3e38e2303554838085ee0aefeca1fab1 100644 --- a/models/metrics/mem/server.go +++ b/pkg/metrics/mem/server.go @@ -18,9 +18,9 @@ import ( "sync" "time" + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/metric" server "github.com/fatedier/frp/server/metrics" - "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/metric" ) var sm *serverMetrics = newServerMetrics() diff --git a/models/metrics/mem/types.go b/pkg/metrics/mem/types.go similarity index 97% rename from models/metrics/mem/types.go rename to pkg/metrics/mem/types.go index bdb1863dc177eb4cc72b5738fffd9091e3b3e6a5..2650b54b4a11c5034a473c895febdefdb0a2addb 100644 --- a/models/metrics/mem/types.go +++ b/pkg/metrics/mem/types.go @@ -17,7 +17,7 @@ package mem import ( "time" - "github.com/fatedier/frp/utils/metric" + "github.com/fatedier/frp/pkg/util/metric" ) const ( diff --git a/models/metrics/metrics.go b/pkg/metrics/metrics.go similarity index 68% rename from models/metrics/metrics.go rename to pkg/metrics/metrics.go index b9fb30847084c6eae8521974393e8407fc6fe7ba..6520317d8fd0556936132670f2a20f770c1b50d9 100644 --- a/models/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -1,7 +1,7 @@ package metrics import ( - "github.com/fatedier/frp/models/metrics/aggregate" + "github.com/fatedier/frp/pkg/metrics/aggregate" ) var EnableMem = aggregate.EnableMem diff --git a/models/metrics/prometheus/server.go b/pkg/metrics/prometheus/server.go similarity index 100% rename from models/metrics/prometheus/server.go rename to pkg/metrics/prometheus/server.go diff --git a/models/msg/ctl.go b/pkg/msg/ctl.go similarity index 100% rename from models/msg/ctl.go rename to pkg/msg/ctl.go diff --git a/models/msg/msg.go b/pkg/msg/msg.go similarity index 100% rename from models/msg/msg.go rename to pkg/msg/msg.go diff --git a/models/nathole/nathole.go b/pkg/nathole/nathole.go similarity index 97% rename from models/nathole/nathole.go rename to pkg/nathole/nathole.go index e44e149b598b62dc288255bdde784b379c6ac750..545ad7aa03578a7219277bd6dca8b854153fed3d 100644 --- a/models/nathole/nathole.go +++ b/pkg/nathole/nathole.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/util" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/golib/errors" "github.com/fatedier/golib/pool" diff --git a/models/plugin/client/http2https.go b/pkg/plugin/client/http2https.go similarity index 98% rename from models/plugin/client/http2https.go rename to pkg/plugin/client/http2https.go index 570b3f9c67053c9e308f45fd96bda682a681b1eb..ddf559ae5bed266b59f3fe268063bf956e72403b 100644 --- a/models/plugin/client/http2https.go +++ b/pkg/plugin/client/http2https.go @@ -23,7 +23,7 @@ import ( "net/http/httputil" "strings" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" ) const PluginHTTP2HTTPS = "http2https" diff --git a/models/plugin/client/http_proxy.go b/pkg/plugin/client/http_proxy.go similarity index 99% rename from models/plugin/client/http_proxy.go rename to pkg/plugin/client/http_proxy.go index 0860082086dcc73bf6c5156a9190f42d212bff1f..45bd3a9a792fe32043dafabdb7e5e1709ee6793a 100644 --- a/models/plugin/client/http_proxy.go +++ b/pkg/plugin/client/http_proxy.go @@ -22,7 +22,7 @@ import ( "net/http" "strings" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" frpIo "github.com/fatedier/golib/io" gnet "github.com/fatedier/golib/net" diff --git a/models/plugin/client/https2http.go b/pkg/plugin/client/https2http.go similarity index 98% rename from models/plugin/client/https2http.go rename to pkg/plugin/client/https2http.go index 093a74f4e52a0f695bf94dd425d43c74625206db..81806e39744c859ca5346a5d55ac70b507685f6f 100644 --- a/models/plugin/client/https2http.go +++ b/pkg/plugin/client/https2http.go @@ -23,7 +23,7 @@ import ( "net/http/httputil" "strings" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" ) const PluginHTTPS2HTTP = "https2http" diff --git a/models/plugin/client/plugin.go b/pkg/plugin/client/plugin.go similarity index 100% rename from models/plugin/client/plugin.go rename to pkg/plugin/client/plugin.go diff --git a/models/plugin/client/socks5.go b/pkg/plugin/client/socks5.go similarity index 97% rename from models/plugin/client/socks5.go rename to pkg/plugin/client/socks5.go index dc089345af0b679eecde6ced8139cf29dd882de4..79919e442197a5f0186701c47b97c7cf4ce91f62 100644 --- a/models/plugin/client/socks5.go +++ b/pkg/plugin/client/socks5.go @@ -20,7 +20,7 @@ import ( "log" "net" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" gosocks5 "github.com/armon/go-socks5" ) diff --git a/models/plugin/client/static_file.go b/pkg/plugin/client/static_file.go similarity index 97% rename from models/plugin/client/static_file.go rename to pkg/plugin/client/static_file.go index 668a0338316fb804c14a2e06238e7812d54d9675..1eeea3ba92ec45f6d339f76ea1bd5084da1f22da 100644 --- a/models/plugin/client/static_file.go +++ b/pkg/plugin/client/static_file.go @@ -19,7 +19,7 @@ import ( "net" "net/http" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/gorilla/mux" ) diff --git a/models/plugin/client/unix_domain_socket.go b/pkg/plugin/client/unix_domain_socket.go similarity index 100% rename from models/plugin/client/unix_domain_socket.go rename to pkg/plugin/client/unix_domain_socket.go diff --git a/models/plugin/server/http.go b/pkg/plugin/server/http.go similarity index 100% rename from models/plugin/server/http.go rename to pkg/plugin/server/http.go diff --git a/models/plugin/server/manager.go b/pkg/plugin/server/manager.go similarity index 98% rename from models/plugin/server/manager.go rename to pkg/plugin/server/manager.go index dd2b67f4f89373c7a66f66cacb079490c93b8e32..19c894b2c6754147f345d6448c06dbf4541d16fe 100644 --- a/models/plugin/server/manager.go +++ b/pkg/plugin/server/manager.go @@ -19,8 +19,8 @@ import ( "errors" "fmt" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/xlog" ) type Manager struct { diff --git a/models/plugin/server/plugin.go b/pkg/plugin/server/plugin.go similarity index 100% rename from models/plugin/server/plugin.go rename to pkg/plugin/server/plugin.go diff --git a/models/plugin/server/tracer.go b/pkg/plugin/server/tracer.go similarity index 100% rename from models/plugin/server/tracer.go rename to pkg/plugin/server/tracer.go diff --git a/models/plugin/server/types.go b/pkg/plugin/server/types.go similarity index 97% rename from models/plugin/server/types.go rename to pkg/plugin/server/types.go index 5667625bc416204b9082e8d95d270c0ccc4205cd..82d4032cb2a209f17aa32015981e38b76e46beb0 100644 --- a/models/plugin/server/types.go +++ b/pkg/plugin/server/types.go @@ -15,7 +15,7 @@ package plugin import ( - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/msg" ) type Request struct { diff --git a/models/proto/udp/udp.go b/pkg/proto/udp/udp.go similarity index 98% rename from models/proto/udp/udp.go rename to pkg/proto/udp/udp.go index 5a058964329e579deac4bb2983244238acf6055e..97f6ea4098f974b3dae414bb75f6d6b312f95178 100644 --- a/models/proto/udp/udp.go +++ b/pkg/proto/udp/udp.go @@ -20,7 +20,7 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/golib/errors" "github.com/fatedier/golib/pool" diff --git a/models/proto/udp/udp_test.go b/pkg/proto/udp/udp_test.go similarity index 100% rename from models/proto/udp/udp_test.go rename to pkg/proto/udp/udp_test.go diff --git a/models/transport/tls.go b/pkg/transport/tls.go similarity index 100% rename from models/transport/tls.go rename to pkg/transport/tls.go diff --git a/utils/limit/reader.go b/pkg/util/limit/reader.go similarity index 100% rename from utils/limit/reader.go rename to pkg/util/limit/reader.go diff --git a/utils/limit/writer.go b/pkg/util/limit/writer.go similarity index 100% rename from utils/limit/writer.go rename to pkg/util/limit/writer.go diff --git a/utils/log/log.go b/pkg/util/log/log.go similarity index 100% rename from utils/log/log.go rename to pkg/util/log/log.go diff --git a/utils/metric/counter.go b/pkg/util/metric/counter.go similarity index 100% rename from utils/metric/counter.go rename to pkg/util/metric/counter.go diff --git a/utils/metric/counter_test.go b/pkg/util/metric/counter_test.go similarity index 100% rename from utils/metric/counter_test.go rename to pkg/util/metric/counter_test.go diff --git a/utils/metric/date_counter.go b/pkg/util/metric/date_counter.go similarity index 100% rename from utils/metric/date_counter.go rename to pkg/util/metric/date_counter.go diff --git a/utils/metric/date_counter_test.go b/pkg/util/metric/date_counter_test.go similarity index 100% rename from utils/metric/date_counter_test.go rename to pkg/util/metric/date_counter_test.go diff --git a/utils/metric/metrics.go b/pkg/util/metric/metrics.go similarity index 100% rename from utils/metric/metrics.go rename to pkg/util/metric/metrics.go diff --git a/utils/net/conn.go b/pkg/util/net/conn.go similarity index 99% rename from utils/net/conn.go rename to pkg/util/net/conn.go index 4a122b0311ffa4326d4dab2fd4696a8f962bc389..5a33dd62e0abf4db272807c3fa88867b87b7d610 100644 --- a/utils/net/conn.go +++ b/pkg/util/net/conn.go @@ -24,7 +24,8 @@ import ( "sync/atomic" "time" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/util/xlog" + gnet "github.com/fatedier/golib/net" kcp "github.com/fatedier/kcp-go" ) diff --git a/utils/net/http.go b/pkg/util/net/http.go similarity index 100% rename from utils/net/http.go rename to pkg/util/net/http.go diff --git a/utils/net/kcp.go b/pkg/util/net/kcp.go similarity index 100% rename from utils/net/kcp.go rename to pkg/util/net/kcp.go diff --git a/utils/net/listener.go b/pkg/util/net/listener.go similarity index 100% rename from utils/net/listener.go rename to pkg/util/net/listener.go diff --git a/utils/net/tls.go b/pkg/util/net/tls.go similarity index 100% rename from utils/net/tls.go rename to pkg/util/net/tls.go diff --git a/utils/net/udp.go b/pkg/util/net/udp.go similarity index 100% rename from utils/net/udp.go rename to pkg/util/net/udp.go diff --git a/utils/net/websocket.go b/pkg/util/net/websocket.go similarity index 100% rename from utils/net/websocket.go rename to pkg/util/net/websocket.go diff --git a/utils/tcpmux/httpconnect.go b/pkg/util/tcpmux/httpconnect.go similarity index 95% rename from utils/tcpmux/httpconnect.go rename to pkg/util/tcpmux/httpconnect.go index 145d38a7bb3755f45d890a82d43de137b17e12f3..014f68812594efff78ad70abb13e40b26f1d2601 100644 --- a/utils/tcpmux/httpconnect.go +++ b/pkg/util/tcpmux/httpconnect.go @@ -22,8 +22,8 @@ import ( "net/http" "time" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/vhost" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/vhost" ) type HTTPConnectTCPMuxer struct { diff --git a/utils/util/http.go b/pkg/util/util/http.go similarity index 100% rename from utils/util/http.go rename to pkg/util/util/http.go diff --git a/utils/util/util.go b/pkg/util/util/util.go similarity index 100% rename from utils/util/util.go rename to pkg/util/util/util.go diff --git a/utils/util/util_test.go b/pkg/util/util/util_test.go similarity index 100% rename from utils/util/util_test.go rename to pkg/util/util/util_test.go diff --git a/utils/version/version.go b/pkg/util/version/version.go similarity index 100% rename from utils/version/version.go rename to pkg/util/version/version.go diff --git a/utils/version/version_test.go b/pkg/util/version/version_test.go similarity index 100% rename from utils/version/version_test.go rename to pkg/util/version/version_test.go diff --git a/utils/vhost/http.go b/pkg/util/vhost/http.go similarity index 98% rename from utils/vhost/http.go rename to pkg/util/vhost/http.go index 317596474e6afdbef45d2888f115b65116efe7f3..de105cbd9adc4a76dbb735464b6037bea12a91df 100644 --- a/utils/vhost/http.go +++ b/pkg/util/vhost/http.go @@ -25,8 +25,8 @@ import ( "strings" "time" - frpLog "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/util" + frpLog "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/util" "github.com/fatedier/golib/pool" ) diff --git a/utils/vhost/https.go b/pkg/util/vhost/https.go similarity index 100% rename from utils/vhost/https.go rename to pkg/util/vhost/https.go diff --git a/utils/vhost/resource.go b/pkg/util/vhost/resource.go similarity index 96% rename from utils/vhost/resource.go rename to pkg/util/vhost/resource.go index 5c084306b15993abfb40fe90c69f80f0916a110e..f89348ee0dbb5ace9a3880f47264c5defa845703 100644 --- a/utils/vhost/resource.go +++ b/pkg/util/vhost/resource.go @@ -19,8 +19,8 @@ import ( "io/ioutil" "net/http" - frpLog "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/version" + frpLog "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/version" ) var ( diff --git a/utils/vhost/reverseproxy.go b/pkg/util/vhost/reverseproxy.go similarity index 100% rename from utils/vhost/reverseproxy.go rename to pkg/util/vhost/reverseproxy.go diff --git a/utils/vhost/router.go b/pkg/util/vhost/router.go similarity index 100% rename from utils/vhost/router.go rename to pkg/util/vhost/router.go diff --git a/utils/vhost/vhost.go b/pkg/util/vhost/vhost.go similarity index 97% rename from utils/vhost/vhost.go rename to pkg/util/vhost/vhost.go index 363d0ea913df301dd44e8682ddb4a70c53d92baa..9049f28b1f4f21abc3fd47c90e551cd5879bf202 100644 --- a/utils/vhost/vhost.go +++ b/pkg/util/vhost/vhost.go @@ -19,9 +19,9 @@ import ( "strings" "time" - "github.com/fatedier/frp/utils/log" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/xlog" + "github.com/fatedier/frp/pkg/util/log" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/golib/errors" ) diff --git a/utils/xlog/ctx.go b/pkg/util/xlog/ctx.go similarity index 100% rename from utils/xlog/ctx.go rename to pkg/util/xlog/ctx.go diff --git a/utils/xlog/xlog.go b/pkg/util/xlog/xlog.go similarity index 97% rename from utils/xlog/xlog.go rename to pkg/util/xlog/xlog.go index a1c48672c066b0c7e806c49846d831e0cf3ad83b..b5746f9dfb89d22eae516d7acbab1cd5a37d2f31 100644 --- a/utils/xlog/xlog.go +++ b/pkg/util/xlog/xlog.go @@ -15,7 +15,7 @@ package xlog import ( - "github.com/fatedier/frp/utils/log" + "github.com/fatedier/frp/pkg/util/log" ) // Logger is not thread safety for operations on prefix diff --git a/server/control.go b/server/control.go index e148459bc60dcd37f4604a5b8f49715af3179965..ef470f521e0e7d38e31f065d5d84a835797618cd 100644 --- a/server/control.go +++ b/server/control.go @@ -23,18 +23,18 @@ import ( "sync" "time" - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" - frpErr "github.com/fatedier/frp/models/errors" - "github.com/fatedier/frp/models/msg" - plugin "github.com/fatedier/frp/models/plugin/server" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" + frpErr "github.com/fatedier/frp/pkg/errors" + "github.com/fatedier/frp/pkg/msg" + plugin "github.com/fatedier/frp/pkg/plugin/server" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/version" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/metrics" "github.com/fatedier/frp/server/proxy" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/version" - "github.com/fatedier/frp/utils/xlog" "github.com/fatedier/golib/control/shutdown" "github.com/fatedier/golib/crypto" diff --git a/server/controller/resource.go b/server/controller/resource.go index 6e128b8cf0b903973df32ea39f0557bd7fc5b58e..47236c9e0d079acadeb7af36d862b650014c4b99 100644 --- a/server/controller/resource.go +++ b/server/controller/resource.go @@ -15,13 +15,13 @@ package controller import ( - "github.com/fatedier/frp/models/nathole" - plugin "github.com/fatedier/frp/models/plugin/server" + "github.com/fatedier/frp/pkg/nathole" + plugin "github.com/fatedier/frp/pkg/plugin/server" + "github.com/fatedier/frp/pkg/util/tcpmux" + "github.com/fatedier/frp/pkg/util/vhost" "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" ) // All resource managers and controllers diff --git a/server/dashboard.go b/server/dashboard.go index 473f37e4d09818a96de80ad67213e41aa281a8f3..7af9df27bdd29e94d089ff98eb86ae17fe45aaeb 100644 --- a/server/dashboard.go +++ b/server/dashboard.go @@ -21,7 +21,7 @@ import ( "time" "github.com/fatedier/frp/assets" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus/promhttp" diff --git a/server/dashboard_api.go b/server/dashboard_api.go index e0b10ced4794e8e0dcddf497f1e2f21e708aa20c..210b6e3e9dcf22c318f4d2e3de880c080f41469f 100644 --- a/server/dashboard_api.go +++ b/server/dashboard_api.go @@ -18,11 +18,11 @@ import ( "encoding/json" "net/http" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" - "github.com/fatedier/frp/models/metrics/mem" - "github.com/fatedier/frp/utils/log" - "github.com/fatedier/frp/utils/version" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" + "github.com/fatedier/frp/pkg/metrics/mem" + "github.com/fatedier/frp/pkg/util/log" + "github.com/fatedier/frp/pkg/util/version" "github.com/gorilla/mux" ) diff --git a/server/group/http.go b/server/group/http.go index 90b8229232aa4aa19287b576546fa015198e1bed..0039b8aed4f8b841f2a9df1e0c2e2fe92ed0e75d 100644 --- a/server/group/http.go +++ b/server/group/http.go @@ -6,7 +6,7 @@ import ( "sync" "sync/atomic" - "github.com/fatedier/frp/utils/vhost" + "github.com/fatedier/frp/pkg/util/vhost" ) type HTTPGroupController struct { diff --git a/server/group/tcpmux.go b/server/group/tcpmux.go index 61058ca69039bae9ed7d770e60fd9ef3d913aed7..f2db8def3abceab548569639bad155200ceb413f 100644 --- a/server/group/tcpmux.go +++ b/server/group/tcpmux.go @@ -20,9 +20,9 @@ import ( "net" "sync" - "github.com/fatedier/frp/models/consts" - "github.com/fatedier/frp/utils/tcpmux" - "github.com/fatedier/frp/utils/vhost" + "github.com/fatedier/frp/pkg/consts" + "github.com/fatedier/frp/pkg/util/tcpmux" + "github.com/fatedier/frp/pkg/util/vhost" gerr "github.com/fatedier/golib/errors" ) diff --git a/server/proxy/http.go b/server/proxy/http.go index ce14388e113ee4ba41d8205d3f25d4fb929f04ea..869252814f89a9ecaabe35bcc9a6959bbc2b2342 100644 --- a/server/proxy/http.go +++ b/server/proxy/http.go @@ -19,11 +19,11 @@ import ( "net" "strings" - "github.com/fatedier/frp/models/config" + "github.com/fatedier/frp/pkg/config" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/vhost" "github.com/fatedier/frp/server/metrics" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/vhost" frpIo "github.com/fatedier/golib/io" ) diff --git a/server/proxy/https.go b/server/proxy/https.go index 4a1c999fce7a15e97278e8ea0bb4e3e7ead187e7..cd56646220106796e312e20aeb7b182bfaaf0e78 100644 --- a/server/proxy/https.go +++ b/server/proxy/https.go @@ -17,9 +17,9 @@ package proxy import ( "strings" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/vhost" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/vhost" ) type HTTPSProxy struct { diff --git a/server/proxy/proxy.go b/server/proxy/proxy.go index b82fce9ea28c02cc18ddacedf49cbfc462adcf8c..88c23763ddcadc861a867778f9d825d65889bc24 100644 --- a/server/proxy/proxy.go +++ b/server/proxy/proxy.go @@ -22,13 +22,13 @@ import ( "strconv" "sync" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - plugin "github.com/fatedier/frp/models/plugin/server" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + plugin "github.com/fatedier/frp/pkg/plugin/server" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/metrics" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/xlog" frpIo "github.com/fatedier/golib/io" ) diff --git a/server/proxy/stcp.go b/server/proxy/stcp.go index 44be1b39713612f90c5a946a3485eb4a038bbdfe..5ac47eaaca596f6159c6302c959c437c658dd41b 100644 --- a/server/proxy/stcp.go +++ b/server/proxy/stcp.go @@ -15,7 +15,7 @@ package proxy import ( - "github.com/fatedier/frp/models/config" + "github.com/fatedier/frp/pkg/config" ) type STCPProxy struct { diff --git a/server/proxy/sudp.go b/server/proxy/sudp.go index 182c792a5807b9d59eeacd8c24e0be002523bb79..c4dba6d663489f05c14ba65023849d07dd70af0b 100644 --- a/server/proxy/sudp.go +++ b/server/proxy/sudp.go @@ -15,7 +15,7 @@ package proxy import ( - "github.com/fatedier/frp/models/config" + "github.com/fatedier/frp/pkg/config" ) type SUDPProxy struct { diff --git a/server/proxy/tcp.go b/server/proxy/tcp.go index 786c1a5dbb0a23e694714dd6cc542c85b8ace673..420f43fe37ac61b00e849e05e3b24a4fe905ed70 100644 --- a/server/proxy/tcp.go +++ b/server/proxy/tcp.go @@ -18,7 +18,7 @@ import ( "fmt" "net" - "github.com/fatedier/frp/models/config" + "github.com/fatedier/frp/pkg/config" ) type TCPProxy struct { diff --git a/server/proxy/tcpmux.go b/server/proxy/tcpmux.go index d0da63be15f0b13e9bc642d3366ebfc152073a2f..16cbcff325ebbd8c0dc233c8dd130029dfbbbb88 100644 --- a/server/proxy/tcpmux.go +++ b/server/proxy/tcpmux.go @@ -19,10 +19,10 @@ import ( "net" "strings" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/consts" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/vhost" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/consts" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/vhost" ) type TCPMuxProxy struct { diff --git a/server/proxy/udp.go b/server/proxy/udp.go index d87e0efd62ed1594c142177a567b1d237641e088..0984265518c3251676769019fd2b7e15ee137881 100644 --- a/server/proxy/udp.go +++ b/server/proxy/udp.go @@ -21,11 +21,11 @@ import ( "net" "time" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/models/proto/udp" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/proto/udp" + frpNet "github.com/fatedier/frp/pkg/util/net" "github.com/fatedier/frp/server/metrics" - frpNet "github.com/fatedier/frp/utils/net" "github.com/fatedier/golib/errors" frpIo "github.com/fatedier/golib/io" diff --git a/server/proxy/xtcp.go b/server/proxy/xtcp.go index 8dbb881ae75d2bc478fb309af27f02463a7b1b0c..317a3d484c9413d4bf6a210fe7878353bf532b66 100644 --- a/server/proxy/xtcp.go +++ b/server/proxy/xtcp.go @@ -17,8 +17,8 @@ package proxy import ( "fmt" - "github.com/fatedier/frp/models/config" - "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/pkg/config" + "github.com/fatedier/frp/pkg/msg" "github.com/fatedier/golib/errors" ) diff --git a/server/service.go b/server/service.go index 3880d38291fae4dc6d308573390e23fbb73f7f49..0bbe9552962a1abf4eecc0e72711e411dab48140 100644 --- a/server/service.go +++ b/server/service.go @@ -26,26 +26,26 @@ import ( "time" "github.com/fatedier/frp/assets" - "github.com/fatedier/frp/models/auth" - "github.com/fatedier/frp/models/config" - modelmetrics "github.com/fatedier/frp/models/metrics" - "github.com/fatedier/frp/models/msg" - "github.com/fatedier/frp/models/nathole" - plugin "github.com/fatedier/frp/models/plugin/server" - "github.com/fatedier/frp/models/transport" + "github.com/fatedier/frp/pkg/auth" + "github.com/fatedier/frp/pkg/config" + modelmetrics "github.com/fatedier/frp/pkg/metrics" + "github.com/fatedier/frp/pkg/msg" + "github.com/fatedier/frp/pkg/nathole" + plugin "github.com/fatedier/frp/pkg/plugin/server" + "github.com/fatedier/frp/pkg/transport" + "github.com/fatedier/frp/pkg/util/log" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/tcpmux" + "github.com/fatedier/frp/pkg/util/util" + "github.com/fatedier/frp/pkg/util/version" + "github.com/fatedier/frp/pkg/util/vhost" + "github.com/fatedier/frp/pkg/util/xlog" "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/group" "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" - "github.com/fatedier/frp/utils/util" - "github.com/fatedier/frp/utils/version" - "github.com/fatedier/frp/utils/vhost" - "github.com/fatedier/frp/utils/xlog" "github.com/fatedier/golib/net/mux" fmux "github.com/hashicorp/yamux" diff --git a/server/visitor/visitor.go b/server/visitor/visitor.go index 7b54ab130b2cd8d36ed6bab973b4cdc21041e8fe..4796b416fbb2c095e6c0a86e6cfec1878ae793d5 100644 --- a/server/visitor/visitor.go +++ b/server/visitor/visitor.go @@ -20,8 +20,8 @@ import ( "net" "sync" - frpNet "github.com/fatedier/frp/utils/net" - "github.com/fatedier/frp/utils/util" + frpNet "github.com/fatedier/frp/pkg/util/net" + "github.com/fatedier/frp/pkg/util/util" frpIo "github.com/fatedier/golib/io" ) diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index 60d73c5a698007c703fb03e6c12774f539698dfa..ce830fdcbc23cab85ed63b7c8142e91661d32000 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -3,8 +3,8 @@ package e2e import ( "testing" + "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/test/e2e/framework" - "github.com/fatedier/frp/utils/log" "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index afe77c3d095988374c0dc7b20be6da7029e42017..ea0bfdfa5d6fa59e656fc080087a442c1cf93341 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -6,8 +6,8 @@ import ( "os" "testing" + "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/test/e2e/framework" - "github.com/fatedier/frp/utils/log" // test source _ "github.com/fatedier/frp/test/e2e/basic" diff --git a/test/e2e/framework/process.go b/test/e2e/framework/process.go index 5be4572e1e7d12474546b1c027cfa4015e53871b..1e477ee070dcfb256f7a18d36810a46bf544c5d6 100644 --- a/test/e2e/framework/process.go +++ b/test/e2e/framework/process.go @@ -6,8 +6,8 @@ import ( "path/filepath" "time" + flog "github.com/fatedier/frp/pkg/util/log" "github.com/fatedier/frp/test/e2e/pkg/process" - flog "github.com/fatedier/frp/utils/log" ) func GenerateConfigFile(path string, content string) error { diff --git a/test/e2e/mock/echoserver/echoserver.go b/test/e2e/mock/echoserver/echoserver.go index 9d51490ec469df41eccbbc5f36bb6c4c7cc3177f..09a2095403dfdd5d58e87f9027fcd0b2547bb653 100644 --- a/test/e2e/mock/echoserver/echoserver.go +++ b/test/e2e/mock/echoserver/echoserver.go @@ -5,7 +5,7 @@ import ( "net" "strings" - fnet "github.com/fatedier/frp/utils/net" + fnet "github.com/fatedier/frp/pkg/util/net" ) type ServerType string diff --git a/tests/mock/echo_server.go b/tests/mock/echo_server.go index ad49a5580517cfc219d3b7b8c28bb46da1e6eac4..20ee183110637b2242ef74292fa37541e023e8cc 100644 --- a/tests/mock/echo_server.go +++ b/tests/mock/echo_server.go @@ -7,7 +7,7 @@ import ( "os" "syscall" - frpNet "github.com/fatedier/frp/utils/net" + frpNet "github.com/fatedier/frp/pkg/util/net" ) type EchoServer struct {