diff --git a/internal/apps/log_writer.go b/internal/apps/log_writer.go index 4949d2b..9a78272 100644 --- a/internal/apps/log_writer.go +++ b/internal/apps/log_writer.go @@ -1,8 +1,8 @@ package apps import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/files" timeutil "github.com/iwind/TeaGo/utils/time" diff --git a/internal/caches/item_test.go b/internal/caches/item_test.go index 1d0947a..27d24e8 100644 --- a/internal/caches/item_test.go +++ b/internal/caches/item_test.go @@ -7,7 +7,7 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/caches" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/rands" "github.com/iwind/TeaGo/types" "runtime" diff --git a/internal/caches/list_file_hash_map_sqlite.go b/internal/caches/list_file_hash_map_sqlite.go index b8d4792..fd0c2d7 100644 --- a/internal/caches/list_file_hash_map_sqlite.go +++ b/internal/caches/list_file_hash_map_sqlite.go @@ -4,7 +4,7 @@ package caches import ( memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "math/big" "sync" ) diff --git a/internal/caches/list_file_hash_map_sqlite_test.go b/internal/caches/list_file_hash_map_sqlite_test.go index 96f3219..b737f2f 100644 --- a/internal/caches/list_file_hash_map_sqlite_test.go +++ b/internal/caches/list_file_hash_map_sqlite_test.go @@ -5,7 +5,7 @@ package caches_test import ( "github.com/TeaOSLab/EdgeNode/internal/caches" "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/assert" "github.com/iwind/TeaGo/rands" diff --git a/internal/caches/list_file_kv.go b/internal/caches/list_file_kv.go index 57a9455..8d27403 100644 --- a/internal/caches/list_file_kv.go +++ b/internal/caches/list_file_kv.go @@ -4,10 +4,10 @@ package caches import ( "fmt" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" "github.com/TeaOSLab/EdgeNode/internal/utils/fnv" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "github.com/TeaOSLab/EdgeNode/internal/utils/ttlcache" "github.com/iwind/TeaGo/types" diff --git a/internal/caches/list_file_sqlite.go b/internal/caches/list_file_sqlite.go index 2b880b1..62f27d7 100644 --- a/internal/caches/list_file_sqlite.go +++ b/internal/caches/list_file_sqlite.go @@ -5,14 +5,14 @@ package caches import ( "database/sql" "errors" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils/dbs" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" "github.com/TeaOSLab/EdgeNode/internal/utils/fnv" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/ttlcache" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/types" "os" "strings" diff --git a/internal/caches/list_file_sqlite_test.go b/internal/caches/list_file_sqlite_test.go index 7e53985..95b4ecd 100644 --- a/internal/caches/list_file_sqlite_test.go +++ b/internal/caches/list_file_sqlite_test.go @@ -4,7 +4,7 @@ package caches_test import ( "github.com/TeaOSLab/EdgeNode/internal/caches" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/rands" diff --git a/internal/caches/open_file_cache.go b/internal/caches/open_file_cache.go index 5872a5f..86e67ab 100644 --- a/internal/caches/open_file_cache.go +++ b/internal/caches/open_file_cache.go @@ -4,7 +4,7 @@ package caches import ( "fmt" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/linkedlist" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "github.com/fsnotify/fsnotify" diff --git a/internal/caches/partial_ranges_queue.go b/internal/caches/partial_ranges_queue.go index 3e12a2a..a13cfc2 100644 --- a/internal/caches/partial_ranges_queue.go +++ b/internal/caches/partial_ranges_queue.go @@ -4,10 +4,10 @@ package caches import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils/fnv" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "sync" ) diff --git a/internal/caches/storage_file.go b/internal/caches/storage_file.go index daf8c41..321887b 100644 --- a/internal/caches/storage_file.go +++ b/internal/caches/storage_file.go @@ -10,16 +10,16 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/TeaOSLab/EdgeNode/internal/utils/bytepool" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" setutils "github.com/TeaOSLab/EdgeNode/internal/utils/sets" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/rands" "github.com/iwind/TeaGo/types" diff --git a/internal/caches/storage_memory.go b/internal/caches/storage_memory.go index 5d14150..fbc0160 100644 --- a/internal/caches/storage_memory.go +++ b/internal/caches/storage_memory.go @@ -3,15 +3,15 @@ package caches import ( "fmt" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" setutils "github.com/TeaOSLab/EdgeNode/internal/utils/sets" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/cespare/xxhash/v2" "github.com/iwind/TeaGo/types" "math" diff --git a/internal/compressions/writer_pool.go b/internal/compressions/writer_pool.go index 0848af5..21216cf 100644 --- a/internal/compressions/writer_pool.go +++ b/internal/compressions/writer_pool.go @@ -4,7 +4,7 @@ package compressions import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "io" "time" ) diff --git a/internal/encrypt/magic_key_test.go b/internal/encrypt/magic_key_test.go deleted file mode 100644 index 2d182de..0000000 --- a/internal/encrypt/magic_key_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package encrypt - -import "testing" - -func TestMagicKeyEncode(t *testing.T) { - dst := MagicKeyEncode([]byte("Hello,World")) - t.Log("dst:", string(dst)) - - src := MagicKeyDecode(dst) - t.Log("src:", string(src)) -} diff --git a/internal/encrypt/method_utils_test.go b/internal/encrypt/method_utils_test.go deleted file mode 100644 index faf7e1d..0000000 --- a/internal/encrypt/method_utils_test.go +++ /dev/null @@ -1,8 +0,0 @@ -package encrypt - -import "testing" - -func TestFindMethodInstance(t *testing.T) { - t.Log(NewMethodInstance("a", "b", "")) - t.Log(NewMethodInstance("aes-256-cfb", "123456", "")) -} diff --git a/internal/firewalls/ddos_protection.go b/internal/firewalls/ddos_protection.go index 5fbb8b0..9739d04 100644 --- a/internal/firewalls/ddos_protection.go +++ b/internal/firewalls/ddos_protection.go @@ -16,7 +16,7 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/types" stringutil "github.com/iwind/TeaGo/utils/string" diff --git a/internal/firewalls/firewall_firewalld.go b/internal/firewalls/firewall_firewalld.go index b5c4d85..e210482 100644 --- a/internal/firewalls/firewall_firewalld.go +++ b/internal/firewalls/firewall_firewalld.go @@ -5,9 +5,9 @@ package firewalls import ( "fmt" "github.com/TeaOSLab/EdgeNode/internal/conns" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/types" "strings" "time" diff --git a/internal/firewalls/firewall_nftables.go b/internal/firewalls/firewall_nftables.go index b4c9fc0..d408bb8 100644 --- a/internal/firewalls/firewall_nftables.go +++ b/internal/firewalls/firewall_nftables.go @@ -11,9 +11,9 @@ import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" "github.com/TeaOSLab/EdgeNode/internal/firewalls/nftables" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/google/nftables/expr" "github.com/iwind/TeaGo/types" "net" diff --git a/internal/firewalls/nftables/installer.go b/internal/firewalls/nftables/installer.go index f37a600..bbf0e8b 100644 --- a/internal/firewalls/nftables/installer.go +++ b/internal/firewalls/nftables/installer.go @@ -8,9 +8,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/logs" "os" "runtime" diff --git a/internal/iplibrary/ip_list_kv.go b/internal/iplibrary/ip_list_kv.go index b4da32f..d8fa891 100644 --- a/internal/iplibrary/ip_list_kv.go +++ b/internal/iplibrary/ip_list_kv.go @@ -7,9 +7,9 @@ import ( "errors" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" "github.com/TeaOSLab/EdgeNode/internal/utils/kvstore" "testing" diff --git a/internal/iplibrary/ip_list_kv_test.go b/internal/iplibrary/ip_list_kv_test.go index a70800c..97ac803 100644 --- a/internal/iplibrary/ip_list_kv_test.go +++ b/internal/iplibrary/ip_list_kv_test.go @@ -7,7 +7,7 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/iplibrary" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "testing" "time" ) diff --git a/internal/iplibrary/ip_list_sqlite.go b/internal/iplibrary/ip_list_sqlite.go index ed94821..0eb0727 100644 --- a/internal/iplibrary/ip_list_sqlite.go +++ b/internal/iplibrary/ip_list_sqlite.go @@ -5,9 +5,9 @@ package iplibrary import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils/dbs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" "github.com/iwind/TeaGo/Tea" "os" diff --git a/internal/iplibrary/manager_ip_list.go b/internal/iplibrary/manager_ip_list.go index 1ad1655..9008bb9 100644 --- a/internal/iplibrary/manager_ip_list.go +++ b/internal/iplibrary/manager_ip_list.go @@ -6,13 +6,13 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/TeaOSLab/EdgeNode/internal/waf" - "github.com/TeaOSLab/EdgeNode/internal/zero" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/types" "os" diff --git a/internal/metrics/task_kv.go b/internal/metrics/task_kv.go index fc7dc75..493c71e 100644 --- a/internal/metrics/task_kv.go +++ b/internal/metrics/task_kv.go @@ -5,15 +5,15 @@ package metrics import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" byteutils "github.com/TeaOSLab/EdgeNode/internal/utils/byte" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" "github.com/TeaOSLab/EdgeNode/internal/utils/kvstore" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/cockroachdb/pebble" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/types" diff --git a/internal/metrics/task_sqlite.go b/internal/metrics/task_sqlite.go index cafddf1..af48f12 100644 --- a/internal/metrics/task_sqlite.go +++ b/internal/metrics/task_sqlite.go @@ -7,14 +7,14 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/TeaOSLab/EdgeNode/internal/utils/dbs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/types" "os" diff --git a/internal/monitor/value_queue.go b/internal/monitor/value_queue.go index fc8cc41..f0c683b 100644 --- a/internal/monitor/value_queue.go +++ b/internal/monitor/value_queue.go @@ -7,9 +7,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/maps" "time" ) diff --git a/internal/nodes/api_stream.go b/internal/nodes/api_stream.go index a76ad99..4290ded 100644 --- a/internal/nodes/api_stream.go +++ b/internal/nodes/api_stream.go @@ -13,10 +13,10 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/errors" "github.com/TeaOSLab/EdgeNode/internal/events" "github.com/TeaOSLab/EdgeNode/internal/firewalls" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/maps" "net/url" diff --git a/internal/nodes/client_conn_limiter.go b/internal/nodes/client_conn_limiter.go index a218e38..63b3663 100644 --- a/internal/nodes/client_conn_limiter.go +++ b/internal/nodes/client_conn_limiter.go @@ -3,7 +3,7 @@ package nodes import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/nodes/client_conn_traffic.go b/internal/nodes/client_conn_traffic.go index b03d358..e1ef9f3 100644 --- a/internal/nodes/client_conn_traffic.go +++ b/internal/nodes/client_conn_traffic.go @@ -6,8 +6,8 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/monitor" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/maps" "sync/atomic" "time" diff --git a/internal/nodes/http_access_log_queue.go b/internal/nodes/http_access_log_queue.go index 29402f6..8ebc3be 100644 --- a/internal/nodes/http_access_log_queue.go +++ b/internal/nodes/http_access_log_queue.go @@ -3,10 +3,10 @@ package nodes import ( "bytes" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/utils" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/internal/nodes/http_cache_task_manager.go b/internal/nodes/http_cache_task_manager.go index c87fede..d50d5a0 100644 --- a/internal/nodes/http_cache_task_manager.go +++ b/internal/nodes/http_cache_task_manager.go @@ -13,11 +13,11 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/compressions" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/utils/bytepool" connutils "github.com/TeaOSLab/EdgeNode/internal/utils/conns" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "io" "net" diff --git a/internal/nodes/http_client_pool.go b/internal/nodes/http_client_pool.go index a16868c..54826ba 100644 --- a/internal/nodes/http_client_pool.go +++ b/internal/nodes/http_client_pool.go @@ -5,8 +5,8 @@ import ( "crypto/tls" "errors" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/cespare/xxhash/v2" "github.com/pires/go-proxyproto" "golang.org/x/net/http2" diff --git a/internal/nodes/http_request_root.go b/internal/nodes/http_request_root.go index eed79e2..f0f063c 100644 --- a/internal/nodes/http_request_root.go +++ b/internal/nodes/http_request_root.go @@ -3,7 +3,7 @@ package nodes import ( "fmt" rangeutils "github.com/TeaOSLab/EdgeNode/internal/utils/ranges" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/cespare/xxhash/v2" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/logs" diff --git a/internal/nodes/http_request_utils_test.go b/internal/nodes/http_request_utils_test.go index 33b785a..27d6ef3 100644 --- a/internal/nodes/http_request_utils_test.go +++ b/internal/nodes/http_request_utils_test.go @@ -2,7 +2,7 @@ package nodes import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/assert" "runtime" "sync" diff --git a/internal/nodes/listener.go b/internal/nodes/listener.go index 5af0226..6000e3b 100644 --- a/internal/nodes/listener.go +++ b/internal/nodes/listener.go @@ -5,8 +5,8 @@ import ( "errors" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "golang.org/x/net/ipv4" "golang.org/x/net/ipv6" "net" diff --git a/internal/nodes/listener_manager.go b/internal/nodes/listener_manager.go index c754041..6285968 100644 --- a/internal/nodes/listener_manager.go +++ b/internal/nodes/listener_manager.go @@ -6,10 +6,10 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/firewalls" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/maps" diff --git a/internal/nodes/listener_tcp.go b/internal/nodes/listener_tcp.go index 9e360cf..41c7327 100644 --- a/internal/nodes/listener_tcp.go +++ b/internal/nodes/listener_tcp.go @@ -5,10 +5,10 @@ import ( "errors" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/stats" "github.com/TeaOSLab/EdgeNode/internal/utils/bytepool" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/types" "github.com/pires/go-proxyproto" "net" diff --git a/internal/nodes/listener_udp.go b/internal/nodes/listener_udp.go index 99c96b8..17ccdbf 100644 --- a/internal/nodes/listener_udp.go +++ b/internal/nodes/listener_udp.go @@ -4,12 +4,12 @@ import ( "errors" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" "github.com/TeaOSLab/EdgeNode/internal/firewalls" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/iplibrary" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/stats" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/TeaOSLab/EdgeNode/internal/utils/bytepool" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/types" "github.com/pires/go-proxyproto" "golang.org/x/net/ipv4" diff --git a/internal/nodes/node.go b/internal/nodes/node.go index 11f46ef..e30a3dd 100644 --- a/internal/nodes/node.go +++ b/internal/nodes/node.go @@ -18,19 +18,19 @@ import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" "github.com/TeaOSLab/EdgeNode/internal/firewalls" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/iplibrary" "github.com/TeaOSLab/EdgeNode/internal/metrics" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/stats" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" _ "github.com/TeaOSLab/EdgeNode/internal/utils/agents" // 引入Agent管理器 _ "github.com/TeaOSLab/EdgeNode/internal/utils/clock" // 触发时钟更新 fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/jsonutils" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/TeaOSLab/EdgeNode/internal/waf" "github.com/andybalholm/brotli" "github.com/iwind/TeaGo/Tea" diff --git a/internal/nodes/node_status_executor.go b/internal/nodes/node_status_executor.go index 361b235..fdc3dd5 100644 --- a/internal/nodes/node_status_executor.go +++ b/internal/nodes/node_status_executor.go @@ -11,9 +11,9 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/monitor" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/maps" "github.com/shirou/gopsutil/v3/cpu" diff --git a/internal/nodes/node_tasks.go b/internal/nodes/node_tasks.go index 91f5a2a..bdccd3f 100644 --- a/internal/nodes/node_tasks.go +++ b/internal/nodes/node_tasks.go @@ -12,12 +12,12 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ddosconfigs" "github.com/TeaOSLab/EdgeNode/internal/configs" "github.com/TeaOSLab/EdgeNode/internal/firewalls" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/iplibrary" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/TeaOSLab/EdgeNode/internal/waf" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/maps" diff --git a/internal/nodes/origin_conn.go b/internal/nodes/origin_conn.go index 2bd4d6c..47ea080 100644 --- a/internal/nodes/origin_conn.go +++ b/internal/nodes/origin_conn.go @@ -4,9 +4,9 @@ package nodes import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "net" "sync" "time" diff --git a/internal/nodes/origin_state_manager.go b/internal/nodes/origin_state_manager.go index e6ea09a..2b51e8a 100644 --- a/internal/nodes/origin_state_manager.go +++ b/internal/nodes/origin_state_manager.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" - "github.com/TeaOSLab/EdgeNode/internal/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/iwind/TeaGo/Tea" "sync" "time" diff --git a/internal/nodes/system_services.go b/internal/nodes/system_services.go index 424187f..5f5c040 100644 --- a/internal/nodes/system_services.go +++ b/internal/nodes/system_services.go @@ -7,10 +7,10 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/utils" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/maps" "os" "runtime" diff --git a/internal/nodes/task_ocsp_update.go b/internal/nodes/task_ocsp_update.go index 00e9e19..6bf3456 100644 --- a/internal/nodes/task_ocsp_update.go +++ b/internal/nodes/task_ocsp_update.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "time" ) diff --git a/internal/nodes/task_sync_api_nodes.go b/internal/nodes/task_sync_api_nodes.go index 2b77dc4..6657b6c 100644 --- a/internal/nodes/task_sync_api_nodes.go +++ b/internal/nodes/task_sync_api_nodes.go @@ -5,10 +5,10 @@ import ( "github.com/TeaOSLab/EdgeNode/internal/configs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/logs" "time" diff --git a/internal/nodes/task_trim_disks.go b/internal/nodes/task_trim_disks.go index 31550a3..030dbbd 100644 --- a/internal/nodes/task_trim_disks.go +++ b/internal/nodes/task_trim_disks.go @@ -5,9 +5,9 @@ package nodes import ( "fmt" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" - "github.com/TeaOSLab/EdgeNode/internal/trackers" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "runtime" "time" ) diff --git a/internal/nodes/upgrade_manager.go b/internal/nodes/upgrade_manager.go index cfa2813..c8d47bd 100644 --- a/internal/nodes/upgrade_manager.go +++ b/internal/nodes/upgrade_manager.go @@ -8,11 +8,11 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/utils" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" stringutil "github.com/iwind/TeaGo/utils/string" "github.com/iwind/gosock/pkg/gosock" diff --git a/internal/remotelogs/utils.go b/internal/remotelogs/utils.go index 3a3be56..2caaf57 100644 --- a/internal/remotelogs/utils.go +++ b/internal/remotelogs/utils.go @@ -5,9 +5,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/cespare/xxhash/v2" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/logs" diff --git a/internal/rpc/rpc_client.go b/internal/rpc/rpc_client.go index a006e01..610927f 100644 --- a/internal/rpc/rpc_client.go +++ b/internal/rpc/rpc_client.go @@ -9,8 +9,8 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeNode/internal/configs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/encrypt" "github.com/TeaOSLab/EdgeNode/internal/utils" + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" "github.com/iwind/TeaGo/maps" "github.com/iwind/TeaGo/rands" "google.golang.org/grpc" diff --git a/internal/stats/bandwidth_stat_manager.go b/internal/stats/bandwidth_stat_manager.go index d6cc6ec..4ac87fb 100644 --- a/internal/stats/bandwidth_stat_manager.go +++ b/internal/stats/bandwidth_stat_manager.go @@ -8,10 +8,10 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/logs" "github.com/iwind/TeaGo/types" diff --git a/internal/stats/dau_manager.go b/internal/stats/dau_manager.go index 0e78e8a..011d67a 100644 --- a/internal/stats/dau_manager.go +++ b/internal/stats/dau_manager.go @@ -5,12 +5,12 @@ package stats import ( "encoding/json" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" "github.com/TeaOSLab/EdgeNode/internal/utils/kvstore" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/types" timeutil "github.com/iwind/TeaGo/utils/time" diff --git a/internal/stats/http_request_stat_manager.go b/internal/stats/http_request_stat_manager.go index 3982f71..6374d1e 100644 --- a/internal/stats/http_request_stat_manager.go +++ b/internal/stats/http_request_stat_manager.go @@ -5,13 +5,13 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/monitor" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" - "github.com/TeaOSLab/EdgeNode/internal/trackers" "github.com/TeaOSLab/EdgeNode/internal/utils" "github.com/TeaOSLab/EdgeNode/internal/utils/agents" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/TeaOSLab/EdgeNode/internal/waf" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/maps" diff --git a/internal/stats/traffic_stat_manager.go b/internal/stats/traffic_stat_manager.go index 9e3caf1..e5a9f11 100644 --- a/internal/stats/traffic_stat_manager.go +++ b/internal/stats/traffic_stat_manager.go @@ -4,11 +4,11 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/monitor" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/iwind/TeaGo/maps" "github.com/iwind/TeaGo/types" diff --git a/internal/stats/user_agent_parser.go b/internal/stats/user_agent_parser.go index 65ba3cf..1bb39e1 100644 --- a/internal/stats/user_agent_parser.go +++ b/internal/stats/user_agent_parser.go @@ -3,8 +3,8 @@ package stats import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/fnv" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" syncutils "github.com/TeaOSLab/EdgeNode/internal/utils/sync" "github.com/mssola/useragent" diff --git a/internal/utils/agents/ip_cache_map.go b/internal/utils/agents/ip_cache_map.go index d52f50e..8f66599 100644 --- a/internal/utils/agents/ip_cache_map.go +++ b/internal/utils/agents/ip_cache_map.go @@ -3,7 +3,7 @@ package agents import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/utils/agents/manager.go b/internal/utils/agents/manager.go index b319bd2..189e554 100644 --- a/internal/utils/agents/manager.go +++ b/internal/utils/agents/manager.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "os" "sync" diff --git a/internal/utils/agents/queue.go b/internal/utils/agents/queue.go index 56ee9ba..358a701 100644 --- a/internal/utils/agents/queue.go +++ b/internal/utils/agents/queue.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "net" ) diff --git a/internal/utils/bfs/blocks_file.go b/internal/utils/bfs/blocks_file.go index f9bce3a..cdecd9d 100644 --- a/internal/utils/bfs/blocks_file.go +++ b/internal/utils/bfs/blocks_file.go @@ -5,7 +5,7 @@ package bfs import ( "errors" "fmt" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "io" "os" "path/filepath" diff --git a/internal/utils/bfs/fs.go b/internal/utils/bfs/fs.go index 0a188bd..cec6520 100644 --- a/internal/utils/bfs/fs.go +++ b/internal/utils/bfs/fs.go @@ -4,10 +4,10 @@ package bfs import ( "errors" - "github.com/TeaOSLab/EdgeNode/internal/goman" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/linkedlist" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "log" "runtime" "sync" diff --git a/internal/utils/bfs/meta_file.go b/internal/utils/bfs/meta_file.go index 1e8b05a..62ce247 100644 --- a/internal/utils/bfs/meta_file.go +++ b/internal/utils/bfs/meta_file.go @@ -6,7 +6,7 @@ import ( "bytes" "encoding/binary" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "io" "os" "sync" diff --git a/internal/utils/bfs/threads_limiter.go b/internal/utils/bfs/threads_limiter.go index be8912b..c76f7a2 100644 --- a/internal/utils/bfs/threads_limiter.go +++ b/internal/utils/bfs/threads_limiter.go @@ -2,7 +2,7 @@ package bfs -import "github.com/TeaOSLab/EdgeNode/internal/zero" +import "github.com/TeaOSLab/EdgeNode/internal/utils/zero" // TODO 线程数可以根据硬盘数量动态调整? var readThreadsLimiter = make(chan zero.Zero, 8) diff --git a/internal/utils/cachehits/stat.go b/internal/utils/cachehits/stat.go index 345dd0e..417903c 100644 --- a/internal/utils/cachehits/stat.go +++ b/internal/utils/cachehits/stat.go @@ -3,8 +3,8 @@ package cachehits import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/idles" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "github.com/iwind/TeaGo/Tea" diff --git a/internal/utils/clock/manager.go b/internal/utils/clock/manager.go index 43f5fc1..9d5721b 100644 --- a/internal/utils/clock/manager.go +++ b/internal/utils/clock/manager.go @@ -8,9 +8,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" timeutil "github.com/iwind/TeaGo/utils/time" "net" "runtime" diff --git a/internal/utils/common_files.go b/internal/utils/common_files.go index 70b6313..d8d97cb 100644 --- a/internal/utils/common_files.go +++ b/internal/utils/common_files.go @@ -3,7 +3,7 @@ package utils import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "strings" ) diff --git a/internal/utils/conns/conn_no_stat.go b/internal/utils/conns/conn_no_stat.go index f226d5f..3de4923 100644 --- a/internal/utils/conns/conn_no_stat.go +++ b/internal/utils/conns/conn_no_stat.go @@ -3,7 +3,7 @@ package connutils import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "net" "sync" "time" diff --git a/internal/utils/counters/counter.go b/internal/utils/counters/counter.go index 1e12a9d..1c0d2a9 100644 --- a/internal/utils/counters/counter.go +++ b/internal/utils/counters/counter.go @@ -3,8 +3,8 @@ package counters import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" syncutils "github.com/TeaOSLab/EdgeNode/internal/utils/sync" "github.com/cespare/xxhash/v2" diff --git a/internal/utils/dbs/query_stat_manager.go b/internal/utils/dbs/query_stat_manager.go index 7c16b8d..e5a3ece 100644 --- a/internal/utils/dbs/query_stat_manager.go +++ b/internal/utils/dbs/query_stat_manager.go @@ -6,7 +6,7 @@ import ( "fmt" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/logs" "sort" "strings" diff --git a/internal/encrypt/magic_key.go b/internal/utils/encrypt/magic_key.go similarity index 100% rename from internal/encrypt/magic_key.go rename to internal/utils/encrypt/magic_key.go diff --git a/internal/utils/encrypt/magic_key_test.go b/internal/utils/encrypt/magic_key_test.go new file mode 100644 index 0000000..cf9b2fc --- /dev/null +++ b/internal/utils/encrypt/magic_key_test.go @@ -0,0 +1,14 @@ +package encrypt_test + +import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" + "testing" +) + +func TestMagicKeyEncode(t *testing.T) { + var dst = encrypt.MagicKeyEncode([]byte("Hello,World")) + t.Log("dst:", string(dst)) + + var src = encrypt.MagicKeyDecode(dst) + t.Log("src:", string(src)) +} diff --git a/internal/encrypt/method.go b/internal/utils/encrypt/method.go similarity index 100% rename from internal/encrypt/method.go rename to internal/utils/encrypt/method.go diff --git a/internal/encrypt/method_aes_128_cfb.go b/internal/utils/encrypt/method_aes_128_cfb.go similarity index 100% rename from internal/encrypt/method_aes_128_cfb.go rename to internal/utils/encrypt/method_aes_128_cfb.go diff --git a/internal/encrypt/method_aes_128_cfb_test.go b/internal/utils/encrypt/method_aes_128_cfb_test.go similarity index 75% rename from internal/encrypt/method_aes_128_cfb_test.go rename to internal/utils/encrypt/method_aes_128_cfb_test.go index 3796079..c74a577 100644 --- a/internal/encrypt/method_aes_128_cfb_test.go +++ b/internal/utils/encrypt/method_aes_128_cfb_test.go @@ -1,17 +1,18 @@ -package encrypt +package encrypt_test import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" "runtime" "strings" "testing" ) func TestAES128CFBMethod_Encrypt(t *testing.T) { - method, err := NewMethodInstance("aes-128-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-128-cfb", "abc", "123") if err != nil { t.Fatal(err) } - src := []byte("Hello, World") + var src = []byte("Hello, World") dst, err := method.Encrypt(src) if err != nil { t.Fatal(err) @@ -27,12 +28,12 @@ func TestAES128CFBMethod_Encrypt(t *testing.T) { } func TestAES128CFBMethod_Encrypt2(t *testing.T) { - method, err := NewMethodInstance("aes-128-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-128-cfb", "abc", "123") if err != nil { t.Fatal(err) } - sources := [][]byte{} + var sources = [][]byte{} { a := []byte{1} @@ -73,12 +74,12 @@ func TestAES128CFBMethod_Encrypt2(t *testing.T) { func BenchmarkAES128CFBMethod_Encrypt(b *testing.B) { runtime.GOMAXPROCS(1) - method, err := NewMethodInstance("aes-128-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-128-cfb", "abc", "123") if err != nil { b.Fatal(err) } - src := []byte(strings.Repeat("Hello", 1024)) + var src = []byte(strings.Repeat("Hello", 1024)) for i := 0; i < b.N; i++ { dst, err := method.Encrypt(src) if err != nil { diff --git a/internal/encrypt/method_aes_192_cfb.go b/internal/utils/encrypt/method_aes_192_cfb.go similarity index 100% rename from internal/encrypt/method_aes_192_cfb.go rename to internal/utils/encrypt/method_aes_192_cfb.go diff --git a/internal/encrypt/method_aes_192_cfb_test.go b/internal/utils/encrypt/method_aes_192_cfb_test.go similarity index 69% rename from internal/encrypt/method_aes_192_cfb_test.go rename to internal/utils/encrypt/method_aes_192_cfb_test.go index 968b396..dd3c3c3 100644 --- a/internal/encrypt/method_aes_192_cfb_test.go +++ b/internal/utils/encrypt/method_aes_192_cfb_test.go @@ -1,13 +1,14 @@ -package encrypt +package encrypt_test import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" "runtime" "strings" "testing" ) func TestAES192CFBMethod_Encrypt(t *testing.T) { - method, err := NewMethodInstance("aes-192-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-192-cfb", "abc", "123") if err != nil { t.Fatal(err) } @@ -29,12 +30,12 @@ func TestAES192CFBMethod_Encrypt(t *testing.T) { func BenchmarkAES192CFBMethod_Encrypt(b *testing.B) { runtime.GOMAXPROCS(1) - method, err := NewMethodInstance("aes-192-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-192-cfb", "abc", "123") if err != nil { b.Fatal(err) } - src := []byte(strings.Repeat("Hello", 1024)) + var src = []byte(strings.Repeat("Hello", 1024)) for i := 0; i < b.N; i++ { dst, err := method.Encrypt(src) if err != nil { diff --git a/internal/encrypt/method_aes_256_cfb.go b/internal/utils/encrypt/method_aes_256_cfb.go similarity index 100% rename from internal/encrypt/method_aes_256_cfb.go rename to internal/utils/encrypt/method_aes_256_cfb.go diff --git a/internal/encrypt/method_aes_256_cfb_test.go b/internal/utils/encrypt/method_aes_256_cfb_test.go similarity index 65% rename from internal/encrypt/method_aes_256_cfb_test.go rename to internal/utils/encrypt/method_aes_256_cfb_test.go index a694e49..df494bd 100644 --- a/internal/encrypt/method_aes_256_cfb_test.go +++ b/internal/utils/encrypt/method_aes_256_cfb_test.go @@ -1,13 +1,16 @@ -package encrypt +package encrypt_test -import "testing" +import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" + "testing" +) func TestAES256CFBMethod_Encrypt(t *testing.T) { - method, err := NewMethodInstance("aes-256-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-256-cfb", "abc", "123") if err != nil { t.Fatal(err) } - src := []byte("Hello, World") + var src = []byte("Hello, World") dst, err := method.Encrypt(src) if err != nil { t.Fatal(err) @@ -23,11 +26,11 @@ func TestAES256CFBMethod_Encrypt(t *testing.T) { } func TestAES256CFBMethod_Encrypt2(t *testing.T) { - method, err := NewMethodInstance("aes-256-cfb", "abc", "123") + method, err := encrypt.NewMethodInstance("aes-256-cfb", "abc", "123") if err != nil { t.Fatal(err) } - src := []byte("Hello, World") + var src = []byte("Hello, World") dst, err := method.Encrypt(src) if err != nil { t.Fatal(err) diff --git a/internal/encrypt/method_raw.go b/internal/utils/encrypt/method_raw.go similarity index 100% rename from internal/encrypt/method_raw.go rename to internal/utils/encrypt/method_raw.go diff --git a/internal/encrypt/method_raw_test.go b/internal/utils/encrypt/method_raw_test.go similarity index 60% rename from internal/encrypt/method_raw_test.go rename to internal/utils/encrypt/method_raw_test.go index b9403f6..4ca2ed9 100644 --- a/internal/encrypt/method_raw_test.go +++ b/internal/utils/encrypt/method_raw_test.go @@ -1,13 +1,16 @@ -package encrypt +package encrypt_test -import "testing" +import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" + "testing" +) func TestRawMethod_Encrypt(t *testing.T) { - method, err := NewMethodInstance("raw", "abc", "123") + method, err := encrypt.NewMethodInstance("raw", "abc", "123") if err != nil { t.Fatal(err) } - src := []byte("Hello, World") + var src = []byte("Hello, World") dst, err := method.Encrypt(src) if err != nil { t.Fatal(err) diff --git a/internal/encrypt/method_utils.go b/internal/utils/encrypt/method_utils.go similarity index 100% rename from internal/encrypt/method_utils.go rename to internal/utils/encrypt/method_utils.go diff --git a/internal/utils/encrypt/method_utils_test.go b/internal/utils/encrypt/method_utils_test.go new file mode 100644 index 0000000..3718272 --- /dev/null +++ b/internal/utils/encrypt/method_utils_test.go @@ -0,0 +1,11 @@ +package encrypt_test + +import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/encrypt" + "testing" +) + +func TestFindMethodInstance(t *testing.T) { + t.Log(encrypt.NewMethodInstance("a", "b", "")) + t.Log(encrypt.NewMethodInstance("aes-256-cfb", "123456", "")) +} diff --git a/internal/utils/expires/list.go b/internal/utils/expires/list.go index 55377c1..621cc5d 100644 --- a/internal/utils/expires/list.go +++ b/internal/utils/expires/list.go @@ -1,7 +1,7 @@ package expires import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/utils/expires/manager.go b/internal/utils/expires/manager.go index 352f25f..9c894a1 100644 --- a/internal/utils/expires/manager.go +++ b/internal/utils/expires/manager.go @@ -3,8 +3,8 @@ package expires import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" "time" ) diff --git a/internal/utils/fasttime/time_fast.go b/internal/utils/fasttime/time_fast.go index 2721a75..3214c34 100644 --- a/internal/utils/fasttime/time_fast.go +++ b/internal/utils/fasttime/time_fast.go @@ -4,7 +4,7 @@ package fasttime import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/types" timeutil "github.com/iwind/TeaGo/utils/time" "time" diff --git a/internal/utils/fs/status.go b/internal/utils/fs/status.go index d0e3dd6..98f4662 100644 --- a/internal/utils/fs/status.go +++ b/internal/utils/fs/status.go @@ -5,7 +5,7 @@ package fsutils import ( "encoding/json" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/shirou/gopsutil/v3/load" "os" diff --git a/internal/goman/instance.go b/internal/utils/goman/instance.go similarity index 100% rename from internal/goman/instance.go rename to internal/utils/goman/instance.go diff --git a/internal/goman/lib.go b/internal/utils/goman/lib.go similarity index 100% rename from internal/goman/lib.go rename to internal/utils/goman/lib.go diff --git a/internal/goman/lib_test.go b/internal/utils/goman/lib_test.go similarity index 89% rename from internal/goman/lib_test.go rename to internal/utils/goman/lib_test.go index 2b7616f..9a992d4 100644 --- a/internal/goman/lib_test.go +++ b/internal/utils/goman/lib_test.go @@ -3,7 +3,7 @@ package goman_test import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "testing" "time" ) diff --git a/internal/goman/task_group.go b/internal/utils/goman/task_group.go similarity index 93% rename from internal/goman/task_group.go rename to internal/utils/goman/task_group.go index 7c9493b..fda2339 100644 --- a/internal/goman/task_group.go +++ b/internal/utils/goman/task_group.go @@ -3,7 +3,7 @@ package goman import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "runtime" "sync" ) diff --git a/internal/goman/task_group_test.go b/internal/utils/goman/task_group_test.go similarity index 90% rename from internal/goman/task_group_test.go rename to internal/utils/goman/task_group_test.go index 99a435f..4951357 100644 --- a/internal/goman/task_group_test.go +++ b/internal/utils/goman/task_group_test.go @@ -3,7 +3,7 @@ package goman_test import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "runtime" "testing" ) diff --git a/internal/utils/idles/run.go b/internal/utils/idles/run.go index ef0635c..6ede0cf 100644 --- a/internal/utils/idles/run.go +++ b/internal/utils/idles/run.go @@ -5,8 +5,8 @@ package idles import ( "encoding/json" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" fsutils "github.com/TeaOSLab/EdgeNode/internal/utils/fs" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/iwind/TeaGo/Tea" "github.com/shirou/gopsutil/v3/load" "math" diff --git a/internal/utils/mem/system.go b/internal/utils/mem/system.go index 74c64cb..8b74d46 100644 --- a/internal/utils/mem/system.go +++ b/internal/utils/mem/system.go @@ -4,7 +4,7 @@ package memutils import ( teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/shirou/gopsutil/v3/mem" "time" ) diff --git a/internal/utils/percpu/chan_test.go b/internal/utils/percpu/chan_test.go index 7169e26..038f3c1 100644 --- a/internal/utils/percpu/chan_test.go +++ b/internal/utils/percpu/chan_test.go @@ -4,7 +4,7 @@ package percpu_test import ( "github.com/TeaOSLab/EdgeNode/internal/utils/percpu" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "testing" ) diff --git a/internal/utils/ratelimit/counter.go b/internal/utils/ratelimit/counter.go index 3c2cc4b..7f18ed0 100644 --- a/internal/utils/ratelimit/counter.go +++ b/internal/utils/ratelimit/counter.go @@ -3,7 +3,7 @@ package ratelimit import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/re/regexp.go b/internal/utils/re/regexp.go similarity index 100% rename from internal/re/regexp.go rename to internal/utils/re/regexp.go diff --git a/internal/re/regexp_test.go b/internal/utils/re/regexp_test.go similarity index 99% rename from internal/re/regexp_test.go rename to internal/utils/re/regexp_test.go index d2cef6d..e4e670e 100644 --- a/internal/re/regexp_test.go +++ b/internal/utils/re/regexp_test.go @@ -4,7 +4,7 @@ package re_test import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs" - "github.com/TeaOSLab/EdgeNode/internal/re" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/iwind/TeaGo/assert" "regexp" "strings" diff --git a/internal/re/rune_tree.go b/internal/utils/re/rune_tree.go similarity index 100% rename from internal/re/rune_tree.go rename to internal/utils/re/rune_tree.go diff --git a/internal/re/rune_tree_test.go b/internal/utils/re/rune_tree_test.go similarity index 97% rename from internal/re/rune_tree_test.go rename to internal/utils/re/rune_tree_test.go index 145b414..90dee4c 100644 --- a/internal/re/rune_tree_test.go +++ b/internal/utils/re/rune_tree_test.go @@ -3,7 +3,7 @@ package re_test import ( - "github.com/TeaOSLab/EdgeNode/internal/re" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/iwind/TeaGo/assert" "regexp" "testing" diff --git a/internal/utils/runes/runes_test.go b/internal/utils/runes/runes_test.go index b5ec1ac..51cb068 100644 --- a/internal/utils/runes/runes_test.go +++ b/internal/utils/runes/runes_test.go @@ -3,7 +3,7 @@ package runes_test import ( - "github.com/TeaOSLab/EdgeNode/internal/re" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/TeaOSLab/EdgeNode/internal/utils/runes" "github.com/iwind/TeaGo/assert" "regexp" @@ -136,7 +136,6 @@ func BenchmarkContainsAnyWordRunes(b *testing.B) { }) } - func BenchmarkContainsAnyWord_Regexp(b *testing.B) { runtime.GOMAXPROCS(4) var reg = regexp.MustCompile("(?i)" + strings.ReplaceAll("python\npycurl\nhttp-client\nhttpclient\napachebench\nnethttp\nhttp_request\njava\nperl\nruby\nscrapy\nphp\nrust", "\n", "|")) diff --git a/internal/utils/sets/set_fixed.go b/internal/utils/sets/set_fixed.go index 7c6d0dc..94bf84d 100644 --- a/internal/utils/sets/set_fixed.go +++ b/internal/utils/sets/set_fixed.go @@ -3,7 +3,7 @@ package setutils import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/utils/ticker.go b/internal/utils/ticker.go index 5a39185..29b893d 100644 --- a/internal/utils/ticker.go +++ b/internal/utils/ticker.go @@ -1,7 +1,7 @@ package utils import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" "time" ) diff --git a/internal/utils/ticker_utils.go b/internal/utils/ticker_utils.go index e141d99..2ff0da1 100644 --- a/internal/utils/ticker_utils.go +++ b/internal/utils/ticker_utils.go @@ -1,7 +1,7 @@ package utils import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "time" ) diff --git a/internal/trackers/label.go b/internal/utils/trackers/label.go similarity index 100% rename from internal/trackers/label.go rename to internal/utils/trackers/label.go diff --git a/internal/trackers/manager.go b/internal/utils/trackers/manager.go similarity index 100% rename from internal/trackers/manager.go rename to internal/utils/trackers/manager.go diff --git a/internal/trackers/manager_test.go b/internal/utils/trackers/manager_test.go similarity index 94% rename from internal/trackers/manager_test.go rename to internal/utils/trackers/manager_test.go index c03650f..767ea76 100644 --- a/internal/trackers/manager_test.go +++ b/internal/utils/trackers/manager_test.go @@ -3,7 +3,7 @@ package trackers_test import ( - "github.com/TeaOSLab/EdgeNode/internal/trackers" + "github.com/TeaOSLab/EdgeNode/internal/utils/trackers" "github.com/iwind/TeaGo/logs" "testing" "time" diff --git a/internal/utils/ttlcache/manager.go b/internal/utils/ttlcache/manager.go index 9c631ad..c6a63c2 100644 --- a/internal/utils/ttlcache/manager.go +++ b/internal/utils/ttlcache/manager.go @@ -3,8 +3,8 @@ package ttlcache import ( - "github.com/TeaOSLab/EdgeNode/internal/goman" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" "time" ) diff --git a/internal/utils/ttlcache/utils_test.go b/internal/utils/ttlcache/utils_test.go index 9053d75..bc18663 100644 --- a/internal/utils/ttlcache/utils_test.go +++ b/internal/utils/ttlcache/utils_test.go @@ -3,7 +3,7 @@ package ttlcache_test import ( "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" "github.com/TeaOSLab/EdgeNode/internal/utils/ttlcache" - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/cespare/xxhash/v2" "runtime" "strconv" diff --git a/internal/zero/zero.go b/internal/utils/zero/zero.go similarity index 100% rename from internal/zero/zero.go rename to internal/utils/zero/zero.go diff --git a/internal/zero/zero_test.go b/internal/utils/zero/zero_test.go similarity index 79% rename from internal/zero/zero_test.go rename to internal/utils/zero/zero_test.go index 08cfc26..c203be8 100644 --- a/internal/zero/zero_test.go +++ b/internal/utils/zero/zero_test.go @@ -1,8 +1,9 @@ // Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. -package zero +package zero_test import ( + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "runtime" "testing" ) @@ -11,9 +12,9 @@ func TestZero_Chan(t *testing.T) { var stat1 = &runtime.MemStats{} runtime.ReadMemStats(stat1) - var m = make(chan Zero, 2_000_000) + var m = make(chan zero.Zero, 2_000_000) for i := 0; i < 1_000_000; i++ { - m <- New() + m <- zero.New() } var stat2 = &runtime.MemStats{} @@ -26,9 +27,9 @@ func TestZero_Map(t *testing.T) { var stat1 = &runtime.MemStats{} runtime.ReadMemStats(stat1) - var m = map[int]Zero{} + var m = map[int]zero.Zero{} for i := 0; i < 1_000_000; i++ { - m[i] = New() + m[i] = zero.New() } var stat2 = &runtime.MemStats{} diff --git a/internal/waf/action_notify.go b/internal/waf/action_notify.go index 4a6fc00..78914b6 100644 --- a/internal/waf/action_notify.go +++ b/internal/waf/action_notify.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" "github.com/TeaOSLab/EdgeNode/internal/waf/requests" "github.com/iwind/TeaGo/types" "net/http" diff --git a/internal/waf/action_record_ip.go b/internal/waf/action_record_ip.go index e7f01f5..3344c74 100644 --- a/internal/waf/action_record_ip.go +++ b/internal/waf/action_record_ip.go @@ -6,9 +6,9 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/ipconfigs" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" "github.com/TeaOSLab/EdgeNode/internal/events" - "github.com/TeaOSLab/EdgeNode/internal/goman" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/rpc" + "github.com/TeaOSLab/EdgeNode/internal/utils/goman" memutils "github.com/TeaOSLab/EdgeNode/internal/utils/mem" "github.com/TeaOSLab/EdgeNode/internal/waf/requests" "github.com/iwind/TeaGo/types" diff --git a/internal/waf/ip_lists_deleted.go b/internal/waf/ip_lists_deleted.go index af26b63..5158e2e 100644 --- a/internal/waf/ip_lists_deleted.go +++ b/internal/waf/ip_lists_deleted.go @@ -3,7 +3,7 @@ package waf import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "sync" ) diff --git a/internal/waf/rule.go b/internal/waf/rule.go index 2bdf7cf..4f1ac98 100644 --- a/internal/waf/rule.go +++ b/internal/waf/rule.go @@ -7,8 +7,8 @@ import ( "errors" "github.com/TeaOSLab/EdgeCommon/pkg/configutils" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/filterconfigs" - "github.com/TeaOSLab/EdgeNode/internal/re" "github.com/TeaOSLab/EdgeNode/internal/remotelogs" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/TeaOSLab/EdgeNode/internal/utils/runes" "github.com/TeaOSLab/EdgeNode/internal/waf/checkpoints" "github.com/TeaOSLab/EdgeNode/internal/waf/injectionutils" diff --git a/internal/waf/utils/utils.go b/internal/waf/utils/utils.go index fa377d7..4605f4d 100644 --- a/internal/waf/utils/utils.go +++ b/internal/waf/utils/utils.go @@ -3,10 +3,10 @@ package utils import ( "github.com/TeaOSLab/EdgeCommon/pkg/iplibrary" teaconst "github.com/TeaOSLab/EdgeNode/internal/const" - "github.com/TeaOSLab/EdgeNode/internal/re" "github.com/TeaOSLab/EdgeNode/internal/utils/agents" "github.com/TeaOSLab/EdgeNode/internal/utils/cachehits" "github.com/TeaOSLab/EdgeNode/internal/utils/fasttime" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/TeaOSLab/EdgeNode/internal/utils/ttlcache" "github.com/TeaOSLab/EdgeNode/internal/waf/requests" "github.com/cespare/xxhash/v2" diff --git a/internal/waf/utils/utils_test.go b/internal/waf/utils/utils_test.go index 9bb53dc..a879c79 100644 --- a/internal/waf/utils/utils_test.go +++ b/internal/waf/utils/utils_test.go @@ -1,7 +1,7 @@ package utils_test import ( - "github.com/TeaOSLab/EdgeNode/internal/re" + "github.com/TeaOSLab/EdgeNode/internal/utils/re" "github.com/TeaOSLab/EdgeNode/internal/utils/testutils" "github.com/TeaOSLab/EdgeNode/internal/waf/utils" "github.com/iwind/TeaGo/rands" diff --git a/internal/waf/values/number_list.go b/internal/waf/values/number_list.go index 7be9e5b..389f7da 100644 --- a/internal/waf/values/number_list.go +++ b/internal/waf/values/number_list.go @@ -3,7 +3,7 @@ package values import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "github.com/iwind/TeaGo/types" "strings" ) diff --git a/internal/waf/values/string_list.go b/internal/waf/values/string_list.go index a42dcd0..8440e0a 100644 --- a/internal/waf/values/string_list.go +++ b/internal/waf/values/string_list.go @@ -3,7 +3,7 @@ package values import ( - "github.com/TeaOSLab/EdgeNode/internal/zero" + "github.com/TeaOSLab/EdgeNode/internal/utils/zero" "strings" )