From 04bd68831be25b3a7038221f188cd07cf0bf7b74 Mon Sep 17 00:00:00 2001 From: Shiming Zhang Date: Fri, 8 Dec 2023 01:07:15 +0800 Subject: [PATCH] Bump --- .github/workflows/build_darwin.yml | 6 +- .github/workflows/build_linux_gtk3.yaml | 6 +- .github/workflows/build_windows.yml | 6 +- app/tray/app.go | 2 +- app/tray/on_ready.go | 2 +- app/tray/tray_about.go | 2 +- app/tray/tray_daemon.go | 2 +- app/tray/tray_edit_config.go | 2 +- app/tray/tray_export_command.go | 2 +- app/tray/tray_log.go | 2 +- app/tray/tray_quit.go | 2 +- app/tray/tray_reload_config.go | 2 +- app/tray/tray_status.go | 2 +- app/tray/tray_system_proxy.go | 2 +- app/tray/tray_view.go | 6 +- daemon/kind_darwin.go | 1 + daemon/kind_other.go | 1 + go.mod | 52 ++++---- go.sum | 165 +++++++++--------------- log/log.go | 29 +++-- 20 files changed, 133 insertions(+), 161 deletions(-) diff --git a/.github/workflows/build_darwin.yml b/.github/workflows/build_darwin.yml index a62854f..ccc8f6b 100644 --- a/.github/workflows/build_darwin.yml +++ b/.github/workflows/build_darwin.yml @@ -9,12 +9,12 @@ jobs: build: runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.17 + go-version: 1.21 - name: Build run: ./tools/build_darwin.sh diff --git a/.github/workflows/build_linux_gtk3.yaml b/.github/workflows/build_linux_gtk3.yaml index d1650eb..645b9f9 100644 --- a/.github/workflows/build_linux_gtk3.yaml +++ b/.github/workflows/build_linux_gtk3.yaml @@ -9,12 +9,12 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.17 + go-version: 1.21 - name: Build dependents run: | diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 1592356..f5413db 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -9,12 +9,12 @@ jobs: build: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: - go-version: 1.17 + go-version: 1.21 - name: Build run: ./tools/build_windows.bat diff --git a/app/tray/app.go b/app/tray/app.go index a2f0173..8467099 100644 --- a/app/tray/app.go +++ b/app/tray/app.go @@ -5,11 +5,11 @@ import ( "path/filepath" "time" + "fyne.io/systray" "github.com/wzshiming/jumpway/config" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" "github.com/wzshiming/notify" - "github.com/wzshiming/systray" ) type App struct { diff --git a/app/tray/on_ready.go b/app/tray/on_ready.go index 8e06a48..50e29f6 100644 --- a/app/tray/on_ready.go +++ b/app/tray/on_ready.go @@ -1,9 +1,9 @@ package tray import ( + "fyne.io/systray" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/icon" - "github.com/wzshiming/systray" ) func (a *App) onReady() { diff --git a/app/tray/tray_about.go b/app/tray/tray_about.go index 8b01b38..ec3c4d8 100644 --- a/app/tray/tray_about.go +++ b/app/tray/tray_about.go @@ -1,10 +1,10 @@ package tray import ( + "fyne.io/systray" "github.com/pkg/browser" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" - "github.com/wzshiming/systray" ) func (a *App) ItemAbout(menu *systray.MenuItem) { diff --git a/app/tray/tray_daemon.go b/app/tray/tray_daemon.go index 3d5024c..1e21b16 100644 --- a/app/tray/tray_daemon.go +++ b/app/tray/tray_daemon.go @@ -1,8 +1,8 @@ package tray import ( + "fyne.io/systray" "github.com/wzshiming/jumpway/daemon" - "github.com/wzshiming/systray" ) func (a *App) ItemDaemon(menu *systray.MenuItem) { diff --git a/app/tray/tray_edit_config.go b/app/tray/tray_edit_config.go index d7032d5..8972aaf 100644 --- a/app/tray/tray_edit_config.go +++ b/app/tray/tray_edit_config.go @@ -1,10 +1,10 @@ package tray import ( + "fyne.io/systray" "github.com/wzshiming/jumpway/config" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" - "github.com/wzshiming/systray" ) func (a *App) ItemEditConfig(menu *systray.MenuItem) { diff --git a/app/tray/tray_export_command.go b/app/tray/tray_export_command.go index b2ffea6..a02b200 100644 --- a/app/tray/tray_export_command.go +++ b/app/tray/tray_export_command.go @@ -4,10 +4,10 @@ import ( "fmt" "net" + "fyne.io/systray" "github.com/atotto/clipboard" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" - "github.com/wzshiming/systray" ) func (a *App) ItemExportCommand(menu *systray.MenuItem) { diff --git a/app/tray/tray_log.go b/app/tray/tray_log.go index e7b119b..6c44753 100644 --- a/app/tray/tray_log.go +++ b/app/tray/tray_log.go @@ -1,10 +1,10 @@ package tray import ( + "fyne.io/systray" "github.com/pkg/browser" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" - "github.com/wzshiming/systray" ) func (a *App) ItemLog(menu *systray.MenuItem) { diff --git a/app/tray/tray_quit.go b/app/tray/tray_quit.go index 4dea1ff..a9aa1c3 100644 --- a/app/tray/tray_quit.go +++ b/app/tray/tray_quit.go @@ -1,7 +1,7 @@ package tray import ( - "github.com/wzshiming/systray" + "fyne.io/systray" ) func (a *App) ItemQuit(menu *systray.MenuItem) { diff --git a/app/tray/tray_reload_config.go b/app/tray/tray_reload_config.go index e763f09..26b2445 100644 --- a/app/tray/tray_reload_config.go +++ b/app/tray/tray_reload_config.go @@ -5,6 +5,7 @@ import ( "net" "strconv" + "fyne.io/systray" "github.com/wzshiming/bridge/chain" "github.com/wzshiming/bridge/protocols/local" "github.com/wzshiming/hostmatcher" @@ -13,7 +14,6 @@ import ( "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" "github.com/wzshiming/jumpway/utils" - "github.com/wzshiming/systray" ) func (a *App) ItemReloadConfig(menu *systray.MenuItem) { diff --git a/app/tray/tray_status.go b/app/tray/tray_status.go index 566b933..3ee6e3b 100644 --- a/app/tray/tray_status.go +++ b/app/tray/tray_status.go @@ -1,8 +1,8 @@ package tray import ( + "fyne.io/systray" "github.com/wzshiming/jumpway/i18n" - "github.com/wzshiming/systray" ) func (a *App) ItemStatus(menu *systray.MenuItem) { diff --git a/app/tray/tray_system_proxy.go b/app/tray/tray_system_proxy.go index 87d2cb1..0c7208e 100644 --- a/app/tray/tray_system_proxy.go +++ b/app/tray/tray_system_proxy.go @@ -1,10 +1,10 @@ package tray import ( + "fyne.io/systray" "github.com/wzshiming/jumpway/i18n" "github.com/wzshiming/jumpway/log" "github.com/wzshiming/sysproxy" - "github.com/wzshiming/systray" ) func (a *App) ItemProxyMode(global, manual *systray.MenuItem) { diff --git a/app/tray/tray_view.go b/app/tray/tray_view.go index 6885968..760eb72 100644 --- a/app/tray/tray_view.go +++ b/app/tray/tray_view.go @@ -3,10 +3,10 @@ package tray import ( "fmt" + "fyne.io/systray" "github.com/pkg/browser" "github.com/wzshiming/jumpway/i18n" - "github.com/wzshiming/logger" - "github.com/wzshiming/systray" + "github.com/wzshiming/jumpway/log" ) func (a *App) ItemView(menu *systray.MenuItem) { @@ -14,7 +14,7 @@ func (a *App) ItemView(menu *systray.MenuItem) { for range menu.ClickedCh { err = browser.OpenURL(fmt.Sprintf("http://%s", a.Address)) if err != nil { - logger.Log.Error(err, i18n.ViewEditConfig()) + log.Error(err, i18n.ViewEditConfig()) } } } diff --git a/daemon/kind_darwin.go b/daemon/kind_darwin.go index d1dd390..fc9b3cb 100644 --- a/daemon/kind_darwin.go +++ b/daemon/kind_darwin.go @@ -1,3 +1,4 @@ +//go:build darwin // +build darwin package daemon diff --git a/daemon/kind_other.go b/daemon/kind_other.go index 8a6d086..5a46108 100644 --- a/daemon/kind_other.go +++ b/daemon/kind_other.go @@ -1,3 +1,4 @@ +//go:build !darwin // +build !darwin package daemon diff --git a/go.mod b/go.mod index 1dddd62..e738c8c 100644 --- a/go.mod +++ b/go.mod @@ -1,52 +1,50 @@ module github.com/wzshiming/jumpway -go 1.19 +go 1.21 require ( + fyne.io/systray v1.10.0 github.com/Xuanwo/go-locale v1.1.0 github.com/atotto/clipboard v0.1.4 - github.com/gorilla/handlers v1.5.1 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/handlers v1.5.2 + github.com/gorilla/mux v1.8.1 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/takama/daemon v1.0.0 - github.com/wzshiming/anyproxy v0.5.4 + github.com/wzshiming/anyproxy v0.7.13 github.com/wzshiming/bridge v0.7.13 - github.com/wzshiming/cmux v0.2.2 + github.com/wzshiming/cmux v0.3.2 github.com/wzshiming/hostmatcher v0.0.1 - github.com/wzshiming/httpcache v0.3.1 - github.com/wzshiming/logger v0.1.0 + github.com/wzshiming/httpcache v0.4.0 github.com/wzshiming/notify v0.1.1 github.com/wzshiming/openapiui/v2 v2.0.0 github.com/wzshiming/sysnotify v0.0.2 github.com/wzshiming/sysproxy v0.2.2 - github.com/wzshiming/systray v1.2.1 - golang.org/x/text v0.4.0 - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b + golang.org/x/text v0.14.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/Microsoft/go-winio v0.5.2 // indirect github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect - github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/go-logr/logr v0.3.0 // indirect - github.com/go-logr/zapr v0.3.0 // indirect + github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/godbus/dbus/v5 v5.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/tevino/abool v1.2.0 // indirect github.com/wzshiming/commandproxy v0.2.0 // indirect github.com/wzshiming/emux v0.2.1 // indirect - github.com/wzshiming/httpproxy v0.4.1 // indirect + github.com/wzshiming/httpproxy v0.5.4 // indirect github.com/wzshiming/schedialer v0.2.1 // indirect - github.com/wzshiming/shadowsocks v0.3.1 // indirect - github.com/wzshiming/socks4 v0.3.1 // indirect - github.com/wzshiming/socks5 v0.4.1 // indirect - github.com/wzshiming/sshd v0.2.1 // indirect - github.com/wzshiming/sshproxy v0.4.1 // indirect - github.com/wzshiming/trie v0.0.1 // indirect + github.com/wzshiming/shadowsocks v0.4.0 // indirect + github.com/wzshiming/socks4 v0.3.2 // indirect + github.com/wzshiming/socks5 v0.4.3 // indirect + github.com/wzshiming/sshd v0.2.2 // indirect + github.com/wzshiming/sshproxy v0.4.3 // indirect + github.com/wzshiming/trie v0.1.1 // indirect github.com/xtaci/smux v1.5.16 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.20.0 // indirect - golang.org/x/crypto v0.1.0 // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.15.0 // indirect + gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect ) diff --git a/go.sum b/go.sum index 7c43000..0979c9f 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +fyne.io/systray v1.10.0 h1:Yr1D9Lxeiw3+vSuZWPlaHC8BMjIHZXJKkek706AfYQk= +fyne.io/systray v1.10.0/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Xuanwo/go-locale v1.1.0 h1:51gUxhxl66oXAjI9uPGb2O0qwPECpriKQb2hl35mQkg= @@ -7,30 +8,23 @@ github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmH github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= -github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/zapr v0.3.0 h1:iyiCRZ29uPmbO7mWIjOEiYMXrTxZWTyK4tCatLyGpUY= -github.com/go-logr/zapr v0.3.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= +github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -38,12 +32,9 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -51,133 +42,103 @@ github.com/smartystreets/goconvey v1.6.7 h1:I6tZjLXD2Q1kjvNbIzB1wvQBsXmKXiVrhpRE github.com/smartystreets/goconvey v1.6.7/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/takama/daemon v1.0.0 h1:XS3VLnFKmqw2Z7fQ/dHRarrVjdir9G3z7BEP8osjizQ= github.com/takama/daemon v1.0.0/go.mod h1:gKlhcjbqtBODg5v9H1nj5dU1a2j2GemtuWSNLD5rxOE= -github.com/wzshiming/anyproxy v0.5.4 h1:xuaOh0GNF51yCia/9/jynLRzLGhaf1YkzJrAhudwj3w= -github.com/wzshiming/anyproxy v0.5.4/go.mod h1:BFB2Zvy6j+IGWVuhr8UJqPekB2LFENxdf30DRmFZ2fE= +github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA= +github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg= +github.com/wzshiming/anyproxy v0.7.13 h1:sJ1KZWvfEu+KHA7t0b/JPQIT5oARsfGrWKd4YVao8BE= +github.com/wzshiming/anyproxy v0.7.13/go.mod h1:sSiYmhS+NgA3H3/eNbLSWz4/7jXsaEeS7OKa7Dc+DpI= github.com/wzshiming/bridge v0.7.13 h1:jYKQKdCMJ7mZNVlNNGVmnGLyYbqI3QB8ekFOmf/xOKA= github.com/wzshiming/bridge v0.7.13/go.mod h1:CZcQiUnLQIWNXs+2F99A/oTEdEkeOX/4Kr3g8PH7+iI= -github.com/wzshiming/cmux v0.2.2 h1:U6IH96kRFxnnjy3duskHvp237o8cK6gILQYIROE3NI4= -github.com/wzshiming/cmux v0.2.2/go.mod h1:Vgdbl+BdSp0X3zHw3P+XW4sxyorR5y9NiKjRGRRnJdo= +github.com/wzshiming/cmux v0.3.2 h1:lBEWbfbRqUDdXB6Mro/g35kvCuUEmAgIdpGEuER3bis= +github.com/wzshiming/cmux v0.3.2/go.mod h1:lPhqJN2E3frzkxrPdjesxL09z7nTcuZ6i8Is+2G/Xw4= github.com/wzshiming/commandproxy v0.2.0 h1:uPVhgIj2YSncRUo6g9smGR6OMzsIg7lwklcMHPPmEeM= github.com/wzshiming/commandproxy v0.2.0/go.mod h1:wS6+aJ9KMHciqYX3xmDO0W+QVY0zvngeBvmoIFMfq8A= github.com/wzshiming/emux v0.2.1 h1:pu0oV9PpAJ5cVO8tzkqUXcCqc8xC452vNzQK9cghUis= github.com/wzshiming/emux v0.2.1/go.mod h1:VQF6NoR4nfm3+OrKZLx47JuxuDeWemHDc0a4qDNtFtg= github.com/wzshiming/hostmatcher v0.0.1 h1:vPrUEXsd+khvN5W7I4rJ73vYaUvnBCodvtuyCU+q1HQ= github.com/wzshiming/hostmatcher v0.0.1/go.mod h1:3EyfIDuzQyo0tqrCtcUkD5UvAsdxOUb/RbcYOiPTh1E= -github.com/wzshiming/httpcache v0.3.1 h1:BDWsOl2O5MaUi/GXarqWgjlEiZIgs1rgUqb7DA0oaXQ= -github.com/wzshiming/httpcache v0.3.1/go.mod h1:b5kBGWI1rExt9fgrc18ml+MGQtzn39OPgmxZNlQmd6I= -github.com/wzshiming/httpproxy v0.4.1 h1:6K78q0Vi+/GM4h9KygTGi7nuVn5Xgk5oHqjJyaGLHcQ= -github.com/wzshiming/httpproxy v0.4.1/go.mod h1:drZR+iQLfYsQi7/nETLjyB9Z0f5KDXQo2PEkJBbg3xQ= -github.com/wzshiming/logger v0.1.0 h1:dOXSCqtlhgbYIYtQUOmq13+R/Ikb4rtR8dfRvg6qp8s= -github.com/wzshiming/logger v0.1.0/go.mod h1:ZrCaVKS2W7/ivqWwOXmW7GuOlTe3jC6RCDyP48cJCqc= +github.com/wzshiming/httpcache v0.4.0 h1:PXJ7Tndytvhe9NSGREZ2VhV6EFuvvBpP97qRPGBYc9w= +github.com/wzshiming/httpcache v0.4.0/go.mod h1:wg2SnTIv4kJ52LiNOHX0VTNBvE+5ZeC2zU3jJ3Se9Bg= +github.com/wzshiming/httpproxy v0.5.4 h1:SPY9p3UWPPa/AsCMg1H/DpBBz8PbSUjHFc/a4ueV2zs= +github.com/wzshiming/httpproxy v0.5.4/go.mod h1:KAU986Jsa9Ap+R+RojjGQKvC6NveJ5Y7N1GTVOBM2Ck= github.com/wzshiming/notify v0.1.1 h1:rJXoszrkNglhCVyn/IfW500f5cW03q1q7YzL8hsLchI= github.com/wzshiming/notify v0.1.1/go.mod h1:SFhsQKZJznzsDcj/Qfo9A65k5IRcpUrpgbLRzZEa/DI= github.com/wzshiming/openapiui/v2 v2.0.0 h1:tE/aDJo7/he03lYbPMBqsshjvxP1Jg1twghEHDR2ZfY= github.com/wzshiming/openapiui/v2 v2.0.0/go.mod h1:wij15kw1O5SfHCqY6ZXzHIXks2lJTG4hn9higGt7WLc= github.com/wzshiming/schedialer v0.2.1 h1:DnAv8ta2UuWcvRy9sYwSt69rTuE3/kiCgwX6CiN5y4M= github.com/wzshiming/schedialer v0.2.1/go.mod h1:TvVxg4QZIBTJzRfmL/G7g6CzynFQKPmtXtSeJ2c4Lus= -github.com/wzshiming/shadowsocks v0.3.1 h1:K35RBGrn8OM1XwvpWOCeHGsbb0ZpQTOuBCO4GlQ6ISA= -github.com/wzshiming/shadowsocks v0.3.1/go.mod h1:56WQwfUpgC/HMhZFNOVTBCP9nbMvL5rAepKRIkSKPsg= -github.com/wzshiming/socks4 v0.3.1 h1:1QiCztWWvD5o+VQlpNKrkK1qM8NC2mo6LoeEJc1zUuY= -github.com/wzshiming/socks4 v0.3.1/go.mod h1:YEPfhjf/4JezwdTmgXZU+UX+A2KvD05quzhsUBVMNA0= -github.com/wzshiming/socks5 v0.4.1 h1:MZt9cIHSl3vsLufZDR3aZO3hbpCrylWk5XKAuUrgzbQ= -github.com/wzshiming/socks5 v0.4.1/go.mod h1:BvCAqlzocQN5xwLjBZDBbvWlrx8sCYSSbHEOf2wZgT0= -github.com/wzshiming/sshd v0.2.1 h1:oRwg07itnxcHYfB4EHn8rUQgiiGVClSbCsWPVfgn0AA= -github.com/wzshiming/sshd v0.2.1/go.mod h1:7+xrQ+XMfrKmInssZuqw1HDHGper+yWKnCAi4uljLns= -github.com/wzshiming/sshproxy v0.4.1 h1:UfD7y/soObWXWC6mo8/PuamqvunpYfufKbALsgsOoGs= -github.com/wzshiming/sshproxy v0.4.1/go.mod h1:lu1O03oRy8gXzP2neZXSZAIddZeynRLAIHLzZjZX/y8= +github.com/wzshiming/shadowsocks v0.4.0 h1:Yi+4J/DK15qdKlssNEMoWjtmc8wyY8ByIBbC5Ft29bQ= +github.com/wzshiming/shadowsocks v0.4.0/go.mod h1:xYRRSKR+hTihSDUOE+evavx0wkLVODTWVXEcz5vosoE= +github.com/wzshiming/socks4 v0.3.2 h1:w87nwfgRWteVwIH39nqTur8c+2dcODeLgLrWspcUkSc= +github.com/wzshiming/socks4 v0.3.2/go.mod h1:YEPfhjf/4JezwdTmgXZU+UX+A2KvD05quzhsUBVMNA0= +github.com/wzshiming/socks5 v0.4.3 h1:kVEvp9d7MzRcTh1W2BerPtcJGTjsP22Ar3xL129mM6E= +github.com/wzshiming/socks5 v0.4.3/go.mod h1:BvCAqlzocQN5xwLjBZDBbvWlrx8sCYSSbHEOf2wZgT0= +github.com/wzshiming/sshd v0.2.2 h1:jvKTwG3lCvhObcUiB98MGcca9VGH4+uU89V96YBr7LY= +github.com/wzshiming/sshd v0.2.2/go.mod h1:KnH7PobIFZ89iTnhLhFl3KUQNqxFTrO7dyDQ6jctVO8= +github.com/wzshiming/sshproxy v0.4.3 h1:RTm/yr0fo9Tx1VpjP1zkVh8ZWWdD2BNwdG/armjbzX8= +github.com/wzshiming/sshproxy v0.4.3/go.mod h1:XYf7TaHNWK/wkML1bYT61ofSHZbRw5ncIQd7Lk+FLCM= github.com/wzshiming/sysnotify v0.0.2 h1:a5h1lm2D35Sof8MaM0htjwFRNNqkx42o3pgsoARRcEo= github.com/wzshiming/sysnotify v0.0.2/go.mod h1:wV51YHA43Y1rhnhTi4qdpyPMoyG+sB1bAGORkANLW5I= github.com/wzshiming/sysproxy v0.2.2 h1:OOZ7jRier8qA5U5hnzHwJCLlZleWqdqiNKEhJY+0H1E= github.com/wzshiming/sysproxy v0.2.2/go.mod h1:Epx6hex0nK1YhLHDnIhrhusgCtBQFR2NQPhM8WlMDTc= -github.com/wzshiming/systray v1.2.1 h1:VHt4DA9+6GBbv/zW/kcP2azYU71i5eFXNMntrKSSnNI= -github.com/wzshiming/systray v1.2.1/go.mod h1:Kyt+ovrTuHHlcF42YLu37TaP9NS5gyJcvpa8VQbX8zQ= -github.com/wzshiming/trie v0.0.1 h1:6xnhRyO5tZWR6aKjEpFfm8KSNNHYsNbpKrY1+NdyHME= -github.com/wzshiming/trie v0.0.1/go.mod h1:Z20IrQFTHnjWz//dssIoiEPWInBZFyuFlPOFPxV0Rec= -github.com/wzshiming/trie v0.1.0 h1:+/icosRlXg7qRp8pQOyd6zD8cPO9cfR4mOJlmI5peq4= -github.com/wzshiming/trie v0.1.0/go.mod h1:c9thxXTh4KcGkejt4sUsO4c5GUmWpxeWzOJ7AZJaI+8= +github.com/wzshiming/trie v0.1.1 h1:02AaBSZGhs6Aqljp8fz4xq/Mg8omFBPIlrUS0pJ11ks= +github.com/wzshiming/trie v0.1.1/go.mod h1:c9thxXTh4KcGkejt4sUsO4c5GUmWpxeWzOJ7AZJaI+8= github.com/xtaci/smux v1.5.16 h1:FBPYOkW8ZTjLKUM4LI4xnnuuDC8CQ/dB04HD519WoEk= github.com/xtaci/smux v1.5.16/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= -go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211023085530-d6a326fbbf70/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/log/log.go b/log/log.go index ce9c62c..9c25e4e 100644 --- a/log/log.go +++ b/log/log.go @@ -1,36 +1,47 @@ package log import ( + "log/slog" "os" + "sync" "github.com/wzshiming/jumpway" "github.com/wzshiming/jumpway/i18n" - "github.com/wzshiming/logger" - "github.com/wzshiming/logger/zap" "github.com/wzshiming/sysnotify" ) +var ( + logger = slog.New(slog.NewTextHandler(os.Stderr, nil)) + mut sync.RWMutex +) + func Redirect(logfile string) error { f, err := os.OpenFile(logfile, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { return err } - Info(i18n.RedirectLog(), "file", logfile) - logger.SetLogger(zap.WithOut(zap.Log, f)) - os.Stdout = f - os.Stderr = f + mut.Lock() + defer mut.Unlock() + + logger = slog.New(slog.NewTextHandler(f, nil)) return nil } func Error(err error, msg string, keysAndValues ...interface{}) { - logger.Log.Error(err, msg, keysAndValues...) + mut.RLock() + defer mut.RUnlock() + + logger.Error(msg, append([]any{"err", err}, keysAndValues...)) e := sysnotify.Alert(jumpway.AppName+" "+msg, err.Error(), "") if e != nil { - logger.Log.Error(err, i18n.Alert(msg), keysAndValues...) + logger.Error(i18n.Alert(msg), "err", e) } } func Info(msg string, keysAndValues ...interface{}) { - logger.Log.Info(msg, keysAndValues...) + mut.RLock() + defer mut.RUnlock() + + logger.Info(msg, keysAndValues...) }