diff --git a/app/cmd/computer.go b/app/cmd/computer.go index 180a63db..851db7df 100644 --- a/app/cmd/computer.go +++ b/app/cmd/computer.go @@ -4,7 +4,8 @@ import ( "github.com/jenkins-zh/jenkins-cli/app/cmd/common" appCfg "github.com/jenkins-zh/jenkins-cli/app/config" "github.com/jenkins-zh/jenkins-cli/app/i18n" - "github.com/jenkins-zh/jenkins-cli/client" + "github.com/jenkins-zh/jenkins-client/pkg/computer" + "github.com/jenkins-zh/jenkins-client/pkg/core" "github.com/spf13/cobra" "strings" ) @@ -21,13 +22,13 @@ var computerCmd = &cobra.Command{ } // GetComputerClient returns the client of computer -func GetComputerClient(option common.Option) (*client.ComputerClient, *appCfg.JenkinsServer) { - jClient := &client.ComputerClient{ - JenkinsCore: client.JenkinsCore{ +func GetComputerClient(option common.Option) (*computer.Client, *appCfg.JenkinsServer) { + jClient := &computer.Client{ + JenkinsCore: core.JenkinsCore{ RoundTripper: option.RoundTripper, }, } - return jClient, getCurrentJenkinsAndClient(&(jClient.JenkinsCore)) + return jClient, getCurrentJenkinsAndClientV2(&(jClient.JenkinsCore)) } // ValidAgentNames autocomplete with agent names diff --git a/app/cmd/computer_create_test.go b/app/cmd/computer_create_test.go index 0c0aea36..c897c2ac 100644 --- a/app/cmd/computer_create_test.go +++ b/app/cmd/computer_create_test.go @@ -2,17 +2,16 @@ package cmd import ( "bytes" + "github.com/jenkins-zh/jenkins-client/pkg/computer" "io" "io/ioutil" "os" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" + "github.com/jenkins-zh/jenkins-client/pkg/mock/mhttp" ) var _ = Describe("create list command", func() { @@ -57,7 +56,7 @@ var _ = Describe("create list command", func() { It("should success", func() { name := "fake-name" - client.PrepareForComputerCreateRequest(roundTripper, "http://localhost:8080/jenkins", + computer.PrepareForComputerCreateRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9", name) rootCmd.SetArgs([]string{"computer", "create", name}) diff --git a/app/cmd/computer_delete_test.go b/app/cmd/computer_delete_test.go index 04a047f5..88c36865 100644 --- a/app/cmd/computer_delete_test.go +++ b/app/cmd/computer_delete_test.go @@ -2,17 +2,16 @@ package cmd import ( "bytes" + "github.com/jenkins-zh/jenkins-client/pkg/computer" "io" "io/ioutil" "os" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" + "github.com/jenkins-zh/jenkins-client/pkg/mock/mhttp" ) var _ = Describe("create delete command", func() { @@ -57,7 +56,7 @@ var _ = Describe("create delete command", func() { It("should success", func() { name := "fake-name" - client.PrepareForComputerDeleteRequest(roundTripper, "http://localhost:8080/jenkins", + computer.PrepareForComputerDeleteRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9", name) rootCmd.SetArgs([]string{"computer", "delete", name}) diff --git a/app/cmd/computer_launch.go b/app/cmd/computer_launch.go index 5a083adf..3da5fe0c 100644 --- a/app/cmd/computer_launch.go +++ b/app/cmd/computer_launch.go @@ -6,8 +6,8 @@ import ( "github.com/jenkins-zh/jenkins-cli/app/cmd/common" appCfg "github.com/jenkins-zh/jenkins-cli/app/config" "github.com/jenkins-zh/jenkins-cli/app/i18n" - "github.com/jenkins-zh/jenkins-cli/client" "github.com/jenkins-zh/jenkins-cli/util" + "github.com/jenkins-zh/jenkins-client/pkg/computer" httpdownloader "github.com/linuxsuren/http-downloader/pkg" "github.com/spf13/cobra" "go.uber.org/zap" @@ -25,7 +25,7 @@ type ComputerLaunchOption struct { ShowProgress bool /** share info between inner functions */ - ComputerClient *client.ComputerClient + ComputerClient *computer.Client CurrentJenkins *appCfg.JenkinsServer Output string @@ -270,7 +270,7 @@ func (o *ComputerLaunchOption) LaunchJnlp(name string) (err error) { env := os.Environ() agentArgs := []string{"java", "-jar", computerLaunchOption.Output, "-jnlpUrl", fmt.Sprintf("%s/computer/%s/slave-agent.jnlp", o.ComputerClient.URL, name), - "-secret", secret, "-workDir", client.GetDefaultAgentWorkDir()} + "-secret", secret, "-workDir", computer.GetDefaultAgentWorkDir()} if o.CurrentJenkins.ProxyAuth != "" { proxyURL, _ := url.Parse(o.CurrentJenkins.Proxy) diff --git a/app/cmd/computer_launch_test.go b/app/cmd/computer_launch_test.go index 176f4276..444359ff 100644 --- a/app/cmd/computer_launch_test.go +++ b/app/cmd/computer_launch_test.go @@ -2,19 +2,19 @@ package cmd import ( "bytes" + "github.com/jenkins-zh/jenkins-cli/client" "github.com/jenkins-zh/jenkins-cli/util" + "github.com/jenkins-zh/jenkins-client/pkg/computer" "io" "io/ioutil" "net/http" "os" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" + "github.com/jenkins-zh/jenkins-client/pkg/mock/mhttp" ) var _ = Describe("computer launch command", func() { @@ -55,7 +55,7 @@ var _ = Describe("computer launch command", func() { Context("launch a default type of agent", func() { It("should success", func() { - client.PrepareForLaunchComputer(roundTripper, "http://localhost:8080/jenkins", + computer.PrepareForLaunchComputer(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9", name) rootCmd.SetArgs([]string{"computer", "launch", name}) @@ -83,7 +83,7 @@ var _ = Describe("computer launch command", func() { RoundTrip(client.NewRequestMatcher(request)).Return(response, nil) secret := "fake-secret" - client.PrepareForComputerAgentSecretRequest(roundTripper, + computer.PrepareForComputerAgentSecretRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9", name, secret) }) diff --git a/app/cmd/computer_list.go b/app/cmd/computer_list.go index b99e318f..22e21bab 100644 --- a/app/cmd/computer_list.go +++ b/app/cmd/computer_list.go @@ -3,7 +3,7 @@ package cmd import ( "fmt" "github.com/jenkins-zh/jenkins-cli/app/cmd/common" - "github.com/jenkins-zh/jenkins-cli/client" + "github.com/jenkins-zh/jenkins-client/pkg/computer" cobra_ext "github.com/linuxsuren/cobra-extension" "github.com/jenkins-zh/jenkins-cli/app/i18n" @@ -35,7 +35,7 @@ var computerListCmd = &cobra.Command{ return } - var computers client.ComputerList + var computers computer.List if computers, err = jClient.List(); err == nil { computerListOption.Writer = cmd.OutOrStdout() computerListOption.CellRenderMap = map[string]cobra_ext.RenderCell{ diff --git a/app/cmd/computer_list_test.go b/app/cmd/computer_list_test.go index e3ae3b46..0d9d263d 100644 --- a/app/cmd/computer_list_test.go +++ b/app/cmd/computer_list_test.go @@ -2,16 +2,15 @@ package cmd import ( "bytes" + "github.com/jenkins-zh/jenkins-client/pkg/computer" "io/ioutil" "os" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" + "github.com/jenkins-zh/jenkins-client/pkg/mock/mhttp" ) var _ = Describe("computer list command", func() { @@ -54,7 +53,7 @@ var _ = Describe("computer list command", func() { }) It("should success", func() { - client.PrepareForComputerListRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9") + computer.PrepareForComputerListRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9") rootCmd.SetArgs([]string{"computer", "list"}) _, err = rootCmd.ExecuteC() diff --git a/app/cmd/computer_log_test.go b/app/cmd/computer_log_test.go index 9fb4ca16..46c32a7d 100644 --- a/app/cmd/computer_log_test.go +++ b/app/cmd/computer_log_test.go @@ -2,16 +2,15 @@ package cmd import ( "bytes" + "github.com/jenkins-zh/jenkins-client/pkg/computer" "io/ioutil" "os" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" + "github.com/jenkins-zh/jenkins-client/pkg/mock/mhttp" ) var _ = Describe("computer log command", func() { @@ -56,7 +55,7 @@ var _ = Describe("computer log command", func() { It("should success", func() { name := "fake" - client.PrepareForComputerLogRequest(roundTripper, "http://localhost:8080/jenkins", + computer.PrepareForComputerLogRequest(roundTripper, "http://localhost:8080/jenkins", "admin", "111e3a2f0231198855dceaff96f20540a9", name) rootCmd.SetArgs([]string{"computer", "log", name}) diff --git a/app/cmd/root.go b/app/cmd/root.go index 0dbdea81..158a324b 100644 --- a/app/cmd/root.go +++ b/app/cmd/root.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/google/go-github/v29/github" "github.com/jenkins-zh/jenkins-cli/app/cmd/common" + "github.com/jenkins-zh/jenkins-client/pkg/core" alias "github.com/linuxsuren/go-cli-alias/pkg" "github.com/linuxsuren/go-cli-alias/pkg/cmd" goPlugin "github.com/linuxsuren/go-cli-plugin/pkg" @@ -452,6 +453,19 @@ func getCurrentJenkinsAndClient(jClient *client.JenkinsCore) (jenkins *appCfg.Je return } +// this is a temporary function to adopt github.com/jenkins-zh/jenkins-client +func getCurrentJenkinsAndClientV2(jClient *core.JenkinsCore) (jenkins *appCfg.JenkinsServer) { + if jenkins = GetCurrentJenkinsFromOptions(); jenkins != nil { + jClient.URL = jenkins.URL + jClient.UserName = jenkins.UserName + jClient.Token = jenkins.Token + jClient.Proxy = jenkins.Proxy + jClient.ProxyAuth = jenkins.ProxyAuth + jClient.InsecureSkipVerify = jenkins.InsecureSkipVerify + } + return +} + // GetCurrentJenkinsAndClient returns the client func GetCurrentJenkinsAndClient(jClient *client.JenkinsCore) (jenkins *appCfg.JenkinsServer) { if jenkins = GetCurrentJenkinsFromOptions(); jenkins != nil { diff --git a/client/computer.go b/client/computer.go deleted file mode 100644 index f9d4001c..00000000 --- a/client/computer.go +++ /dev/null @@ -1,174 +0,0 @@ -package client - -import ( - "encoding/xml" - "fmt" - httpdownloader "github.com/linuxsuren/http-downloader/pkg" - "io/ioutil" - "net/http" - "net/url" - "runtime" - "strings" -) - -// ComputerClient is client for operate computers -type ComputerClient struct { - JenkinsCore -} - -// List get the computer list -func (c *ComputerClient) List() (computers ComputerList, err error) { - err = c.RequestWithData(http.MethodGet, "/computer/api/json", - nil, nil, 200, &computers) - return -} - -// Launch starts up a agent -func (c *ComputerClient) Launch(name string) (err error) { - api := fmt.Sprintf("/computer/%s/launchSlaveAgent", name) - _, err = c.RequestWithoutData(http.MethodPost, api, nil, nil, 200) - return -} - -// Delete removes a agent from Jenkins -func (c *ComputerClient) Delete(name string) (err error) { - api := fmt.Sprintf("/computer/%s/doDelete", name) - _, err = c.RequestWithoutData(http.MethodPost, api, nil, nil, 200) - return -} - -type agentJNLP struct { - XMLName xml.Name `xml:"jnlp"` - AppArguments []string `xml:"application-desc>argument"` -} - -// GetSecret returns the secret of an agent -func (c *ComputerClient) GetSecret(name string) (secret string, err error) { - api := fmt.Sprintf("/computer/%s/slave-agent.jnlp", name) - var response *http.Response - if response, err = c.RequestWithResponse(http.MethodGet, api, nil, nil); err == nil { - if response.StatusCode == http.StatusOK { - var data []byte - if data, err = ioutil.ReadAll(response.Body); err == nil { - jnlp := &agentJNLP{} - if err = xml.Unmarshal(data, jnlp); err == nil { - secret = jnlp.AppArguments[0] - } else { - err = fmt.Errorf("invalid jnlp xml, error: %v", err) - } - } - } else { - err = fmt.Errorf("unexpected status code: %d", response.StatusCode) - } - } - return -} - -// GetLog fetch the log a computer -func (c *ComputerClient) GetLog(name string) (log string, err error) { - var response *http.Response - api := fmt.Sprintf("/computer/%s/logText/progressiveText", name) - if response, err = c.RequestWithResponse(http.MethodGet, api, nil, nil); err == nil { - statusCode := response.StatusCode - if statusCode != 200 { - err = fmt.Errorf("unexpected status code %d", statusCode) - return - } - - var data []byte - if data, err = ioutil.ReadAll(response.Body); err == nil { - log = string(data) - } - } - return -} - -// Create creates a computer by name -func (c *ComputerClient) Create(name string) (err error) { - formData := url.Values{ - "name": {name}, - "mode": {"hudson.slaves.DumbSlave"}, - } - payload := strings.NewReader(formData.Encode()) - if _, err = c.RequestWithoutData(http.MethodPost, "/computer/createItem", - map[string]string{httpdownloader.ContentType: httpdownloader.ApplicationForm}, payload, 200); err == nil { - payload = GetPayloadForCreateAgent(name) - _, err = c.RequestWithoutData(http.MethodPost, "/computer/doCreateItem", - map[string]string{httpdownloader.ContentType: httpdownloader.ApplicationForm}, payload, 200) - } - return -} - -func getDefaultAgentLabels() string { - return fmt.Sprintf("%s %s", runtime.GOOS, runtime.GOARCH) -} - -// GetDefaultAgentWorkDir returns the Jenkins agent work dir -func GetDefaultAgentWorkDir() string { - // TODO return different directory base on the OS - return "/var/tmp/jenkins" -} - -// GetPayloadForCreateAgent returns a payload for creating an agent -func GetPayloadForCreateAgent(name string) *strings.Reader { - palyLoad := fmt.Sprintf(`{ - "name": "%s", - "nodeDescription": "", - "numExecutors": "1", - "remoteFS": "%s", - "labelString": "%s", - "mode": "NORMAL", - "launcher": { - "$class": "hudson.slaves.JNLPLauncher", - "workDirSettings": { - "disabled": false, - "workDirPath": "", - "internalDir": "remoting", - "failIfWorkDirIsMissing": false - }, - "tunnel": "", - "vmargs": "" - }, - "type": "hudson.slaves.DumbSlave" -}`, name, GetDefaultAgentWorkDir(), getDefaultAgentLabels()) - formData := url.Values{ - "name": {name}, - "type": {"hudson.slaves.DumbSlave"}, - "json": {palyLoad}, - } - return strings.NewReader(formData.Encode()) -} - -// Computer is the agent of Jenkins -type Computer struct { - AssignedLabels []ComputerLabel - Description string - DisplayName string - Idle bool - JnlpAgent bool - LaunchSupported bool - ManualLaunchAllowed bool - NumExecutors int - Offline bool - OfflineCause OfflineCause - OfflineCauseReason string - TemporarilyOffline bool -} - -// OfflineCause is the cause of computer offline -type OfflineCause struct { - Timestamp int64 - Description string -} - -// ComputerList represents the list of computer from API -type ComputerList struct { - busyExecutors int - Computer []Computer - TotalExecutors int -} - -// ComputerLabel represents the label of a computer -type ComputerLabel struct { - Name string -} diff --git a/client/computer_test.go b/client/computer_test.go deleted file mode 100644 index 44567317..00000000 --- a/client/computer_test.go +++ /dev/null @@ -1,87 +0,0 @@ -package client_test - -import ( - "github.com/golang/mock/gomock" - "github.com/jenkins-zh/jenkins-cli/client" - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" -) - -var _ = Describe("computer test", func() { - var ( - ctrl *gomock.Controller - computerClient client.ComputerClient - roundTripper *mhttp.MockRoundTripper - name string - ) - - BeforeEach(func() { - ctrl = gomock.NewController(GinkgoT()) - roundTripper = mhttp.NewMockRoundTripper(ctrl) - - computerClient = client.ComputerClient{} - computerClient.RoundTripper = roundTripper - computerClient.URL = "http://localhost" - name = "fake-name" - }) - - AfterEach(func() { - ctrl.Finish() - }) - - It("List", func() { - client.PrepareForComputerListRequest(roundTripper, computerClient.URL, "", "") - - computers, err := computerClient.List() - Expect(err).NotTo(HaveOccurred()) - Expect(computers).NotTo(BeNil()) - Expect(len(computers.Computer)).To(Equal(2)) - }) - - It("Launch", func() { - client.PrepareForLaunchComputer(roundTripper, computerClient.URL, "", "", name) - - err := computerClient.Launch(name) - Expect(err).NotTo(HaveOccurred()) - }) - - It("GetLog", func() { - client.PrepareForComputerLogRequest(roundTripper, computerClient.URL, "", "", name) - - log, err := computerClient.GetLog(name) - Expect(err).NotTo(HaveOccurred()) - Expect(log).To(Equal("fake-log")) - }) - - It("GetLog with 500", func() { - client.PrepareForComputerLogRequestWithCode(roundTripper, computerClient.URL, "", "", name, 500) - - _, err := computerClient.GetLog(name) - Expect(err).To(HaveOccurred()) - }) - - It("Delete an agent", func() { - client.PrepareForComputerDeleteRequest(roundTripper, computerClient.URL, "", "", name) - - err := computerClient.Delete(name) - Expect(err).NotTo(HaveOccurred()) - }) - - It("GetSecret of an agent", func() { - secret := "fake-secret" - client.PrepareForComputerAgentSecretRequest(roundTripper, - computerClient.URL, "", "", name, secret) - - result, err := computerClient.GetSecret(name) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(Equal(secret)) - }) - - It("Create an agent", func() { - client.PrepareForComputerCreateRequest(roundTripper, computerClient.URL, "", "", name) - - err := computerClient.Create(name) - Expect(err).NotTo(HaveOccurred()) - }) -}) diff --git a/client/computer_test_common.go b/client/computer_test_common.go deleted file mode 100644 index aafa6aaa..00000000 --- a/client/computer_test_common.go +++ /dev/null @@ -1,174 +0,0 @@ -package client - -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - - "github.com/jenkins-zh/jenkins-cli/mock/mhttp" - httpdownloader "github.com/linuxsuren/http-downloader/pkg" -) - -// PrepareForComputerListRequest only for test -func PrepareForComputerListRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password string) { - request, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/computer/api/json", rootURL), nil) - response := &http.Response{ - StatusCode: 200, - Request: request, - Body: ioutil.NopCloser(bytes.NewBufferString(PrepareForComputerList())), - } - roundTripper.EXPECT(). - RoundTrip(NewRequestMatcher(request)).Return(response, nil) - if user != "" && password != "" { - request.SetBasicAuth(user, password) - } -} - -// PrepareForLaunchComputer only for test -func PrepareForLaunchComputer(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string) { - request, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/computer/%s/launchSlaveAgent", rootURL, name), nil) - PrepareCommonPost(request, "", roundTripper, user, password, rootURL) -} - -// PrepareForComputerLogRequest only for test -func PrepareForComputerLogRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string) { - PrepareForComputerLogRequestWithCode(roundTripper, rootURL, user, password, name, 200) -} - -// PrepareForComputerLogRequestWithCode only for test -func PrepareForComputerLogRequestWithCode(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, - name string, statusCode int) { - request, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/computer/%s/logText/progressiveText", rootURL, name), nil) - response := &http.Response{ - StatusCode: statusCode, - Request: request, - Body: ioutil.NopCloser(bytes.NewBufferString(`fake-log`)), - } - roundTripper.EXPECT(). - RoundTrip(NewRequestMatcher(request)).Return(response, nil) - if user != "" && password != "" { - request.SetBasicAuth(user, password) - } -} - -// PrepareForComputerDeleteRequest only for test -func PrepareForComputerDeleteRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string) { - request, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/computer/%s/doDelete", rootURL, name), nil) - PrepareCommonPost(request, "", roundTripper, user, password, rootURL) -} - -// PrepareForComputerAgentSecretRequest only for test -func PrepareForComputerAgentSecretRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name, secret string) { - request, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/instance/agentSecret?name=%s", rootURL, name), nil) - PrepareCommonPost(request, secret, roundTripper, user, password, rootURL) -} - -// PrepareForComputerCreateRequest only for test -func PrepareForComputerCreateRequest(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, name string) { - formData := url.Values{ - "name": {name}, - "mode": {"hudson.slaves.DumbSlave"}, - } - payload := strings.NewReader(formData.Encode()) - request, _ := http.NewRequest(http.MethodPost, fmt.Sprintf("%s/computer/createItem", rootURL), payload) - request.Header.Add(httpdownloader.ContentType, httpdownloader.ApplicationForm) - PrepareCommonPost(request, "", roundTripper, user, password, rootURL) - - payload = GetPayloadForCreateAgent(name) - request, _ = http.NewRequest(http.MethodPost, fmt.Sprintf("%s/computer/doCreateItem", rootURL), payload) - request.Header.Add(httpdownloader.ContentType, httpdownloader.ApplicationForm) - PrepareCommonPost(request, "", roundTripper, user, password, rootURL) -} - -// PrepareForComputerList only for test -func PrepareForComputerList() string { - return ` -{ - "_class" : "hudson.model.ComputerSet", - "busyExecutors" : 1, - "computer" : [ - {"offline" : true}, - { - "_class" : "hudson.model.Hudson$MasterComputer", - "actions" : [ - { - - }, - { - - } - ], - "assignedLabels" : [ - { - "name" : "master" - } - ], - "description" : "Jenkins的master节点", - "displayName" : "master", - "executors" : [ - { - - }, - { - - } - ], - "icon" : "computer.png", - "iconClassName" : "icon-computer", - "idle" : false, - "jnlpAgent" : false, - "launchSupported" : true, - "loadStatistics" : { - "_class" : "hudson.model.Label$1" - }, - "manualLaunchAllowed" : true, - "monitorData" : { - "hudson.node_monitors.SwapSpaceMonitor" : { - "_class" : "hudson.node_monitors.SwapSpaceMonitor$MemoryUsage2", - "availablePhysicalMemory" : 533508096, - "availableSwapSpace" : 0, - "totalPhysicalMemory" : 16656797696, - "totalSwapSpace" : 0 - }, - "hudson.node_monitors.TemporarySpaceMonitor" : { - "_class" : "hudson.node_monitors.DiskSpaceMonitorDescriptor$DiskSpace", - "timestamp" : 1574952137138, - "path" : "/tmp", - "size" : 31745785856 - }, - "hudson.node_monitors.DiskSpaceMonitor" : { - "_class" : "hudson.node_monitors.DiskSpaceMonitorDescriptor$DiskSpace", - "timestamp" : 1574952136930, - "path" : "/var/jenkins_home", - "size" : 31745785856 - }, - "hudson.node_monitors.ArchitectureMonitor" : "Linux (amd64)", - "hudson.node_monitors.ResponseTimeMonitor" : { - "_class" : "hudson.node_monitors.ResponseTimeMonitor$Data", - "timestamp" : 1574952136931, - "average" : 0 - }, - "hudson.node_monitors.ClockMonitor" : { - "_class" : "hudson.util.ClockDifference", - "diff" : 0 - } - }, - "numExecutors" : 2, - "offline" : false, - "offlineCause" : null, - "offlineCauseReason" : "", - "oneOffExecutors" : [ - { - - } - ], - "temporarilyOffline" : false - } - ], - "displayName" : "节点列表", - "totalExecutors" : 2 -}` -} diff --git a/go.mod b/go.mod index a7703e20..ff59f445 100644 --- a/go.mod +++ b/go.mod @@ -8,10 +8,11 @@ require ( github.com/Pallinder/go-randomdata v1.2.0 github.com/atotto/clipboard v0.1.4 github.com/chai2010/gettext-go v0.0.0-20170215093142-bf70f2a70fb1 - github.com/golang/mock v1.5.0 + github.com/golang/mock v1.6.0 github.com/google/go-github/v29 v29.0.3 github.com/hashicorp/go-version v1.2.1 github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 + github.com/jenkins-zh/jenkins-client v0.0.1 github.com/jenkins-zh/jenkins-formulas v0.0.5 github.com/linuxsuren/cobra-extension v0.0.10 github.com/linuxsuren/go-cli-alias v0.0.6 @@ -20,12 +21,12 @@ require ( github.com/magiconair/properties v1.8.5 github.com/mitchellh/go-homedir v1.1.0 github.com/onsi/ginkgo v1.16.4 - github.com/onsi/gomega v1.14.0 + github.com/onsi/gomega v1.15.0 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/spf13/cobra v1.1.3 github.com/stretchr/testify v1.7.0 github.com/zalando/go-keyring v0.0.0-20200121091418-667557018717 - go.uber.org/zap v1.16.0 + go.uber.org/zap v1.19.0 golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 golang.org/x/text v0.3.6 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 1f88cd94..4b4f7b08 100644 --- a/go.sum +++ b/go.sum @@ -15,7 +15,6 @@ github.com/AlecAivazis/survey/v2 v2.2.2/go.mod h1:9FJRdMdDm8rnT+zHVbvQT2RTSTLq0T github.com/AlecAivazis/survey/v2 v2.2.12/go.mod h1:6d4saEvBsfSHXeN1a5OA5m2+HJ2LuVokllnC77pAIKI= github.com/AlecAivazis/survey/v2 v2.2.16 h1:KJ4fLFqY/NfR5OaFLcf4pThxrlV2YCHGCnCHAKLsJ+U= github.com/AlecAivazis/survey/v2 v2.2.16/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg= -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/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -41,6 +40,8 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkY github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/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= @@ -99,8 +100,9 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb 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= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +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= @@ -174,6 +176,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jenkins-zh/jenkins-cli v0.0.32/go.mod h1:uE1mH9PNITrg0sugv6HXuM/CSddg0zxXoYu3w57I3JY= +github.com/jenkins-zh/jenkins-client v0.0.1 h1:+84X9Ce8sQaYNHIgzsm0a16mb0uYeFOhXM9nDx5dsXk= +github.com/jenkins-zh/jenkins-client v0.0.1/go.mod h1:ICBk7OOoTafVP//f/VfKZ34c0ff8vJwVnOsF9btiMYU= github.com/jenkins-zh/jenkins-formulas v0.0.5 h1:6d/WoZCSdjTMRry1wHRe2rrf6zQHlfXmaPbp0Bi3I6w= github.com/jenkins-zh/jenkins-formulas v0.0.5/go.mod h1:zS8fm8u5L6FcjZM0QznXsLV9T2UtSVK+hT6Sm76iUZ4= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -260,8 +264,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= -github.com/onsi/gomega v1.14.0 h1:ep6kpPVwmr/nTbklSx2nrLNSIO62DoYAhnPNIMhK8gI= -github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= +github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -337,22 +341,27 @@ github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6e github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 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/zalando/go-keyring v0.0.0-20200121091418-667557018717 h1:3M/uUZajYn/082wzUajekePxpUAZhMTfXvI9R+26SJ0= github.com/zalando/go-keyring v0.0.0-20200121091418-667557018717/go.mod h1:RaxNwUITJaHVdQ0VC7pELPZ3tOWn13nr0gZMZEhpVU0= 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.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.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.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +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-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -385,8 +394,8 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU 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= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 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= @@ -410,6 +419,7 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -421,6 +431,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/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-20210220032951-036812b2e83c/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= @@ -453,8 +464,10 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +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 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w= @@ -487,14 +500,15 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= 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= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= @@ -556,12 +570,12 @@ 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= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= moul.io/http2curl v1.0.0 h1:6XwpyZOYsgZJrU8exnG87ncVkU1FVCcTRpwzOkTDUi8= moul.io/http2curl v1.0.0/go.mod h1:f6cULg+e4Md/oW1cYmwW4IWQOVl2lGbmCNGOHvzX2kE=