diff --git a/cmd/copy.go b/cmd/copy.go index 63a5b8f..2eb1503 100644 --- a/cmd/copy.go +++ b/cmd/copy.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "strings" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -37,13 +38,13 @@ var copyCmd = &cobra.Command{ Long: `将src文件传输到远程目标主机dest路径, eg: ./xp cli copy 127.0.0.1 -u lxp -S /tmp/123 -D /tmp/333`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if cliSrc == "" || cliDest == "" { - log.Error("src or dest is not config") + slog.Error("src or dest is not config") os.Exit(1) } - log.Debugln("items", cliItem) + slog.Debug("items", cliItem) var items []interface{} if cliItem != "" { diff --git a/cmd/fetch.go b/cmd/fetch.go index 39790c8..93b6516 100644 --- a/cmd/fetch.go +++ b/cmd/fetch.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,11 +16,12 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "strings" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -31,13 +32,13 @@ var fetchCmd = &cobra.Command{ Long: `官方文档:https://docs.ansible.com/ansible/latest/modules/fetch_module.html#fetch-module eg: ./xp cli fetch 127.0.0.1 -u lxp -S /tmp/123 -D /tmp/333`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if cliSrc == "" || cliDest == "" { - log.Error("src or dest is not config") + slog.Error("src or dest is not config") os.Exit(1) } - log.Debugln("items", cliItem) + slog.Debug("items", cliItem) var items []interface{} if cliItem != "" { diff --git a/cmd/image.go b/cmd/image.go index 4cd942e..2395a95 100644 --- a/cmd/image.go +++ b/cmd/image.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -35,9 +36,9 @@ var imageCmd = &cobra.Command{ Short: "基于docker容器进行命令执行", Long: `本机docker执行pipeline命令`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if imageIE == "" { - log.Error("未检测到执行命令,请确认! [eg: ./xp cli image -i java:8 -a \"-v /tmp:/data -u root \" java -version && for i in {1..10};do echo `date`;sleep 1;done]") + slog.Error("未检测到执行命令,请确认! [eg: ./xp cli image -i java:8 -a \"-v /tmp:/data -u root \" java -version && for i in {1..10};do echo `date`;sleep 1;done]") os.Exit(1) } diff --git a/cmd/palybook.go b/cmd/palybook.go index f6f072b..c0ebbed 100644 --- a/cmd/palybook.go +++ b/cmd/palybook.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,8 +16,9 @@ limitations under the License. package cmd import ( + "log/slog" + "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -27,7 +28,7 @@ var playbookCmd = &cobra.Command{ Short: "开发测试模块", Long: `测试ansile-playbook功能和pipeline流程管控`, Run: func(cmd *cobra.Command, args []string) { - log.Debugln("playbook called") + slog.Debug("playbook called") // fmt.Printf("%v %v\n", viper.GetStringSlice("stage"), viper.AllSettings()) // 根据yaml解析shell等模块,进行动态匹配,进行顺序执行 diff --git a/cmd/root.go b/cmd/root.go index 09b417a..147c0a4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,15 +16,12 @@ limitations under the License. package cmd import ( - "fmt" + "log/slog" "os" - "time" "github.com/spf13/cobra" _ "github.com/devopsxp/xp/module" - "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) @@ -55,7 +52,7 @@ to quickly create a Cobra application.`, // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { if err := rootCmd.Execute(); err != nil { - log.Errorln(err) + slog.Error(err.Error()) os.Exit(1) } } @@ -82,40 +79,6 @@ func init() { // initConfig reads in config file and ENV variables if set. func initConfig() { - customFormatter := new(log.TextFormatter) - customFormatter.TimestampFormat = "2006-01-02 15:04:05" - // Log as JSON instead of the default ASCII formatter. - log.SetFormatter(customFormatter) - customFormatter.FullTimestamp = true // 显示时间 - // customFormatter.ForceQuote = true // 强制格式匹配 - // customFormatter.PadLevelText = true // 显示完整日志级别 - - // Output to stdout instead of the default stderr - // Can be any io.Writer, see below for File example - if islog { - file, err := os.OpenFile(fmt.Sprintf("%s.log", time.Now().Format("20060102150405")), os.O_WRONLY|os.O_APPEND|os.O_CREATE|os.O_SYNC, 0600) - if err != nil { - panic(err) - } - - info, err := file.Stat() - if err != nil { - panic(err) - } - - fileWriter := utils.LogFileWriter{file, info.Size()} - log.SetOutput(fileWriter) - } else { - log.SetOutput(os.Stdout) - } - - // log format setting - if debug { - log.SetLevel(log.DebugLevel) - } else { - log.SetLevel(log.InfoLevel) - } - if cfgFile != "" { // Use config file from the flag. viper.SetConfigFile(cfgFile) @@ -136,8 +99,8 @@ func initConfig() { // If a config file is found, read it in. if err := viper.ReadInConfig(); err == nil { - log.Debugln("Using config file:", viper.ConfigFileUsed()) + slog.Debug("Using config file:", viper.ConfigFileUsed()) } else { - log.Errorf("Using config file error: %s\n", err.Error()) + slog.Error("Using config file error", "ERROR", err.Error()) } } diff --git a/cmd/script.go b/cmd/script.go index 9d92c04..3ebbc5b 100644 --- a/cmd/script.go +++ b/cmd/script.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -31,12 +32,12 @@ var scriptCmd = &cobra.Command{ Short: "远程执行脚本", Long: `eg: ./xp cli script 127.0.0.1 -a "test.sh"`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if script == "" { - log.Error("未指定需要执行的脚本路径") + slog.Error("未指定需要执行的脚本路径") os.Exit(1) } else if len(args) == 0 { - log.Error("未检测到目标主机,请确认! [eg: ./xp cli script 127.0.0.1-20 -a test.sh]") + slog.Error("未检测到目标主机,请确认! [eg: ./xp cli script 127.0.0.1-20 -a test.sh]") os.Exit(1) } diff --git a/cmd/shell.go b/cmd/shell.go index 8b95ef2..b8a457e 100644 --- a/cmd/shell.go +++ b/cmd/shell.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -34,12 +35,12 @@ var shellCmd = &cobra.Command{ Short: "执行远程命令", Long: `example: ./xp cli shell 127.0.0.1-20 192.168.50.1-10 -a "zsh" -T -L console`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if cliShell == "" { - log.Error("未检测到执行命令,请确认! [eg: ./xp cli shell 127.0.0.1-20 -a \"hostname\"]") + slog.Error("未检测到执行命令,请确认! [eg: ./xp cli shell 127.0.0.1-20 -a \"hostname\"]") os.Exit(1) } else if len(args) == 0 { - log.Error("未检测到目标主机,请确认! [eg: ./xp cli shell 127.0.0.1-20 -a \"hostname\"]") + slog.Error("未检测到目标主机,请确认! [eg: ./xp cli shell 127.0.0.1-20 -a \"hostname\"]") os.Exit(1) } // TODO: 完成数据Message.Data模型拼装 diff --git a/cmd/systemd.go b/cmd/systemd.go index 3fe7d7e..3690ee4 100644 --- a/cmd/systemd.go +++ b/cmd/systemd.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -37,12 +38,12 @@ var systemdCmd = &cobra.Command{ Long: `官方文档:https://docs.ansible.com/ansible/latest/modules/service_module.html#service-module eg: ./xp cli systemd -n docker -s restart -r -e`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if systemdService == "" { - log.Error("未指定需要操作的服务名") + slog.Error("未指定需要操作的服务名") os.Exit(1) } else if len(args) == 0 { - log.Error("未检测到目标主机,请确认! [eg: ./xp cli systemd 127.0.0.1-20 -n docker -s status]") + slog.Error("未检测到目标主机,请确认! [eg: ./xp cli systemd 127.0.0.1-20 -n docker -s status]") os.Exit(1) } diff --git a/cmd/template.go b/cmd/template.go index 8d6dfa0..db93744 100644 --- a/cmd/template.go +++ b/cmd/template.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" ) @@ -64,9 +65,9 @@ COMMITINFO: {{.info}} {{end}} #==============================DEMO=================================`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v Vars: %v", args, viper.GetStringMap("vars")) + slog.Debug(fmt.Sprintf("Cli args: %v Vars: %v", args, viper.GetStringMap("vars"))) if cliSrc == "" || cliDest == "" { - log.Error("src or dest is not config") + slog.Error("src or dest is not config") os.Exit(1) } diff --git a/cmd/user.go b/cmd/user.go index 19548e0..dac235a 100644 --- a/cmd/user.go +++ b/cmd/user.go @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -16,10 +16,11 @@ limitations under the License. package cmd import ( + "fmt" + "log/slog" "os" "github.com/devopsxp/xp/pipeline" - log "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) @@ -43,12 +44,12 @@ var userCmd = &cobra.Command{ Short: "远程批量用户管理", Long: `官方文档:https://docs.ansible.com/ansible/latest/modules/user_module.html#user-module`, Run: func(cmd *cobra.Command, args []string) { - log.Debugf("Cli args: %v", args) + slog.Debug(fmt.Sprintf("Cli args: %v", args)) if systemdService == "" { - log.Error("未指定需要操作的服务名") + slog.Error("未指定需要操作的服务名") os.Exit(1) } else if len(args) == 0 { - log.Error("未检测到目标主机,请确认! [eg: ./xp cli systemd 127.0.0.1-20 -n docker -s status]") + slog.Error("未检测到目标主机,请确认! [eg: ./xp cli systemd 127.0.0.1-20 -n docker -s status]") os.Exit(1) } diff --git a/go.mod b/go.mod index 9224db3..1413533 100644 --- a/go.mod +++ b/go.mod @@ -1,26 +1,19 @@ module github.com/devopsxp/xp -go 1.15 +go 1.21.6 require ( - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/briandowns/spinner v1.11.1 - github.com/fatih/color v1.10.0 // indirect - github.com/go-ole/go-ole v1.2.4 // indirect - github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect - github.com/imdario/mergo v0.3.11 // indirect github.com/lflxp/lflxp-kubectl v0.0.0-20200324075201-2c87c15ee42c github.com/mattbaird/jsonpatch v0.0.0-20200820163806-098863c1fc24 github.com/mitchellh/go-homedir v1.1.0 + github.com/pingcap/log v1.1.0 github.com/pkg/sftp v1.12.0 github.com/satori/go.uuid v1.2.0 github.com/shirou/gopsutil v3.20.10+incompatible - github.com/sirupsen/logrus v1.7.0 github.com/spf13/cobra v1.1.1 github.com/spf13/viper v1.7.1 golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd - golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect - gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.25.3 @@ -28,4 +21,67 @@ require ( k8s.io/client-go v0.25.3 ) +require ( + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful/v3 v3.8.0 // indirect + github.com/fatih/color v1.10.0 // indirect + github.com/fsnotify/fsnotify v1.4.7 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-ole/go-ole v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/swag v0.19.14 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/imdario/mergo v0.3.11 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/kr/fs v0.1.0 // indirect + github.com/magiconair/properties v1.8.1 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/pelletier/go-toml v1.2.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/spf13/afero v1.2.2 // indirect + github.com/spf13/cast v1.3.0 // indirect + github.com/spf13/jwalterweatherman v1.0.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.7.0 // indirect + go.uber.org/zap v1.19.0 // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect + golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.28.0 // indirect + gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/ini.v1 v1.51.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/klog/v2 v2.70.1 // indirect + k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) + replace github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.1.0 diff --git a/go.sum b/go.sum index cbf85b3..885554c 100644 --- a/go.sum +++ b/go.sum @@ -13,18 +13,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,19 +32,9 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.27/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -66,12 +44,11 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -85,9 +62,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -102,7 +76,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/spdystream v0.0.0-20181023171402-6480d4af844c/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20200315184450-1f3cb6622dad/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= @@ -110,20 +83,14 @@ github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -132,7 +99,6 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -141,27 +107,22 @@ github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNI github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -169,8 +130,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -184,15 +143,11 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -202,11 +157,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -214,8 +165,6 @@ github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -223,31 +172,18 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1ks85zJ1lfDGgIiMDuIptTOhJq+zKyg= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -269,10 +205,7 @@ github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -338,7 +271,6 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -346,35 +278,25 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nsf/termbox-go v0.0.0-20190325093121-288510b9734e/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pingcap/errors v0.11.0 h1:DCJQB8jrHbQ1VVlMFIrbj2ApScNNotVmkSNplu2yUt4= +github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pingcap/log v1.1.0 h1:ELiPxACz7vdo1qAvvaWJg1NrYFoY6gqAh/+Uo6aXdD8= +github.com/pingcap/log v1.1.0/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -395,7 +317,6 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -408,8 +329,6 @@ github.com/shirou/gopsutil v3.20.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= -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= github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= @@ -434,13 +353,12 @@ github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= @@ -451,21 +369,25 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -475,8 +397,6 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd h1:XcWmESyNjXJMLahc3mqVQJcgSTDxFxhETVlfk9uGc38= golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -500,9 +420,8 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -511,14 +430,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -545,25 +458,11 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -571,16 +470,6 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 h1:RerP+noqYHUQ8CMRcPlC2nvTa4dcBIjegkuWdcUDuqg= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -592,13 +481,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/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.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -612,11 +497,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -633,37 +514,9 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/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-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/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-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.0.0-20220818161305-2296e01440c6 h1:Sx/u41w+OwrInGdEckYmEuU5gHoGSL4QbDz3S9s6j4U= golang.org/x/sys v0.0.0-20220818161305-2296e01440c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -671,9 +524,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -699,6 +549,7 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -719,7 +570,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -727,21 +577,9 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -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-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -762,18 +600,6 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -805,39 +631,13 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -850,20 +650,6 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -876,7 +662,6 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= @@ -888,19 +673,18 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -927,17 +711,13 @@ k8s.io/apimachinery v0.25.3/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqw k8s.io/client-go v0.0.0-20180501182648-01d6a1350dd5/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= k8s.io/utils v0.0.0-20200322164244-327a8059b905/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/module/cli_input.go b/module/cli_input.go index 15f4e86..fc4dab6 100644 --- a/module/cli_input.go +++ b/module/cli_input.go @@ -1,6 +1,8 @@ package module import ( + "fmt" + "log/slog" "reflect" "runtime" "sync" @@ -8,7 +10,6 @@ import ( "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) // 1. 获取cli参数 @@ -31,7 +32,7 @@ type CliInput struct { func (c *CliInput) Receive() *plugin.Message { if c.status != plugin.Started { - log.Warnln("LocalYaml input plugin is not running,input nothing.") + slog.Warn("LocalYaml input plugin is not running,input nothing.") return nil } @@ -47,7 +48,7 @@ func (c *CliInput) SetConnectStatus(ip, status string) { func (c *CliInput) Start() { c.faileds = 0 c.status = plugin.Started - log.Debugln("LocalYamlInput plugin started.") + slog.Debug("LocalYamlInput plugin started.") // Check all ipsl.yaml. // TODO: error 没有viper取配置了 @@ -68,8 +69,8 @@ func (c *CliInput) Start() { var wg sync.WaitGroup - log.Infoln("******************************************************** TASK [CliCheck : 主机状态检测] ********************************************************") - log.Infof("LocalYaml Input 插件开始执行ssh目标主机状态扫描,并发数: %d", 5*runtime.NumCPU()) + slog.Info("******************************************************** TASK [CliCheck : 主机状态检测] ********************************************************") + slog.Info("LocalYaml Input 插件开始执行ssh目标主机状态扫描", "并发数", 5*runtime.NumCPU()) for n, i := range ips { wg.Add(1) @@ -78,10 +79,10 @@ func (c *CliInput) Start() { defer wg.Done() now := time.Now() if utils.ScanPort(ip, port) { - log.Infof("%d: Ssh check %s:%d success 耗时: %v", num, ip, port, time.Now().Sub(now)) + slog.Info(fmt.Sprintf("%d: Ssh check %s:%d success 耗时: %v", num, ip, port, time.Now().Sub(now))) c.SetConnectStatus(ip, "success") } else { - log.Infof("%d: Ssh check %s:%d failed 耗时:%v", num, ip, port, time.Now().Sub(now)) + slog.Info(fmt.Sprintf("%d: Ssh check %s:%d failed 耗时:%v", num, ip, port, time.Now().Sub(now))) c.faileds += 1 c.SetConnectStatus(ip, "failed") } @@ -89,7 +90,7 @@ func (c *CliInput) Start() { }(i, n) if n%10 == 0 { - log.Infof("已完成 %d 主机连接测试, 当前GoRoutine数量: %d", n, runtime.NumGoroutine()) + slog.Info(fmt.Sprintf("已完成 %d 主机连接测试, 当前GoRoutine数量: %d", n, runtime.NumGoroutine())) } } diff --git a/module/console_output.go b/module/console_output.go index d57e964..f685026 100644 --- a/module/console_output.go +++ b/module/console_output.go @@ -1,11 +1,12 @@ package module import ( + "fmt" + "log/slog" "reflect" "github.com/devopsxp/xp/pkg/k8s" "github.com/devopsxp/xp/plugin" - log "github.com/sirupsen/logrus" ) func init() { @@ -21,13 +22,13 @@ type ConsoleOutput struct { func (c *ConsoleOutput) Send(msgs *plugin.Message) { if c.status != plugin.Started { - log.Warnln("Console output is not running, output nothing.") + slog.Warn("Console output is not running, output nothing.") return } - // log.Printf("Output:\n\tHeader: %+v, Body: %+v\n", msgs.Data.Raw, msgs.Data.Target) + // slog.Printf("Output:\n\tHeader: %+v, Body: %+v\n", msgs.Data.Raw, msgs.Data.Target) // c.SetType("console").SetTarget("stdout").Send(msgs) - log.Info("ConsoleOutput Output 插件开始执行目标主机,并发数: 1") + slog.Info("ConsoleOutput Output 插件开始执行目标主机,并发数: 1") // 全局动态变量 var vars map[string]interface{} @@ -47,10 +48,10 @@ func (c *ConsoleOutput) Send(msgs *plugin.Message) { NewHookAdapter(nil).SetType("count").Send(msgs) if ns, ok := msgs.Tmp["namespace"]; ok { if name, ok := msgs.Tmp["name"]; ok { - log.Infof("Pipeline Success,清理 Namespace: %s Pod: %s", ns, name) + slog.Info(fmt.Sprintf("Pipeline Success,清理 Namespace: %s Pod: %s", ns, name)) err := k8s.DeletePod(ns, name) if err != nil { - log.Errorf("Pipeline 清理失败, Namespace: %s Pod: %s %s", ns, name, err.Error()) + slog.Error(fmt.Sprintf("Pipeline 清理失败, Namespace: %s Pod: %s %s", ns, name, err.Error())) } } } @@ -61,28 +62,22 @@ func (c *ConsoleOutput) Send(msgs *plugin.Message) { case "email": email, err := NewEmail(types.(map[interface{}]interface{}), msgs, vars) if err != nil { - log.WithFields(log.Fields{ - "plugin": "console_output", - "type": "email", - }).Errorln(err) + slog.Error(err.Error()) } else { NewHookAdapter(email).SetType("email").Send(msgs) } case "wechat": wechat, err := NewWechat(types.(map[interface{}]interface{}), msgs, vars) if err != nil { - log.WithFields(log.Fields{ - "plugin": "console_output", - "type": "wechat", - }).Errorln(err) + slog.Error(err.Error()) } else { NewHookAdapter(wechat).SetType("wechat").Send(msgs) } default: - log.Warnf("未适配该类型的hooks: %s", t.(string)) + slog.Warn(fmt.Sprintf("未适配该类型的hooks: %s", t.(string))) } } else { - log.Errorln("hooks 配置内容不包含[type]字段,请检查!") + slog.Error("hooks 配置内容不包含[type]字段,请检查!") break } } diff --git a/module/hooks.go b/module/hooks.go index 84fdfe7..cade62d 100644 --- a/module/hooks.go +++ b/module/hooks.go @@ -1,10 +1,11 @@ package module import ( + "fmt" + "log/slog" "time" "github.com/devopsxp/xp/plugin" - log "github.com/sirupsen/logrus" ) // 对外接口 @@ -40,29 +41,29 @@ func (h *hook) Send(msg *plugin.Message) { switch h.Type { case "count": for k, v := range msg.Count { - log.Warnf("%s : ok=%d changed=%d failed=%d skipped=%d rescued=%d ignored=%d", k, v["ok"], v["changed"], v["failed"], v["skipped"], v["rescued"], v["ignored"]) + slog.Warn("%s : ok=%d changed=%d failed=%d skipped=%d rescued=%d ignored=%d", k, v["ok"], v["changed"], v["failed"], v["skipped"], v["rescued"], v["ignored"]) } - log.Warnf("count日志耗时:%v", time.Now().Sub(h.start)) + slog.Warn("count日志耗时:%v", time.Now().Sub(h.start)) case "console": - log.Debugf("console hook send %v\n", msg.Data.Check) + slog.Debug(fmt.Sprintf("console hook send %v\n", msg.Data.Check)) for k, v := range msg.CallBack { - log.Warnln(k, v) + slog.Warn(k, v) } - log.Warnf("console日志耗时:%v", time.Now().Sub(h.start)) + slog.Warn("console日志耗时:%v", time.Now().Sub(h.start)) default: - log.Debugln("email hook send") + slog.Debug("email hook send") status := h.IsCurrent() if !status { - log.Warnln("不在发送时间,停止发送") + slog.Warn("不在发送时间,停止发送") } else { rs, err := h.SpecificSend() if err != nil { - log.Errorln(err) + slog.Error(err.Error()) } else { - log.Warnln(rs) + slog.Warn(rs) } } - log.Warnf("%s 发送耗时:%v", h.Type, time.Now().Sub(h.start)) + slog.Warn("%s 发送耗时:%v", h.Type, time.Now().Sub(h.start)) } } diff --git a/module/hooks_email.go b/module/hooks_email.go index 1679766..d0656aa 100644 --- a/module/hooks_email.go +++ b/module/hooks_email.go @@ -4,12 +4,11 @@ import ( "errors" "fmt" "io/ioutil" + "log/slog" "strconv" "strings" "time" - log "github.com/sirupsen/logrus" - "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/utils" "gopkg.in/gomail.v2" @@ -100,7 +99,7 @@ func NewEmail(data map[interface{}]interface{}, msg *plugin.Message, vars map[st vars["logs"] = msg.CallBack temp, err := utils.ApplyTemplate(text.(string), vars) if err != nil { - log.Debugf("告警模板解析失败: %s", err.Error()) + slog.Debug(fmt.Sprintf("告警模板解析失败: %s", err.Error())) return result, err } result.Body = temp @@ -124,7 +123,7 @@ func NewEmail(data map[interface{}]interface{}, msg *plugin.Message, vars map[st temp, err := utils.ApplyTemplate(string(tempFile), vars) if err != nil { - log.Debugf("告警模板解析失败: %s", err.Error()) + slog.Debug(fmt.Sprintf("告警模板解析失败: %s", err.Error())) return result, err } result.Body = temp @@ -156,11 +155,7 @@ func (this *Email) SpecificSend() (string, error) { err := d.DialAndSend(m) // log.Println("邮件发送结果", err) - log.WithFields(log.Fields{ - "uuid": this.Sid, - "type": "email", - "method": "SpecificSend", - }).Info("邮件发送结果", err) + slog.Info("邮件发送结果", "ERROR", err) // if err != nil { // this.CallBack(this.Sid, err.Error()) @@ -184,7 +179,7 @@ func (this *Email) IsCurrent() bool { tmp := strings.Split(this.Range, "|") rangeTime, err := utils.TransformCHN(strings.Split(tmp[0], ",")) if err != nil { - log.Println(err.Error()) + slog.Info(err.Error()) return rs } now := time.Now() diff --git a/module/hooks_wechat.go b/module/hooks_wechat.go index d7cea0c..afa5446 100644 --- a/module/hooks_wechat.go +++ b/module/hooks_wechat.go @@ -5,14 +5,15 @@ package module import ( "encoding/json" "errors" + "fmt" "io/ioutil" + "log/slog" "net/http" "strings" "time" "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) type Text struct { @@ -67,7 +68,7 @@ func NewWechat(data map[interface{}]interface{}, msg *plugin.Message, vars map[s vars["logs"] = msg.CallBack temp, err := utils.ApplyTemplate(text.(string), vars) if err != nil { - log.Debugf("告警模板解析失败: %s", err.Error()) + slog.Debug(fmt.Sprintf("告警模板解析失败: %s", err.Error())) return result, err } result.Markdown = Text{Content: temp} @@ -91,7 +92,7 @@ func NewWechat(data map[interface{}]interface{}, msg *plugin.Message, vars map[s temp, err := utils.ApplyTemplate(string(tempFile), vars) if err != nil { - log.Debugf("告警模板解析失败: %s", err.Error()) + slog.Debug(fmt.Sprintf("告警模板解析失败: %s", err.Error())) return result, err } result.Markdown = Text{Content: temp} @@ -125,31 +126,14 @@ func (this *Wechat) SpecificSend() (string, error) { rs string err error ) - log.WithFields(log.Fields{ - "uuid": this.Sid, - "type": "wechat", - "title": this.Title, - "method": "SpecificSend()", - }).Info(this.Origin) + slog.Info(this.Origin) for _, address := range this.Address { rs, err = post(address, this.Origin) if err != nil { - log.WithFields(log.Fields{ - "uuid": this.Sid, - "type": "wechat", - "title": this.Title, - "address": address, - "method": "SpecificSend()", - }).Error(err.Error()) + slog.Error(err.Error()) // this.CallBack(this.Sid, err.Error()) } else { - log.WithFields(log.Fields{ - "uuid": this.Sid, - "type": "wechat", - "title": this.Title, - "address": address, - "method": "SpecificSend()", - }).Info("发送成功") + slog.Info("发送成功") // this.CallBack(this.Sid, "success") } } @@ -177,16 +161,10 @@ func post(url, message string) (string, error) { body, err := ioutil.ReadAll(response.Body) if err != nil { - log.WithFields(log.Fields{ - "url": url, - "method": "post", - }).Error(err.Error()) + slog.Error(err.Error()) return rs, err } - log.WithFields(log.Fields{ - "url": url, - "method": "post", - }).Info("Http Post Response ", string(body)) + slog.Info("Http Post Response ", string(body)) rs = string(body) return rs, nil } @@ -198,7 +176,7 @@ func (this *Wechat) IsCurrent() bool { tmp := strings.Split(this.Range, "|") rangeTime, err := utils.TransformCHN(strings.Split(tmp[0], ",")) if err != nil { - log.Println(err.Error()) + slog.Error(err.Error()) return rs } now := time.Now() diff --git a/module/lifecycle.go b/module/lifecycle.go index 3421e3f..879b6f5 100644 --- a/module/lifecycle.go +++ b/module/lifecycle.go @@ -1,8 +1,10 @@ package module import ( + "fmt" + "log/slog" + "github.com/devopsxp/xp/plugin" - log "github.com/sirupsen/logrus" ) // 功能:设置默认Start|Stop|Status 实现Filter Interface @@ -13,12 +15,12 @@ type LifeCycle struct { func (l *LifeCycle) Start() { l.status = plugin.Started - log.Debugf("%s plugin started.\n", l.name) + slog.Debug(fmt.Sprintf("%s plugin started.\n", l.name)) } func (l *LifeCycle) Stop() { l.status = plugin.Stopped - log.Debugf("%s plugin stopped.\n", l.name) + slog.Debug(fmt.Sprintf("%s plugin stopped.\n", l.name)) } func (l *LifeCycle) Status() plugin.StatusPlugin { diff --git a/module/localyaml_input.go b/module/localyaml_input.go index bb8c45d..b0c61f8 100644 --- a/module/localyaml_input.go +++ b/module/localyaml_input.go @@ -1,6 +1,8 @@ package module import ( + "fmt" + "log/slog" "reflect" "runtime" "sync" @@ -8,7 +10,6 @@ import ( "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) @@ -36,7 +37,7 @@ type LocalYaml struct { func (l *LocalYaml) Get() { l.data = viper.AllSettings() - log.Debugf("所有配置: %v", l.data) + slog.Debug(fmt.Sprintf("所有配置: %v", l.data)) } type LocalYamlInput struct { @@ -52,7 +53,7 @@ func (l *LocalYamlInput) Receive() *plugin.Message { l.yaml.Get() if l.status != plugin.Started { - log.Warnln("LocalYaml input plugin is not running,input nothing.") + slog.Warn("LocalYaml input plugin is not running,input nothing.") return nil } @@ -68,7 +69,7 @@ func (l *LocalYamlInput) SetConnectStatus(ip, status string) { func (l *LocalYamlInput) Start() { l.fails = 0 l.status = plugin.Started - log.Debugln("LocalYamlInput plugin started.") + slog.Debug("LocalYamlInput plugin started.") // Check all ips ips, err := getips(viper.GetStringSlice("host")) @@ -86,8 +87,8 @@ func (l *LocalYamlInput) Start() { var wg sync.WaitGroup - log.Infoln("******************************************************** TASK [LocalYamlCheck : 主机状态检测] ********************************************************") - log.Infof("LocalYaml Input 插件开始执行ssh目标主机状态扫描,并发数: %d", 5*runtime.NumCPU()) + slog.Info("******************************************************** TASK [LocalYamlCheck : 主机状态检测] ********************************************************") + slog.Info("LocalYaml Input 插件开始执行ssh目标主机状态扫描", "并发数", 5*runtime.NumCPU()) for n, i := range ips { wg.Add(1) checkchan <- i @@ -95,10 +96,10 @@ func (l *LocalYamlInput) Start() { defer wg.Done() now := time.Now() if utils.ScanPort(ip, port) { - log.Infof("%d: Ssh check %s:%d success 耗时: %v", num, ip, port, time.Now().Sub(now)) + slog.Info(fmt.Sprintf("%d: Ssh check %s:%d success 耗时: %v", num, ip, port, time.Now().Sub(now))) l.SetConnectStatus(ip, "success") } else { - log.Infof("%d: Ssh check %s:%d failed 耗时:%v", num, ip, port, time.Now().Sub(now)) + slog.Info(fmt.Sprintf("%d: Ssh check %s:%d failed 耗时:%v", num, ip, port, time.Now().Sub(now))) l.fails += 1 l.SetConnectStatus(ip, "failed") } @@ -106,7 +107,7 @@ func (l *LocalYamlInput) Start() { }(i, n) if n%10 == 0 { - log.Infof("已完成 %d 主机连接测试, 当前GoRoutine数量: %d", n, runtime.NumGoroutine()) + slog.Info(fmt.Sprintf("已完成 %d 主机连接测试, 当前GoRoutine数量: %d", n, runtime.NumGoroutine())) } } diff --git a/module/shell_filter.go b/module/shell_filter.go index a9b1d99..c4f2b6d 100644 --- a/module/shell_filter.go +++ b/module/shell_filter.go @@ -2,6 +2,7 @@ package module import ( "fmt" + "log/slog" "os" "reflect" "runtime" @@ -10,8 +11,8 @@ import ( "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/roles" "github.com/devopsxp/xp/utils" + "github.com/pingcap/log" uuid "github.com/satori/go.uuid" - log "github.com/sirupsen/logrus" ) func init() { @@ -27,28 +28,28 @@ type ShellFilter struct { func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { if s.status != plugin.Started { - log.Warnln("Shell filter plugin is not running,filter nothing.") + slog.Warn("Shell filter plugin is not running,filter nothing.") return msgs } // TODO: // 1. 封装config shell|copy|template等操作 - log.Infof("ShellFilter Filter 插件开始执行目标主机Config Playbook,并发数: %d", runtime.NumCPU()) + slog.Info(fmt.Sprintf("ShellFilter Filter 插件开始执行目标主机Config Playbook,并发数: %d", runtime.NumCPU())) // 解析yaml结果 - log.Debugf("解析yaml结果 Check %v\n", msgs.Data.Check) + slog.Debug(fmt.Sprintf("解析yaml结果 Check %v\n", msgs.Data.Check)) // 1. 解析stage步骤 var stages []interface{} if sg, ok := msgs.Data.Items["stage"]; ok { stages = sg.([]interface{}) } - log.Debugf("Stage %v\n", stages) + slog.Debug(fmt.Sprintf("Stage %v\n", stages)) var configs []interface{} if cf, ok := msgs.Data.Items["config"]; ok { configs = cf.([]interface{}) } else { - log.Errorln("未配置config模块,退出!") + slog.Error("未配置config模块,退出!") os.Exit(1) } @@ -61,11 +62,11 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { // 获取include路径 includePath, ok := cc.(map[interface{}]interface{})["include"] if ok { - log.Infof("匹配到 include 配置[%s] %s", cc.(map[interface{}]interface{})["name"], includePath) + slog.Info(fmt.Sprintf("匹配到 include 配置[%s] %s", cc.(map[interface{}]interface{})["name"], includePath)) // include 配置格式为: [map[interface{}]interface{}] iData, err := utils.ReadYamlConfig(includePath.(string)) if err != nil { - log.Errorf("读取include yaml文件错误:%s", err.Error()) + slog.Error("读取include yaml文件", "错误", err.Error()) os.Exit(1) } @@ -75,15 +76,15 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { case map[interface{}]interface{}: configs = append(configs, iData.(map[interface{}]interface{})) default: - log.Warnf("Include Yaml文件格式不能匹配 %v", iData) + slog.Warn("Include Yaml文件格式不能匹配 %v", iData) } } } } - log.Debugln("configs", configs) + slog.Debug("configs", configs) - log.Debugf("Config %v\n", configs) + slog.Debug(fmt.Sprintf("Config %v\n", configs)) var ( pipelineUuid string remote_user, remote_pwd, workdir, reponame string @@ -118,7 +119,7 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { if !isexist && err != nil { panic(err) } - log.Debugf("判断docker共享目录是否存在: %s", workdir) + slog.Debug(fmt.Sprintf("判断docker共享目录是否存在: %s", workdir)) } else { // 当没有设置workdir时,判断并创建在当前目录下 workdir = fmt.Sprintf("%s/workspace", utils.GetCurrentDirectory()) @@ -126,10 +127,10 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { if !isexist && err != nil { panic(err) } - log.Debugf("判断docker共享目录是否存在: %s", workdir) + slog.Debug(fmt.Sprintf("判断docker共享目录是否存在: %s", workdir)) } - log.Infof("准备docker 共享目录完毕: %s", workdir) + slog.Info(fmt.Sprintf("准备docker 共享目录完毕: %s", workdir)) // 如果设置了git仓库,则拉取repo并修改workdir路径 if git, ok := msgs.Data.Items["git"]; ok { @@ -137,7 +138,7 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { var branch, depth, cmd string // 如果设置了url则进行往下进行 if url, ok := git.(map[string]interface{})["url"]; ok { - log.Infof("******************************************************** Prepare [GitClone : %s] ", url) + slog.Info(fmt.Sprintf("******************************************************** Prepare [GitClone : %s] ", url)) reponame = strings.Split(url.(string), "/")[len(strings.Split(url.(string), "/"))-1] if br, ok := git.(map[string]interface{})["branch"]; ok { @@ -160,17 +161,13 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { rs, err := utils.ExecCommandString(cmd) if err != nil { - log.WithFields(log.Fields{ - "cmd": cmd, - }).Error(rs) + slog.Error(rs) } - log.WithFields(log.Fields{ - "cmd": cmd, - }).Infof("success git clone: %s", rs) + slog.Info("success git clone", "url", rs) workdir = fmt.Sprintf("%s/%s", workdir, pipelineUuid) - log.Infof("准备docker git clone共享目录完毕: %s", workdir) + slog.Info(fmt.Sprintf("准备docker git clone共享目录完毕: %s", workdir)) } } @@ -207,14 +204,14 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { // 2. 根据stage进行解析 for host, status := range msgs.Data.Check { if status == "failed" { - log.Debugf("host %s is failed, next.\n", host) + slog.Debug(fmt.Sprintf("host %s is failed, next.\n", host)) } else { for _, stage := range stages { if roles.IsRolesAllow(stage.(string), rolesData) { // 3. TODO: 解析yaml中shell的模块,然后进行匹配 err := roles.NewShellRole(roles.NewRoleArgs(stage.(string), remote_user, remote_pwd, host, workdir, reponame, vars, configs, msgs, nil, remote_port, timeout, timeoutexit)) if err != nil { - log.Debugln(err.Error()) + slog.Debug(err.Error()) // os.Exit(1) break } @@ -233,7 +230,7 @@ func (s *ShellFilter) Process(msgs *plugin.Message) *plugin.Message { // // 3. TODO: 解析yaml中shell的模块,然后进行匹配 // err := roles.NewShellRole(roles.NewRoleArgs(stage.(string), remote_user, host, vars, configs, msgs, nil)) // if err != nil { - // log.Debugln(err.Error()) + // slog.Debug(err.Error()) // os.Exit(1) // } // } diff --git a/pipeline/pipeline.go b/pipeline/pipeline.go index 0cdd70a..1b11a8a 100644 --- a/pipeline/pipeline.go +++ b/pipeline/pipeline.go @@ -1,11 +1,12 @@ package pipeline import ( + "fmt" + "log/slog" "time" "github.com/briandowns/spinner" "github.com/devopsxp/xp/plugin" - log "github.com/sirupsen/logrus" ) // 性能分析 @@ -93,7 +94,7 @@ func (p *Pipeline) Start() { p.input.Start() // p.check.Start() p.status = plugin.Started - log.Debugln("Pipeline started.") + slog.Debug("Pipeline started.") } // 停止的顺序 check -> input -> filter -> output @@ -104,8 +105,8 @@ func (p *Pipeline) Stop() { p.filter.Stop() p.output.Stop() p.status = plugin.Stopped - log.Debugln("Pipeline stopped.") - log.Infof("Pipeline执行完毕,耗时:%v", time.Now().Sub(p.start)) + slog.Debug("Pipeline stopped.") + slog.Info(fmt.Sprintf("Pipeline执行完毕,耗时:%v", time.Now().Sub(p.start))) } func (p *Pipeline) Status() plugin.StatusPlugin { diff --git a/pkg/k8s/pod.go b/pkg/k8s/pod.go index 20a1253..e4848b6 100644 --- a/pkg/k8s/pod.go +++ b/pkg/k8s/pod.go @@ -3,9 +3,10 @@ package k8s import ( "bytes" "context" + "fmt" "io" + "log/slog" - log "github.com/sirupsen/logrus" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -51,7 +52,7 @@ func CreatePod(pod *apiv1.Pod) (*apiv1.Pod, error) { return nil, err } - log.Debugf("create pod %v\n", pod) + slog.Debug(fmt.Sprintf("create pod %v\n", pod)) podCallBack, err := cli.CoreV1().Pods(pod.ObjectMeta.Namespace).Create(context.Background(), pod, metav1.CreateOptions{}) return podCallBack, err } diff --git a/plugin/pool.go b/plugin/pool.go index 1c492a2..9cb1e05 100644 --- a/plugin/pool.go +++ b/plugin/pool.go @@ -1,16 +1,16 @@ package plugin import ( + "fmt" + "log/slog" "reflect" - - log "github.com/sirupsen/logrus" ) // filter插件名称与类型的映射关系,主要用于通过反射创建filter对象 var checkNames = make(map[string]reflect.Type) func AddCheck(key string, value reflect.Type) { - log.Debugf("添加Check插件 %s", key) + slog.Debug(fmt.Sprintf("添加Check插件 %s", key)) checkNames[key] = value } @@ -18,7 +18,7 @@ func AddCheck(key string, value reflect.Type) { var inputNames = make(map[string]reflect.Type) func AddInput(key string, value reflect.Type) { - log.Debugf("添加Input插件 %s", key) + slog.Debug(fmt.Sprintf("添加Input插件 %s", key)) inputNames[key] = value } @@ -26,7 +26,7 @@ func AddInput(key string, value reflect.Type) { var filterNames = make(map[string]reflect.Type) func AddFilter(key string, value reflect.Type) { - log.Debugf("添加Filter插件 %s", key) + slog.Debug(fmt.Sprintf("添加Filter插件 %s", key)) filterNames[key] = value } @@ -34,6 +34,6 @@ func AddFilter(key string, value reflect.Type) { var outputNames = make(map[string]reflect.Type) func AddOutput(key string, value reflect.Type) { - log.Debugf("添加Output插件 %s", key) + slog.Debug(fmt.Sprintf("添加Output插件 %s", key)) outputNames[key] = value } diff --git a/roles/copy_role.go b/roles/copy_role.go index 3a75b50..1eaedad 100644 --- a/roles/copy_role.go +++ b/roles/copy_role.go @@ -3,12 +3,12 @@ package roles import ( "errors" "fmt" + "log/slog" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -55,22 +55,14 @@ func (c *CopyRole) Run() error { if c.items == nil { err := utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).SftpUploadToRemote(c.src, c.dest) if err != nil { - log.WithFields(log.Fields{ - "src": c.src, - "dest": c.dest, - "耗时": time.Now().Sub(c.starttime), - }).Errorln(err.Error()) + slog.Error(err.Error()) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") goto OVER } } else { - log.WithFields(log.Fields{ - "src": c.src, - "dest": c.dest, - "耗时": time.Now().Sub(c.starttime), - }).Infof("success upload file %s", c.dest) + slog.Info("success upload ", "file", c.dest) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = fmt.Sprintf("success upload file %s", c.dest) } } else { @@ -79,28 +71,19 @@ func (c *CopyRole) Run() error { // 注意:只针对with_items数组类型 src, err := utils.ApplyTemplate(c.src, map[string]interface{}{"item": it}) if err != nil { - log.Errorf("src %s error: %v", src, err) + slog.Error(fmt.Sprintf("src %s error: %v", src, err)) panic(err) } dest, err := utils.ApplyTemplate(c.dest, map[string]interface{}{"item": it}) err = utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).SftpUploadToRemote(src, dest) if err != nil { - log.WithFields(log.Fields{ - "src": src, - "dest": dest, - "耗时": time.Now().Sub(c.starttime), - }).Errorln(err.Error()) + slog.Error(err.Error()) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") goto OVER } } else { - log.WithFields(log.Fields{ - "src": src, - "dest": dest, - "耗时": time.Now().Sub(c.starttime), - }).Infof("success upload file %s", dest) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = fmt.Sprintf("success upload file %s", dest) } } diff --git a/roles/docker_role.go b/roles/docker_role.go index 4f3968b..03d9b55 100644 --- a/roles/docker_role.go +++ b/roles/docker_role.go @@ -2,12 +2,12 @@ package roles import ( "fmt" + "log/slog" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -187,9 +187,7 @@ func (r *DockerRole) Run() error { cli := utils.NewDockerCli(r.args, r.image, strings.Join(r.command, " && "), r.workspace, r.reponame) cmd, err := cli.Run() - log.WithFields(log.Fields{ - "耗时": time.Now().Sub(r.starttime), - }).Infof("[Local Docker] %s", cmd) + slog.Info("[Local Docker]", cmd) return err } diff --git a/roles/factory.go b/roles/factory.go index 3ec66c3..551c341 100644 --- a/roles/factory.go +++ b/roles/factory.go @@ -4,13 +4,13 @@ import ( "context" "errors" "fmt" + "log/slog" "os" "reflect" "strings" "time" . "github.com/devopsxp/xp/plugin" - log "github.com/sirupsen/logrus" ) var rf *RoleFactory @@ -38,11 +38,11 @@ func (r *RoleFactory) Create(conf RoleType) (RolePlugin, error) { func IsRolesAllow(stage string, roles []interface{}) bool { for _, role := range roles { if stage == role.(string) { - log.Debugf("%s stage 允许执行", stage) + slog.Debug(fmt.Sprintf("%s stage 允许执行", stage)) return true } } - log.Debugf("%s stage 不允许执行", stage) + slog.Debug(fmt.Sprintf("%s stage 不允许执行", stage)) return false } @@ -54,7 +54,7 @@ func ParseRoleType(config map[interface{}]interface{}) (rt RoleType, isok bool) for k, _ := range config { // 与roleNames资源池匹配 if _, ok := roleNames[RoleType(k.(string))]; ok { - log.Debugf("匹配到 Role 资源池对象 roleNames %s", k) + slog.Debug(fmt.Sprintf("匹配到 Role 资源池对象 roleNames %s", k)) rt = RoleType(k.(string)) isok = true } @@ -133,7 +133,7 @@ func NewShellRole(args *RoleArgs) error { isHook: true, hookArgs: []string{"test", "hook", "example"}, hookFunc: func(args ...[]string) error { - log.Debugf("钩子函数测试Demo: %v", args) + slog.Debug(fmt.Sprintf("钩子函数测试Demo: %v", args)) return nil }, } @@ -158,10 +158,10 @@ func NewShellRole(args *RoleArgs) error { return err } case <-ctx.Done(): - log.Errorf("超时 %d秒: 主机 %s Stage %s %v", args.timeout, args.host, args.stage, config) + slog.Error(fmt.Sprintf("超时 %d秒: 主机 %s Stage %s %v", args.timeout, args.host, args.stage, config)) // 超时是退出还是继续下一步? if args.timeoutexit { - log.Error("超时退出") + slog.Error("超时退出") os.Exit(1) } } @@ -175,7 +175,7 @@ func execConfig(args *RoleArgs, n int, config interface{}) error { // 设置当前config // 静止并行执行 args.currentConfig = config.(map[interface{}]interface{}) - log.Debugf("当前步骤: %d 当前Stage: %s Config信息: %v", n, args.stage, config) + slog.Debug(fmt.Sprintf("当前步骤: %d 当前Stage: %s Config信息: %v", n, args.stage, config)) rt, ok := ParseRoleType(config.(map[interface{}]interface{})) if !ok { return errors.New(fmt.Sprintf("未匹配到目标Role %v", config)) @@ -194,7 +194,7 @@ func execConfig(args *RoleArgs, n int, config interface{}) error { if err != nil { // 判断是stage不匹配还是其它错误 if strings.Contains(err.Error(), "not equal") || strings.Contains(err.Error(), "不在可执行主机范围内") { - log.Debugf("%s %v", args.host, err) + slog.Debug(fmt.Sprintf("%s %v", args.host, err)) } else { args.AddCountByName(fmt.Sprintf("%s:%d", args.host, args.port), "failed") return err @@ -214,7 +214,7 @@ func execConfig(args *RoleArgs, n int, config interface{}) error { // 状态判断 err = role.Before() if err != nil { - log.Error(err) + slog.Error(err.Error()) } else { // 处理重试逻辑 if retry, ok := config.(map[interface{}]interface{})["retry"]; ok { @@ -222,16 +222,16 @@ func execConfig(args *RoleArgs, n int, config interface{}) error { for i := 0; i < retry.(int); i++ { errs = role.Run() if errs != nil { - log.Warningf("重试第 %d 次,主机: %s Stage: %s User: %s 错误信息: %s", i, args.host, args.stage, args.user, errs.Error()) + slog.Warn(fmt.Sprintf("重试第 %d 次,主机: %s Stage: %s User: %s 错误信息: %s", i, args.host, args.stage, args.user, errs.Error())) if i+1 == retry { - log.Errorf("重试次数 %d 完毕,未能执行完成,错误信息: %s", i, errs.Error()) + slog.Error(fmt.Sprintf("重试次数 %d 完毕,未能执行完成,错误信息: %s", i, errs.Error())) } // 重试等待时间 if retryWait, ok := config.(map[interface{}]interface{})["wait"]; ok { - log.Warnf("重试等待时间: %d 秒", retryWait.(int)) + slog.Warn(fmt.Sprintf("重试等待时间: %d 秒", retryWait.(int))) time.Sleep(time.Duration(retryWait.(int)) * time.Second) } else { - log.Warnln("重试等待时间: 3 秒") + slog.Warn("重试等待时间: 3 秒") time.Sleep(3 * time.Second) } } else { @@ -287,7 +287,7 @@ func execConfig(args *RoleArgs, n int, config interface{}) error { } } } else { - log.Infof("****************************** SKIP [ITEM: %s %s %s %v]\n", args.host, args.stage, args.user, config) + slog.Info(fmt.Sprintf("****************************** SKIP [ITEM: %s %s %s %v]\n", args.host, args.stage, args.user, config)) args.AddCountByName(fmt.Sprintf("%s:%d", args.host, args.port), "skipped") } } diff --git a/roles/fetch_role.go b/roles/fetch_role.go index 7c317cc..0eb0f17 100644 --- a/roles/fetch_role.go +++ b/roles/fetch_role.go @@ -3,12 +3,12 @@ package roles import ( "errors" "fmt" + "log/slog" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -56,22 +56,14 @@ func (c *FetchRole) Run() error { if c.items == nil { err := utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).SftpDownloadToLocal(c.dest, c.src) if err != nil { - log.WithFields(log.Fields{ - "src": c.src, - "dest": c.dest, - "耗时": time.Now().Sub(c.starttime), - }).Errorln(err.Error()) + slog.Error(err.Error()) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") goto OVER } } else { - log.WithFields(log.Fields{ - "src": c.src, - "dest": c.dest, - "耗时": time.Now().Sub(c.starttime), - }).Infof("success upload file %s", c.dest) + slog.Info("success upload ", "file ", c.dest) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = fmt.Sprintf("success upload file %s", c.dest) } } else { @@ -80,28 +72,20 @@ func (c *FetchRole) Run() error { // 注意:只针对with_items数组类型 src, err := utils.ApplyTemplate(c.src, map[string]interface{}{"item": it}) if err != nil { - log.Errorf("src %s error: %v", src, err) + slog.Error(fmt.Sprintf("src %s error: %v", src, err)) panic(err) } dest, err := utils.ApplyTemplate(c.dest, map[string]interface{}{"item": it}) err = utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).SftpDownloadToLocal(dest, src) if err != nil { - log.WithFields(log.Fields{ - "src": src, - "dest": dest, - "耗时": time.Now().Sub(c.starttime), - }).Errorln(err.Error()) + slog.Error(err.Error()) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") goto OVER } } else { - log.WithFields(log.Fields{ - "src": src, - "dest": dest, - "耗时": time.Now().Sub(c.starttime), - }).Infof("success upload file %s", dest) + slog.Info("success upload ", "file", dest) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = fmt.Sprintf("success upload file %s", dest) } } diff --git a/roles/interface.go b/roles/interface.go index 65b5935..4edb9a1 100644 --- a/roles/interface.go +++ b/roles/interface.go @@ -3,11 +3,11 @@ package roles import ( "errors" "fmt" + "log/slog" "time" . "github.com/devopsxp/xp/plugin" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) // 执行过程生命周期接口 @@ -125,21 +125,21 @@ func (r *RoleLC) Common(args *RoleArgs) error { // 初始化 func (r *RoleLC) Init(args *RoleArgs) error { - log.Debug("Parent Object Init Func") + slog.Debug("Parent Object Init Func") return r.Common(args) } // 准备环节 func (r *RoleLC) Pre() { - log.Debugf("Role module %s Pre running.", r.name) + slog.Debug(fmt.Sprintf("Role module %s Pre running.", r.name)) // 设置开始时间 r.starttime = time.Now() } // 执行前的条件判断 func (r *RoleLC) Before() error { - log.Debugf("Role module %s Before running.", r.name) - log.Infof("******************************************************** TASK [%s : %s] BY %s@%s \n", r.stage, r.name, r.remote_user, r.host) + slog.Debug(fmt.Sprintf("Role module %s Before running.", r.name)) + slog.Info(fmt.Sprintf("******************************************************** TASK [%s : %s] BY %s@%s \n", r.stage, r.name, r.remote_user, r.host)) // when条件判断 @key shell命令 @value 命令结果 if when, ok := r.args.currentConfig["when"]; ok { // 如果when条件判断存在,则执行@key命令 @@ -161,19 +161,13 @@ func (r *RoleLC) Before() error { // 执行环节 func (r *RoleLC) Run() { - log.Debugf("Role module %s Run running.", r.name) + slog.Debug(fmt.Sprintf("Role module %s Run running.", r.name)) } // 执行后环节 func (r *RoleLC) After() { - // log.Debugf("Role module %s After running.", r.name) - log.WithFields(log.Fields{ - "Status": "After LifeCycle", - "Role": r.types, - "Name": r.name, - "Stage": r.stage, - "Host": r.host, - }).Infof("执行完成 耗时:%v", time.Now().Sub(r.starttime)) + // slog.Debug(fmt.Sprintf("Role module %s After running.", r.name) + slog.Info(fmt.Sprintf("执行完成 耗时:%v", time.Now().Sub(r.starttime))) } // 执行判断IsHook @@ -184,7 +178,7 @@ func (r *RoleLC) IsHook() bool { // 钩子函数,思考:是否和After以及output插件冲突 func (r *RoleLC) Hooks() error { - log.Debugf("Role module %s Hooks Args running.", r.name, r.hook.hookArgs) + slog.Debug(fmt.Sprintf("Role module %s Hooks Args running.", r.name, r.hook.hookArgs)) err := r.hook.hookFunc(r.hook.hookArgs) return err } diff --git a/roles/k8s_role.go b/roles/k8s_role.go index becc0bd..cd0bb09 100644 --- a/roles/k8s_role.go +++ b/roles/k8s_role.go @@ -4,13 +4,13 @@ import ( "encoding/json" "errors" "fmt" + "log/slog" "reflect" "strings" "time" "github.com/devopsxp/xp/pkg/k8s" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -210,23 +210,21 @@ func (k *K8sRole) Run() error { pod.Spec.Containers = containers - log.Debugf("pod name: %s %v", k.name, pod) + slog.Debug(fmt.Sprintf("pod name: %s %v", k.name, pod)) podinfo, err := k8s.CreatePod(pod) if err != nil { - log.Error(err) + slog.Error(err.Error()) return err } info, err := json.MarshalIndent(podinfo, "", "\t") if err != nil { - log.Error(err) + slog.Error(err.Error()) return err } - log.WithFields(log.Fields{ - "耗时": time.Now().Sub(k.starttime), - }).Infof("Pod YAML: %s", info) + slog.Info("Pod ", "YAML", info) return err } @@ -239,7 +237,7 @@ func (k *K8sRole) After() { // hook钩子 进行pod删除 func (k *K8sRole) Hooks() error { - log.Debugf("K8s Role module on %s => %s", k.namespace, k.name) + slog.Debug(fmt.Sprintf("K8s Role module on %s => %s", k.namespace, k.name)) // err := k8s.DeletePod(k.namespace, k.name) // log.WithFields(log.Fields{ // "耗时": time.Now().Sub(k.starttime), diff --git a/roles/pool.go b/roles/pool.go index 4ed3212..bbdb519 100644 --- a/roles/pool.go +++ b/roles/pool.go @@ -1,9 +1,9 @@ package roles import ( + "fmt" + "log/slog" "reflect" - - log "github.com/sirupsen/logrus" ) type RoleType string @@ -26,6 +26,6 @@ const ( var roleNames = make(map[RoleType]reflect.Type) func addRoles(key RoleType, value reflect.Type) { - log.Debugf("添加Roles插件 %s", key) + slog.Debug(fmt.Sprintf("添加Roles插件 %s", key)) roleNames[key] = value } diff --git a/roles/script_role.go b/roles/script_role.go index d1d7d1b..86dfe17 100644 --- a/roles/script_role.go +++ b/roles/script_role.go @@ -3,13 +3,13 @@ package roles import ( "errors" "fmt" + "log/slog" "os" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -49,10 +49,10 @@ func (c *ScriptRole) Run() error { dest := fmt.Sprintf("/tmp/%s", utils.GetRandomSalt()) err := utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).SftpUploadToRemote(c.script, dest) if err != nil { - log.WithFields(log.Fields{ - "src": c.script, - "耗时": time.Now().Sub(c.starttime), - }).Errorln(err.Error()) + // log.WithFields(log.Fields{ + // "src": c.script, + // "耗时": time.Now().Sub(c.starttime), + // }).Errorln(err.Error()) c.logs[fmt.Sprintf("%s %s %s", c.stage, c.host, c.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { return errors.New("ssh: handshake failed") @@ -64,18 +64,20 @@ func (c *ScriptRole) Run() error { err = utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).RunTerminal(cmd, os.Stdout, os.Stderr) rs := fmt.Sprintf("%s over", c.script) if err != nil { - log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", c.script, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", c.script, err.Error())) return err } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) + slog.Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) } } else { rs, err := utils.New(c.host, c.remote_user, c.remote_pwd, c.remote_port).Run(cmd) if err != nil { - log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", c.script, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", c.script, err.Error())) return err } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(c.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) + slog.Info(fmt.Sprintf("[Item: %s] => %s", c.script, rs)) } } diff --git a/roles/shell_role.go b/roles/shell_role.go index 480a59c..cc3a0a6 100644 --- a/roles/shell_role.go +++ b/roles/shell_role.go @@ -3,13 +3,13 @@ package roles import ( "errors" "fmt" + "log/slog" "os" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -68,7 +68,7 @@ func (r *ShellRole) Run() error { } if err != nil { - log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", r.shell, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s", r.shell, err.Error())) r.logs[fmt.Sprintf("%s %s %s", r.stage, r.host, r.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") @@ -76,19 +76,19 @@ func (r *ShellRole) Run() error { } // return errors.New(fmt.Sprintf("%s | %s | %s | %s => %s", r.host, r.stage, r.name, cmd, err.Error())) } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", r.shell, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Info(fmt.Sprintf("[Item: %s] => %s", r.shell, rs)) r.logs[fmt.Sprintf("%s %s %s", r.stage, r.host, r.name)] = rs } } else { - for n, it := range r.items { + for _, it := range r.items { // 补充go template基本语法 // 注意:只针对with_items数组类型 cmd, err := utils.ApplyTemplate(r.shell, map[string]interface{}{"item": it}) if err != nil { - log.Errorf("cmd %s error: %v", cmd, err) + // slog.Errorf("cmd %s error: %v", cmd, err) panic(err) } - log.Debugf("cmd is %s", cmd) + slog.Debug(fmt.Sprintf("cmd is %s", cmd)) if r.terminial { err = utils.New(r.host, r.remote_user, r.remote_pwd, r.remote_port).RunTerminal(cmd, os.Stdout, os.Stderr) @@ -103,12 +103,12 @@ func (r *ShellRole) Run() error { err = errors.New("ssh: handshake failed") // goto OVER } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Errorln(fmt.Sprintf("[序号: %d Item: %s] => %s", n, cmd, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Errorln(fmt.Sprintf("[序号: %d Item: %s] => %s", n, cmd, err.Error())) } // return errors.New(fmt.Sprintf("%s | %s | %s | %s => %s %s", r.host, r.stage, r.name, cmd, rs, err.Error())) return err } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Info(fmt.Sprintf("[序号: %d Item: %s] => %s", n, cmd, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(r.starttime)}).Info(fmt.Sprintf("[序号: %d Item: %s] => %s", n, cmd, rs)) r.logs[fmt.Sprintf("%s %s %s", r.stage, r.host, r.name)] = rs } } @@ -125,6 +125,6 @@ func (r *ShellRole) After() { } func testhook(a, b string) error { - log.Printf("%s %s test hook send") + slog.Info(fmt.Sprintf("%s %s test hook send")) return nil } diff --git a/roles/systemd_role.go b/roles/systemd_role.go index c4acecb..d113679 100644 --- a/roles/systemd_role.go +++ b/roles/systemd_role.go @@ -3,12 +3,12 @@ package roles import ( "errors" "fmt" + "log/slog" "os" "reflect" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -58,7 +58,7 @@ func (s *SystemdRole) Init(args *RoleArgs) error { s.masked = masked } - log.Debugf("Systemd %v", s) + slog.Debug(fmt.Sprintf("Systemd %v", s)) return nil } @@ -109,9 +109,11 @@ func (s *SystemdRole) setState() error { rs, err = utils.New(s.host, s.remote_user, s.remote_pwd, s.remote_port).Run(cmd) } if err != nil { - log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s <=> %s", cmd, rs, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s <=> %s", cmd, rs, err.Error())) + slog.Error(err.Error()) } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Infoln(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Infoln(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) + slog.Info(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) } default: err = errors.New(fmt.Sprintf("没有匹配到正确的systemRole %s", s.state)) diff --git a/roles/template_role.go b/roles/template_role.go index 620b40b..2447266 100644 --- a/roles/template_role.go +++ b/roles/template_role.go @@ -4,12 +4,12 @@ import ( "errors" "fmt" "io/ioutil" + "log/slog" "reflect" "strings" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -57,26 +57,26 @@ func (r *TemplateRole) Run() error { return err } - log.Debugf("template is %s", destFile) + slog.Debug(fmt.Sprintf("template is %s", destFile)) err = utils.New(r.host, r.remote_user, r.remote_pwd, r.remote_port).SftpUploadTemplateString(destFile, r.dest) if err != nil { - log.WithFields(log.Fields{ - "template": r.src, - "dest": r.dest, - "耗时": time.Now().Sub(r.starttime), - }).Errorln(err.Error()) + // log.WithFields(log.Fields{ + // "template": r.src, + // "dest": r.dest, + // "耗时": time.Now().Sub(r.starttime), + // }).Errorln(err.Error()) r.logs[fmt.Sprintf("%s %s %s", r.stage, r.host, r.name)] = err.Error() if strings.Contains(err.Error(), "ssh:") { err = errors.New("ssh: handshake failed") return err } } else { - log.WithFields(log.Fields{ - "template": r.src, - "dest": r.dest, - "耗时": time.Now().Sub(r.starttime), - }).Infof("模板上传成功 %s", r.dest) + // log.WithFields(log.Fields{ + // "template": r.src, + // "dest": r.dest, + // "耗时": time.Now().Sub(r.starttime), + // }).Infof("模板上传成功 %s", r.dest) r.logs[fmt.Sprintf("%s %s %s", r.stage, r.host, r.name)] = fmt.Sprintf("模板上传成功 %s", r.dest) } diff --git a/roles/user_role.go b/roles/user_role.go index c29905c..8e91a96 100644 --- a/roles/user_role.go +++ b/roles/user_role.go @@ -3,12 +3,12 @@ package roles import ( "errors" "fmt" + "log/slog" "os" "reflect" "time" "github.com/devopsxp/xp/utils" - log "github.com/sirupsen/logrus" ) func init() { @@ -83,7 +83,7 @@ func (s *UserRole) Init(args *RoleArgs) error { s.status = status } - log.Debugf("User %v", s) + slog.Debug(fmt.Sprintf("User %v", s)) return nil } @@ -100,9 +100,11 @@ func (s *UserRole) setDo(cmd string) error { } if err != nil { - log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s <=> %s", cmd, rs, err.Error())) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Errorln(fmt.Sprintf("[Item: %s] => %s <=> %s", cmd, rs, err.Error())) + slog.Error(err.Error()) } else { - log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Infoln(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) + // log.WithFields(log.Fields{"耗时": time.Now().Sub(s.starttime)}).Infoln(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) + slog.Info(fmt.Sprintf("[Item: %s] => %s ", cmd, rs)) } return err } diff --git a/utils/common.go b/utils/common.go index aaee84d..d926ef5 100644 --- a/utils/common.go +++ b/utils/common.go @@ -8,6 +8,7 @@ import ( "errors" "fmt" "io" + "log/slog" "math/rand" "net" "os" @@ -17,8 +18,6 @@ import ( "strings" "text/template" "time" - - log "github.com/sirupsen/logrus" ) // 渲染模板 @@ -63,7 +62,7 @@ func GetRandomSalt() string { return GetRandomString(32) } -//生成随机字符串 +// 生成随机字符串 func GetRandomString(len int) string { str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" bytes := []byte(str) @@ -120,7 +119,7 @@ func ExecCommandString(cmd string) (string, error) { func GetCurrentDirectory() string { dir, err := filepath.Abs(filepath.Dir(os.Args[0])) //返回绝对路径 filepath.Dir(os.Args[0])去除最后一个元素的路径 if err != nil { - log.Fatal(err) + slog.Error(err.Error()) } return strings.Replace(dir, "\\", "/", -1) //将\替换成/ } @@ -290,11 +289,11 @@ func IsBetweenAB(start, end string) (bool, error) { if now.After(startTime) && now.Before(endTime) { rs = true } - log.Println("验证时间", rs, fmt.Sprintf("%s %s", days, start), fmt.Sprintf("%s %s", days, end), now.Format(format_mm)) + slog.Info(fmt.Sprintf("验证时间", rs, fmt.Sprintf("%s %s", days, start), fmt.Sprintf("%s %s", days, end), now.Format(format_mm))) return rs, nil } -//PathExists 判断文件夹是否存在 +// PathExists 判断文件夹是否存在 func PathExists(path string) (bool, error) { _, err := os.Stat(path) if err == nil { diff --git a/utils/db.go b/utils/db.go index c10e279..f88440a 100644 --- a/utils/db.go +++ b/utils/db.go @@ -4,7 +4,6 @@ package utils // "github.com/go-xorm/xorm" // // _ "github.com/mattn/go-sqlite3" // _ "github.com/go-sql-driver/mysql" -// log "github.com/sirupsen/logrus" // ) // var Engine *xorm.Engine @@ -14,7 +13,7 @@ package utils // Engine, err = xorm.NewEngine("sqlite3", "./message.db") // // Engine, err = xorm.NewEngine("mysql", "root:system@tcp(127.0.0.1:3306)/xp?charset=utf8") // if err != nil { -// log.Error(err.Error()) +// slog.Error(err.Error()) // } // log.Info("初始化数据库") // } diff --git a/utils/docker_remote.go b/utils/docker_remote.go index dd6f5a1..e71173f 100644 --- a/utils/docker_remote.go +++ b/utils/docker_remote.go @@ -6,8 +6,6 @@ package utils import ( "encoding/json" "fmt" - - log "github.com/sirupsen/logrus" ) type docker struct { @@ -50,7 +48,6 @@ func NewDockerCLI(host, port, version string) *docker { // 500 – server error func (d *docker) ListContainers() (result interface{}, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/json?all=1", d.host, d.port, d.version) - log.Debug(url) data, err := Get(url) if err != nil { return @@ -158,7 +155,6 @@ func (d *docker) ListContainers() (result interface{}, err error) { // 500 – server error func (d *docker) CreateContainer(data interface{}) (result []byte, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/create", d.host, d.port, d.version) - log.Debug(url) result, err = Post(url, data, "application/json") return } @@ -166,7 +162,6 @@ func (d *docker) CreateContainer(data interface{}) (result []byte, err error) { // 监控容器,使用容器id获取该容器的底层信息 func (d *docker) ContainerJson(id string) (result interface{}, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/json", d.host, d.port, d.version, id) - log.Debug(url) data, err := Get(url) if err != nil { return @@ -183,7 +178,6 @@ func (d *docker) ContainerJson(id string) (result interface{}, err error) { // 进程列表。获取容器内进程的清单: func (d *docker) ContainerTop(id string) (result interface{}, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/top", d.host, d.port, d.version, id) - log.Debug(url) data, err := Get(url) if err != nil { return @@ -213,7 +207,6 @@ func (d *docker) ContainerTop(id string) (result interface{}, err error) { // 500 – server error func (d *docker) ContainerLogs(id string) (result interface{}, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/logs?stderr=1&stdout=1×tamps=1&follow=0", d.host, d.port, d.version, id) - log.Debug(url) data, err := Get(url) if err != nil { return @@ -237,7 +230,7 @@ func (d *docker) ContainerLogs(id string) (result interface{}, err error) { // 500 – server error func (d *docker) ContainerStart(id string, data interface{}) (result []byte, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/start", d.host, d.port, d.version, id) - log.Debug(url) + result, err = Post(url, data, "application/json") return } @@ -252,7 +245,7 @@ func (d *docker) ContainerStart(id string, data interface{}) (result []byte, err // 500 – server error func (d *docker) ContainerStop(id string) (result []byte, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/stop?t=5", d.host, d.port, d.version, id) - log.Debug(url) + result, err = Post(url, nil, "application/json") return } @@ -266,7 +259,7 @@ func (d *docker) ContainerStop(id string) (result []byte, err error) { // 500 – server error func (d *docker) ContainerRestart(id string) (result []byte, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/restart?t=5", d.host, d.port, d.version, id) - log.Debug(url) + result, err = Post(url, nil, "application/json") return } @@ -280,7 +273,7 @@ func (d *docker) ContainerRestart(id string) (result []byte, err error) { // 500 – server error func (d *docker) ContainerKill(id string) (result []byte, err error) { url := fmt.Sprintf("http://%s:%s/%s/containers/%s/kill", d.host, d.port, d.version, id) - log.Debug(url) + result, err = Post(url, nil, "application/json") return } diff --git a/utils/ssh.go b/utils/ssh.go index e6ca494..5d07add 100644 --- a/utils/ssh.go +++ b/utils/ssh.go @@ -6,13 +6,14 @@ import ( "fmt" "io" "io/ioutil" + "log/slog" "net" "os" "time" "github.com/mitchellh/go-homedir" + "github.com/pingcap/log" "github.com/pkg/sftp" - log "github.com/sirupsen/logrus" "golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh/terminal" ) @@ -40,11 +41,11 @@ type Cli struct { LastResult string //最近一次Run的结果 } -//创建命令行对象 -//@param ip IP地址 -//@param username 用户名 -//@param password 密码 -//@param port 端口号,默认22 +// 创建命令行对象 +// @param ip IP地址 +// @param username 用户名 +// @param password 密码 +// @param port 端口号,默认22 func New(ip string, username string, password string, port ...int) *Cli { cli := new(Cli) cli.IP = ip @@ -58,8 +59,8 @@ func New(ip string, username string, password string, port ...int) *Cli { return cli } -//执行shell -//@param shell shell脚本命令 +// 执行shell +// @param shell shell脚本命令 func (c *Cli) Run(shell string) (string, error) { if c.client == nil { if err := c.connect(); err != nil { @@ -79,7 +80,7 @@ func (c *Cli) Run(shell string) (string, error) { return c.LastResult, err } -//连接 +// 连接 func (c *Cli) connect() error { var config ssh.ClientConfig if c.Password != "" { @@ -94,13 +95,13 @@ func (c *Cli) connect() error { } else { key, err := ioutil.ReadFile(privateKey) if err != nil { - log.Errorf("Unable to read private key: %v\n", err) + slog.Error("Unable to read private key: %v\n", err) return err } signer, err := ssh.ParsePrivateKey(key) if err != nil { - log.Errorf("Unable to parse private key: %v\n", err) + slog.Error("Unable to parse private key: %v\n", err) return err } @@ -134,7 +135,7 @@ func (c *Cli) SftpUploadTemplateString(data, remotepath string) error { dstFile, err := c.sftpClient.Create(remotepath) if err != nil { - log.Errorf("创建文件 %s 失败: %s", remotepath, err.Error()) + slog.Error(fmt.Sprintf("创建文件 %s 失败: %s", remotepath, err.Error())) return err } defer dstFile.Close() @@ -142,7 +143,7 @@ func (c *Cli) SftpUploadTemplateString(data, remotepath string) error { // 按byte传输文件 dstFile.Write([]byte(data)) - log.Debugf("模板文件 %s 上传成功", remotepath) + slog.Debug(fmt.Sprintf("模板文件 %s 上传成功", remotepath)) return nil } @@ -157,17 +158,17 @@ func (c *Cli) SftpUploadToRemote(localpath, remotepath string) error { defer c.sftpClient.Close() // remoteFileName := path.Base(localpath) - // log.Warnln(localpath, remoteFileName) + // slog.Warn(localpath, remoteFileName) srcFile, err := os.Open(localpath) if err != nil { - log.Errorln("打开文件失败", err) + slog.Error("打开文件失败", err) return err } defer srcFile.Close() dstFile, err := c.sftpClient.Create(remotepath) if err != nil { - log.Errorf("创建文件 %s 失败: %s", remotepath, err.Error()) + slog.Error("创建文件 %s 失败: %s", remotepath, err.Error()) return err } defer dstFile.Close() @@ -181,14 +182,14 @@ func (c *Cli) SftpUploadToRemote(localpath, remotepath string) error { log.Debug("已读取到文件末尾") break } else { - log.Debugf("读取文件出错 %v", err) + slog.Debug(fmt.Sprintf("读取文件出错 %v", err)) return err } } //注意,由于文件大小不定,不可直接使用buffer,否则会在文件末尾重复写入,以填充1024的整数倍 dstFile.Write(buffer[:n]) } - log.Debugf("文件 %s 上传成功", remotepath) + slog.Debug(fmt.Sprintf("文件 %s 上传成功", remotepath)) return nil } @@ -203,7 +204,7 @@ func (c *Cli) SftpDownloadToLocal(localpath, remotepath string) error { srcFile, err := c.sftpClient.Open(remotepath) if err != nil { - log.Errorln("文件读取失败", err) + slog.Error("文件读取失败", err) return err } defer srcFile.Close() @@ -211,17 +212,17 @@ func (c *Cli) SftpDownloadToLocal(localpath, remotepath string) error { // localFilename := path.Base(remotepath) dstFile, err := os.Create(localpath) if err != nil { - log.Errorln("文件创建失败", err.Error()) + slog.Error("文件创建失败", err.Error()) return err } defer dstFile.Close() if _, err := srcFile.WriteTo(dstFile); err != nil { - log.Errorln("额外那件写入失败", err.Error()) + slog.Error("额外那件写入失败", err.Error()) return err } - log.Warnf("文件 %s 下载成功", localpath) + slog.Warn("文件 %s 下载成功", localpath) return nil } @@ -242,13 +243,13 @@ func (c *Cli) sftpConnect() error { } else { key, err := ioutil.ReadFile(privateKey) if err != nil { - log.Errorf("Unable to read private key: %v\n", err) + slog.Error("Unable to read private key: %v\n", err) return err } signer, err := ssh.ParsePrivateKey(key) if err != nil { - log.Errorf("Unable to parse private key: %v\n", err) + slog.Error("Unable to parse private key: %v\n", err) return err } @@ -265,12 +266,12 @@ func (c *Cli) sftpConnect() error { addr := fmt.Sprintf("%s:%d", c.IP, c.Port) sshClient, err := ssh.Dial("tcp", addr, clientConfig) //连接ssh if err != nil { - log.Errorln("连接ssh失败", err) + slog.Error("连接ssh失败", err) return err } if sftpClient, err := sftp.NewClient(sshClient); err != nil { //创建客户端 - log.Errorln("创建客户端失败", err) + slog.Error("创建客户端失败", err) return err } else { c.sftpClient = sftpClient @@ -279,7 +280,7 @@ func (c *Cli) sftpConnect() error { return nil } -//执行带交互的命令 +// 执行带交互的命令 func (c *Cli) RunTerminal(shell string, stdout, stderr io.Writer) error { if c.client == nil { if err := c.connect(); err != nil {