diff --git a/client.go b/client.go index e196228..b48268c 100644 --- a/client.go +++ b/client.go @@ -31,17 +31,15 @@ type Client struct { gormClient *dorm.GormClient // 数据库 zapLog *golog.ZapLog // 日志服务 config struct { - systemHostName string // 主机名 - systemInsideIp string // 内网ip - systemOs string // 系统类型 - systemArch string // 系统架构 - systemCpuQuantity int // cpu核数 - goVersion string // go版本 - sdkVersion string // sdk版本 - systemMacAddrS string // Mac地址 - systemOutsideIp string // 外网ip - debug bool // 日志开关 - jsonStatus bool // json状态 + systemHostName string // 主机名 + systemInsideIp string // 内网ip + systemOs string // 系统类型 + systemArch string // 系统架构 + goVersion string // go版本 + sdkVersion string // sdk版本 + systemOutsideIp string // 外网ip + debug bool // 日志开关 + jsonStatus bool // json状态 } cache struct { redisClient *dorm.RedisClient // 数据库 diff --git a/cofing.go b/cofing.go index 00c1a9d..6368a37 100644 --- a/cofing.go +++ b/cofing.go @@ -2,8 +2,8 @@ package gojobs import ( "context" - "go.dtapp.net/goarray" "go.dtapp.net/goip" + "os" "runtime" ) @@ -11,8 +11,8 @@ func (c *Client) setConfig(ctx context.Context) { c.config.sdkVersion = Version c.config.systemOs = runtime.GOOS c.config.systemArch = runtime.GOARCH - c.config.systemCpuQuantity = runtime.GOMAXPROCS(0) c.config.goVersion = runtime.Version() - c.config.systemMacAddrS = goarray.TurnString(goip.GetMacAddr(ctx)) c.config.systemInsideIp = goip.GetInsideIp(ctx) + hostname, _ := os.Hostname() + c.config.systemHostName = hostname } diff --git a/const.go b/const.go index b6b0c7c..3ccb9d0 100644 --- a/const.go +++ b/const.go @@ -1,6 +1,6 @@ package gojobs const ( - Version = "1.0.95" + Version = "1.0.96" SpecifyIpNull = "0.0.0.0" ) diff --git a/go.mod b/go.mod index ae4c837..d0c43fb 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/jasonlvhit/gocron v0.0.1 github.com/robfig/cron/v3 v3.0.1 go.dtapp.net/dorm v1.0.38 - go.dtapp.net/goarray v1.0.1 go.dtapp.net/goip v1.0.34 go.dtapp.net/golog v1.0.82 go.dtapp.net/gostring v1.0.10 diff --git a/go.sum b/go.sum index a2e353d..f80c945 100644 --- a/go.sum +++ b/go.sum @@ -518,8 +518,6 @@ github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxt github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.dtapp.net/dorm v1.0.38 h1:9OgWY5bnar6D0Xdho62xn7RluXJNe8i7Kz/IeSUObF4= go.dtapp.net/dorm v1.0.38/go.mod h1:z9ksZ4Y0HHH0odjEiG57d90/ZUBM51qXEWJC8fS+dEM= -go.dtapp.net/goarray v1.0.1 h1:cHNHaJ2MFcuJPA1WKU2PM1EUZShS1vQqEH7n6YXsQVU= -go.dtapp.net/goarray v1.0.1/go.mod h1:/MPhlFCAhQyeNV1M0v1PAOOX33Sg705fVjUgMO12IBQ= go.dtapp.net/goip v1.0.34 h1:aW2CuPpQwcDOJiyx/gHbvrha3/x+poFRpDxsLtO4EVw= go.dtapp.net/goip v1.0.34/go.mod h1:EctL6B8ue/kZKPr+kKZPU6YTTpNhihane9BHHffwo6Q= go.dtapp.net/golog v1.0.82 h1:VSWaZLYjmtnI7h6cp9HGXrp+CVW+zS7Wii5kGd9sY88= diff --git a/vendor/go.dtapp.net/goarray/.drone.yml b/vendor/go.dtapp.net/goarray/.drone.yml deleted file mode 100644 index c56c479..0000000 --- a/vendor/go.dtapp.net/goarray/.drone.yml +++ /dev/null @@ -1,17 +0,0 @@ -kind: pipeline -type: docker -name: clone - -steps: - - name: Test - image: golang:1.18 - commands: - - go env -w GO111MODULE=on - - go env -w GOPROXY=https://goproxy.cn,direct - - go test -v ./... - - name: Benchmark - image: golang:1.18 - commands: - - go env -w GO111MODULE=on - - go env -w GOPROXY=https://goproxy.cn,direct - - go test -bench=. -benchmem \ No newline at end of file diff --git a/vendor/go.dtapp.net/goarray/.gitignore b/vendor/go.dtapp.net/goarray/.gitignore deleted file mode 100644 index 442794a..0000000 --- a/vendor/go.dtapp.net/goarray/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.env -.git -.svn -.idea -.vscode -*.log -gomod.sh -/vendor/ \ No newline at end of file diff --git a/vendor/go.dtapp.net/goarray/LICENSE b/vendor/go.dtapp.net/goarray/LICENSE deleted file mode 100644 index ff84bbf..0000000 --- a/vendor/go.dtapp.net/goarray/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 李光春 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/go.dtapp.net/goarray/README.md b/vendor/go.dtapp.net/goarray/README.md deleted file mode 100644 index cdf4275..0000000 --- a/vendor/go.dtapp.net/goarray/README.md +++ /dev/null @@ -1,17 +0,0 @@ -

-Golang Array -

- -📦 Golang Array - -[comment]: <> (go) -[![godoc](https://pkg.go.dev/badge/go.dtapp.net/goarray?status.svg)](https://pkg.go.dev/go.dtapp.net/goarray) -[![goproxy.cn](https://goproxy.cn/stats/go.dtapp.net/goarray/badges/download-count.svg)](https://goproxy.cn/stats/go.dtapp.net/goarray) -[![goreportcard.com](https://goreportcard.com/badge/go.dtapp.net/goarray)](https://goreportcard.com/report/go.dtapp.net/goarray) -[![deps.dev](https://img.shields.io/badge/deps-go-red.svg)](https://deps.dev/go/go.dtapp.net%2Fgoarray) - -#### 安装 - -```go -go get -v -u go.dtapp.net/goarray -``` diff --git a/vendor/go.dtapp.net/goarray/goarray.go b/vendor/go.dtapp.net/goarray/goarray.go deleted file mode 100644 index 46ababd..0000000 --- a/vendor/go.dtapp.net/goarray/goarray.go +++ /dev/null @@ -1,31 +0,0 @@ -package goarray - -func Grouping() { - -} - -// TurnString []string 转 string -func TurnString(ss []string) (s string) { - sl := len(ss) - for k, v := range ss { - if k+1 == sl { - s = s + v - } else { - s = s + v + "," - } - } - return s -} - -// RemoveDuplicateElement 去重 -func RemoveDuplicateElement[T string | int | int16 | int32](ss []T) []T { - result := make([]T, 0, len(ss)) - temp := map[T]struct{}{} - for _, item := range ss { - if _, ok := temp[item]; !ok { - temp[item] = struct{}{} - result = append(result, item) - } - } - return result -} diff --git a/vendor/go.dtapp.net/goarray/version.go b/vendor/go.dtapp.net/goarray/version.go deleted file mode 100644 index 181e0a9..0000000 --- a/vendor/go.dtapp.net/goarray/version.go +++ /dev/null @@ -1,3 +0,0 @@ -package goarray - -const Version = "1.0.1" diff --git a/vendor/modules.txt b/vendor/modules.txt index 4135783..c0371cb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -257,9 +257,6 @@ github.com/youmark/pkcs8 # go.dtapp.net/dorm v1.0.38 ## explicit; go 1.19 go.dtapp.net/dorm -# go.dtapp.net/goarray v1.0.1 -## explicit; go 1.18 -go.dtapp.net/goarray # go.dtapp.net/goip v1.0.34 ## explicit; go 1.19 go.dtapp.net/goip