From 1bf13bbf59120efd6eddc3c4eb0ab94d6e791ce3 Mon Sep 17 00:00:00 2001 From: Jahor Laryn Date: Sun, 13 Nov 2022 23:03:29 +0300 Subject: [PATCH 1/2] Implement currencies cmds --- cmd/billing.go | 25 +++++++++++--- cmd/currency/create.go | 76 ++++++++++++++++++++++++++++++++++++++++++ cmd/currency/delete.go | 71 +++++++++++++++++++++++++++++++++++++++ cmd/currency/get.go | 70 ++++++++++++++++++++++++++++++++++++++ cmd/currency/list.go | 72 +++++++++++++++++++++++++++++++++++++++ cmd/currency/main.go | 60 +++++++++++++++++++++++++++++++++ cmd/currency/update.go | 76 ++++++++++++++++++++++++++++++++++++++++++ go.mod | 10 +++--- go.sum | 6 ++++ 9 files changed, 456 insertions(+), 10 deletions(-) create mode 100644 cmd/currency/create.go create mode 100644 cmd/currency/delete.go create mode 100644 cmd/currency/get.go create mode 100644 cmd/currency/list.go create mode 100644 cmd/currency/main.go create mode 100644 cmd/currency/update.go diff --git a/cmd/billing.go b/cmd/billing.go index 1971ba6..5ffbd73 100644 --- a/cmd/billing.go +++ b/cmd/billing.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, @@ -17,17 +17,33 @@ package cmd import ( "github.com/slntopp/nocloud-cli/cmd/billing" + "github.com/slntopp/nocloud-cli/cmd/currency" "github.com/spf13/cobra" ) -// accountCmd represents the account command +// billingCmd represents the billing command var billingCmd = &cobra.Command{ - Use: "billing", + Use: "billing", Aliases: []string{"bill"}, - Short: "Manage Billing Plans", + Short: "Manage Billing Plans", +} + +// CurrenciesCmd represents the currencies command +var currenciesCmd = &cobra.Command{ + Use: "currencies", + Aliases: []string{"cur", "curs"}, + Short: "Manage Currencies", } func init() { + currenciesCmd.AddCommand(currency.GetCmd) + currenciesCmd.AddCommand(currency.ListCurrenciesCmd) + currenciesCmd.AddCommand(currency.ListRatesCmd) + currenciesCmd.AddCommand(currency.CreateCmd) + currenciesCmd.AddCommand(currency.DeleteCmd) + currenciesCmd.AddCommand(currency.UpdateCmd) + billingCmd.AddCommand(currenciesCmd) + billingCmd.AddCommand(billing.CreateCmd) billingCmd.AddCommand(billing.GetCmd) billingCmd.AddCommand(billing.ListCmd) @@ -37,4 +53,3 @@ func init() { rootCmd.AddCommand(billingCmd) } - diff --git a/cmd/currency/create.go b/cmd/currency/create.go new file mode 100644 index 0000000..12efc85 --- /dev/null +++ b/cmd/currency/create.go @@ -0,0 +1,76 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "errors" + "fmt" + + "github.com/slntopp/nocloud-cli/pkg/tools" + "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/cobra" +) + +var CreateCmd = &cobra.Command{ + Use: "create [flags]", + Aliases: []string{"crt", "c"}, + Short: "Create Exchange rate", + RunE: func(cmd *cobra.Command, args []string) error { + var ( + from int + to int + rate float64 + ) + from, err := cmd.Flags().GetInt("from") + if err != nil || from == -1 { + return errors.New("empty from") + } + to, err = cmd.Flags().GetInt("to") + if err != nil || to == -1 { + return errors.New("empty to") + } + rate, err = cmd.Flags().GetFloat64("rate") + if err != nil { + return errors.New("empty rate") + } + + ctx, client := MakeCurrencyServiceClientOrFail() + res, err := client.CreateExchangeRate(ctx, &proto.CreateExchangeRateRequest{ + From: proto.Currency(from), + To: proto.Currency(to), + Rate: rate, + }) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, res) + if err != nil { + return err + } + if !ok { + fmt.Println("Successfully created ", res) + } + + return nil + }, +} + +func init() { + CreateCmd.Flags().Int("from", -1, "") + CreateCmd.Flags().Int("to", -1, "") + CreateCmd.Flags().Float64("rate", 1.0, "") +} diff --git a/cmd/currency/delete.go b/cmd/currency/delete.go new file mode 100644 index 0000000..59f3608 --- /dev/null +++ b/cmd/currency/delete.go @@ -0,0 +1,71 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "errors" + "fmt" + + "github.com/slntopp/nocloud-cli/pkg/tools" + "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/cobra" +) + +// DeleteCmd represents the delete command +var DeleteCmd = &cobra.Command{ + Use: "delete [flags]", + Aliases: []string{"del", "rm", "r"}, + Short: "Delete exchange rate", + Args: cobra.MinimumNArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + var ( + from int + to int + ) + from, err := cmd.Flags().GetInt("from") + if err != nil || from == -1 { + return errors.New("empty from") + } + to, err = cmd.Flags().GetInt("to") + if err != nil || to == -1 { + return errors.New("empty to") + } + + ctx, client := MakeCurrencyServiceClientOrFail() + res, err := client.DeleteExchangeRate(ctx, &proto.DeleteExchangeRateRequest{ + From: proto.Currency(from), + To: proto.Currency(to), + }) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, res) + if err != nil { + return err + } + if !ok { + fmt.Println("Success deleted ", res) + } + + return nil + }, +} + +func init() { + DeleteCmd.Flags().Int("from", -1, "") + DeleteCmd.Flags().Int("to", -1, "") +} diff --git a/cmd/currency/get.go b/cmd/currency/get.go new file mode 100644 index 0000000..65fcda8 --- /dev/null +++ b/cmd/currency/get.go @@ -0,0 +1,70 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "errors" + "fmt" + + "github.com/slntopp/nocloud-cli/pkg/tools" + "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/cobra" +) + +// GetCmd represents the get command +var GetCmd = &cobra.Command{ + Use: "get [flags]", + Short: "Get exchange rate", + Args: cobra.MinimumNArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + var ( + from int + to int + ) + from, err := cmd.Flags().GetInt("from") + if err != nil || from == -1 { + return errors.New("empty from") + } + to, err = cmd.Flags().GetInt("to") + if err != nil || to == -1 { + return errors.New("empty to") + } + + ctx, client := MakeCurrencyServiceClientOrFail() + res, err := client.GetExchangeRate(ctx, &proto.GetExchangeRateRequest{ + From: proto.Currency(from), + To: proto.Currency(to), + }) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, res) + if err != nil { + return err + } + if !ok { + fmt.Println("Successfully fetched ", res) + } + + return nil + }, +} + +func init() { + GetCmd.Flags().Int("from", -1, "") + GetCmd.Flags().Int("to", -1, "") +} diff --git a/cmd/currency/list.go b/cmd/currency/list.go new file mode 100644 index 0000000..4f250a5 --- /dev/null +++ b/cmd/currency/list.go @@ -0,0 +1,72 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "fmt" + + "github.com/slntopp/nocloud-cli/pkg/tools" + "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/cobra" +) + +// ListCurrenciesCmd represents the list currencies command +var ListCurrenciesCmd = &cobra.Command{ + Use: "currencies", + Aliases: []string{"curs"}, + Short: "List currencies", + Args: cobra.MinimumNArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, client := MakeCurrencyServiceClientOrFail() + curs, err := client.GetCurrencies(ctx, &proto.GetCurrenciesRequest{}) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, curs) + if err != nil { + return err + } + if !ok { + fmt.Println("Successfully fetched ", curs) + } + return nil + }, +} + +// ListRatesCmd represents the list rates command +var ListRatesCmd = &cobra.Command{ + Use: "rates", + Aliases: []string{"exchangerates"}, + Short: "List exchange rates", + Args: cobra.MinimumNArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, client := MakeCurrencyServiceClientOrFail() + rates, err := client.GetExchangeRates(ctx, &proto.GetExchangeRatesRequest{}) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, rates) + if err != nil { + return err + } + if !ok { + fmt.Println("Successfully fetched ", rates) + } + return nil + }, +} diff --git a/cmd/currency/main.go b/cmd/currency/main.go new file mode 100644 index 0000000..b73b10c --- /dev/null +++ b/cmd/currency/main.go @@ -0,0 +1,60 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "context" + "crypto/tls" + "fmt" + "os" + + pb "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/viper" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/metadata" +) + +func MakeCurrencyServiceClientOrFail() (context.Context, pb.CurrencyServiceClient) { + host := viper.Get("nocloud") + if host == nil { + fmt.Fprintln(os.Stderr, "Error setting connection up") + panic("Host is unset") + } + + creds := credentials.NewTLS(&tls.Config{InsecureSkipVerify: true}) + insec := viper.GetBool("insecure") + if insec { + creds = insecure.NewCredentials() + } + conn, err := grpc.Dial(host.(string), grpc.WithTransportCredentials(creds)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error setting connection up") + panic(err) + } + + token := viper.Get("token") + if token == nil { + fmt.Fprintln(os.Stderr, "Error setting connection up") + panic("Token is unset") + } + + client := pb.NewCurrencyServiceClient(conn) + ctx := context.Background() + ctx = metadata.AppendToOutgoingContext(ctx, "authorization", "bearer "+token.(string)) + return ctx, client +} diff --git a/cmd/currency/update.go b/cmd/currency/update.go new file mode 100644 index 0000000..72f5412 --- /dev/null +++ b/cmd/currency/update.go @@ -0,0 +1,76 @@ +/* +Copyright © 2021-2022 Nikita Ivanovski info@slnt-opp.xyz + +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 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package currency + +import ( + "errors" + "fmt" + + "github.com/slntopp/nocloud-cli/pkg/tools" + "github.com/slntopp/nocloud/pkg/billing/proto" + "github.com/spf13/cobra" +) + +var UpdateCmd = &cobra.Command{ + Use: "update [flags]", + Aliases: []string{"upd", "u"}, + Short: "Update Exchange rate", + RunE: func(cmd *cobra.Command, args []string) error { + var ( + from int + to int + rate float64 + ) + from, err := cmd.Flags().GetInt("from") + if err != nil || from == -1 { + return errors.New("empty from") + } + to, err = cmd.Flags().GetInt("to") + if err != nil || to == -1 { + return errors.New("empty to") + } + rate, err = cmd.Flags().GetFloat64("rate") + if err != nil { + return errors.New("empty rate") + } + + ctx, client := MakeCurrencyServiceClientOrFail() + res, err := client.UpdateExchangeRate(ctx, &proto.UpdateExchangeRateRequest{ + From: proto.Currency(from), + To: proto.Currency(to), + Rate: rate, + }) + if err != nil { + return err + } + + ok, err := tools.PrintJsonDataQ(cmd, res) + if err != nil { + return err + } + if !ok { + fmt.Println("Successfully updated ", res) + } + + return nil + }, +} + +func init() { + UpdateCmd.Flags().Int("from", -1, "") + UpdateCmd.Flags().Int("to", -1, "") + UpdateCmd.Flags().Float64("rate", 1.0, "") +} diff --git a/go.mod b/go.mod index b022167..e3c6816 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.4.2 github.com/jroimartin/gocui v0.5.0 github.com/manifoldco/promptui v0.9.0 - github.com/slntopp/nocloud v0.0.16-r04 + github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605 github.com/slntopp/nocloud-cc v0.0.1-r3 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.14.0 @@ -21,7 +21,7 @@ require ( github.com/chzyer/readline v1.5.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/magiconair/properties v1.8.6 // indirect @@ -36,9 +36,9 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect - golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect - golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect - google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/sys v0.2.0 // indirect + google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 9095921..690b5e6 100644 --- a/go.sum +++ b/go.sum @@ -130,6 +130,7 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 h1:kr3j8iIMR4ywO/O0rvksXaJvauGGCMg2zAZIiNZ9uIQ= github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0/go.mod h1:ummNFgdgLhhX7aIiy35vVmQNS0rWXknfPE0qe6fmFXg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0/go.mod h1:uY3Aurq+SxwQCpdX91xZ9CgxIMT1EsYtcidljXufYIY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -180,6 +181,8 @@ github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBO github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/slntopp/nocloud v0.0.16-r04 h1:VlFMq7IR+jOxHlyL/men0bXWwnq/q1OJyZ4xZw6XDWc= github.com/slntopp/nocloud v0.0.16-r04/go.mod h1:/QhbxILi0FAPL0XgO5JOshJlwXQjupxnMqlseyAnFDY= +github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605 h1:GmGyLv+QMBrUCQqo0kKca40YpA8M7JwWxEwBHcDnrBk= +github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605/go.mod h1:CuSGqXajag1/HhXbDbtMnNE3RhyEHikmjNENCv4mPog= github.com/slntopp/nocloud-cc v0.0.1-r3 h1:VjeF5zvryNAiFjZJUNM4RfUiVQfeWsOS09U2FCQVPUA= github.com/slntopp/nocloud-cc v0.0.1-r3/go.mod h1:oEveMBVWpxonO+VfeHoJBjiXGr0gAQyrVVOyJ8moiqE= github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= @@ -289,6 +292,7 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -347,6 +351,7 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -474,6 +479,7 @@ google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y= google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= 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= From 3c99d21d621eea46bdb9556e2ddaa9712d0b37ed Mon Sep 17 00:00:00 2001 From: Jahor Laryn Date: Mon, 14 Nov 2022 15:14:07 +0300 Subject: [PATCH 2/2] Use different commit version --- go.mod | 2 +- go.sum | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index e3c6816..f5ceb87 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.4.2 github.com/jroimartin/gocui v0.5.0 github.com/manifoldco/promptui v0.9.0 - github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605 + github.com/slntopp/nocloud v0.0.16-r04.0.20221114120939-9f82021717e2 github.com/slntopp/nocloud-cc v0.0.1-r3 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.14.0 diff --git a/go.sum b/go.sum index 690b5e6..1fe08df 100644 --- a/go.sum +++ b/go.sum @@ -128,8 +128,7 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ 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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 h1:kr3j8iIMR4ywO/O0rvksXaJvauGGCMg2zAZIiNZ9uIQ= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0/go.mod h1:ummNFgdgLhhX7aIiy35vVmQNS0rWXknfPE0qe6fmFXg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0 h1:fi9bGIUJOGzzrHBbP8NWbTfNC5fKO6X7kFw40TOqGB8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0/go.mod h1:uY3Aurq+SxwQCpdX91xZ9CgxIMT1EsYtcidljXufYIY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -179,10 +178,8 @@ github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/slntopp/nocloud v0.0.16-r04 h1:VlFMq7IR+jOxHlyL/men0bXWwnq/q1OJyZ4xZw6XDWc= -github.com/slntopp/nocloud v0.0.16-r04/go.mod h1:/QhbxILi0FAPL0XgO5JOshJlwXQjupxnMqlseyAnFDY= -github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605 h1:GmGyLv+QMBrUCQqo0kKca40YpA8M7JwWxEwBHcDnrBk= -github.com/slntopp/nocloud v0.0.16-r04.0.20221113192145-2b8e97c6d605/go.mod h1:CuSGqXajag1/HhXbDbtMnNE3RhyEHikmjNENCv4mPog= +github.com/slntopp/nocloud v0.0.16-r04.0.20221114120939-9f82021717e2 h1:xFMiWF5vX08dw2ypTdiDb1P/U56akDhVJEZ8FPg2uHQ= +github.com/slntopp/nocloud v0.0.16-r04.0.20221114120939-9f82021717e2/go.mod h1:/QhbxILi0FAPL0XgO5JOshJlwXQjupxnMqlseyAnFDY= github.com/slntopp/nocloud-cc v0.0.1-r3 h1:VjeF5zvryNAiFjZJUNM4RfUiVQfeWsOS09U2FCQVPUA= github.com/slntopp/nocloud-cc v0.0.1-r3/go.mod h1:oEveMBVWpxonO+VfeHoJBjiXGr0gAQyrVVOyJ8moiqE= github.com/spf13/afero v1.9.2 h1:j49Hj62F0n+DaZ1dDCvhABaPNSGNkt32oRFxI33IEMw= @@ -290,8 +287,7 @@ golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b h1:tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -349,8 +345,7 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -477,8 +472,7 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= +google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=