From f9a0d5e991f3b4742492412c9f0984031ca8ec44 Mon Sep 17 00:00:00 2001 From: Rodrigo Bernardi Date: Tue, 30 Jul 2024 09:58:24 -0300 Subject: [PATCH] feat: some updates --- .github/workflows/pre-commit.yml | 4 +- .github/workflows/release.yml | 2 +- .pre-commit-config.yaml | 5 +- .tool-versions | 1 + README.md | 3 +- go.mod | 82 ++++--- go.sum | 247 +++++++++++----------- internal/pkg/configuration/kaftaconfig.go | 2 +- internal/pkg/flag/bool_flag.go | 68 ++++++ internal/pkg/flag/string_flag.go | 18 ++ internal/pkg/kafka/acl.go | 2 +- internal/pkg/kafka/broker.go | 2 +- internal/pkg/kafka/broker_config.go | 2 +- internal/pkg/kafka/broker_manager.go | 29 ++- internal/pkg/kafka/broker_metadata.go | 42 ++-- internal/pkg/kafka/connection.go | 7 +- internal/pkg/kafka/console_consumer.go | 9 +- internal/pkg/kafka/console_producer.go | 2 +- internal/pkg/kafka/consumer_group.go | 2 +- internal/pkg/kafka/scram_client.go | 4 +- internal/pkg/kafka/topic.go | 2 +- internal/pkg/kafka/topic_config.go | 2 +- internal/pkg/ui/prompt.go | 65 ------ pkg/cmd/cli/acl/acl_cmd.go | 2 +- pkg/cmd/cli/acl/create_acl.go | 2 +- pkg/cmd/cli/acl/delete_acl.go | 2 +- pkg/cmd/cli/acl/list_acls.go | 2 +- pkg/cmd/cli/broker/broker_cmd.go | 1 + pkg/cmd/cli/broker/describe_broker.go | 86 ++++++++ pkg/cmd/cli/config/create_context.go | 236 +++++++++++---------- pkg/cmd/cli/consumer/describe_consumer.go | 2 +- pkg/cmd/cli/topic/describe_topic.go | 2 +- 32 files changed, 538 insertions(+), 399 deletions(-) create mode 100644 .tool-versions create mode 100644 internal/pkg/flag/bool_flag.go delete mode 100644 internal/pkg/ui/prompt.go create mode 100644 pkg/cmd/cli/broker/describe_broker.go diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index b831924..1d3c4df 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 id: go - name: Install go dependencies run: | @@ -24,7 +24,7 @@ jobs: go install github.com/securego/gosec/v2/cmd/gosec@latest go install github.com/fzipp/gocyclo/cmd/gocyclo@latest go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - go install -v github.com/go-critic/go-critic/cmd/gocritic@latest + go install github.com/go-critic/go-critic/cmd/gocritic@latest go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run pre-commit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0989f5..1e20064 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.22 id: go - name: Run GoReleaser diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 72f9dc7..d988b33 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-byte-order-marker @@ -22,9 +22,8 @@ repos: - id: go-mod-tidy-repo - id: go-test-repo-mod - id: go-vet-repo-mod - # - id: go-revive-repo-mod - id: go-sec-repo-mod - id: go-staticcheck-repo-mod - - id: go-imports-repo # replaces go-fmt-repo + - id: go-imports-repo - id: go-critic - id: golangci-lint-repo-mod diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..3960504 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +golang 1.22.2 diff --git a/README.md b/README.md index adf0108..c4596a3 100644 --- a/README.md +++ b/README.md @@ -16,13 +16,14 @@ Kafta is a modern non-JVM command line for managing Kafka Clusters written in go - [Producer](#producer) - [Consumer](#consumer) - [Subjects List](#subjects-list) +- [💻 Code Contributors](#-code-contributors) - [Next features](#next-features) # Overview Kafta provides a simple interface to manage topics, brokers, consumer-groups and many things like that. Interfaces are similar to kubectl & go tools. -It is built using [sarama](https://github.com/Shopify/sarama). +It is built using [sarama](https://github.com/IBM/sarama). Kafta provides: * Easy commands CLIs: `kafta topic list`, `kafta cluster describe`, etc. diff --git a/go.mod b/go.mod index c04f9da..fb4fa2d 100644 --- a/go.mod +++ b/go.mod @@ -1,61 +1,73 @@ module github.com/electric-saw/kafta -go 1.19 +go 1.22 require ( - github.com/Shopify/sarama v1.38.1 + github.com/IBM/sarama v1.43.2 github.com/Songmu/prompter v0.5.1 - github.com/jedib0t/go-pretty/v6 v6.4.6 + github.com/charmbracelet/huh v0.5.2 + github.com/jedib0t/go-pretty/v6 v6.5.9 github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de - github.com/manifoldco/promptui v0.9.0 - github.com/pterm/pterm v0.12.62 github.com/riferrei/srclient v0.6.0 - github.com/sirupsen/logrus v1.9.0 - github.com/spf13/cobra v1.6.1 - github.com/thediveo/enumflag/v2 v2.0.2 + github.com/sirupsen/logrus v1.9.3 + github.com/spf13/cobra v1.8.1 + github.com/thediveo/enumflag/v2 v2.0.5 github.com/xdg/scram v1.0.5 gopkg.in/yaml.v3 v3.0.1 ) require ( - atomicgo.dev/cursor v0.1.1 // indirect - atomicgo.dev/keyboard v0.2.9 // indirect - atomicgo.dev/schedule v0.0.2 // indirect - github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect - github.com/containerd/console v1.0.3 // indirect + github.com/atotto/clipboard v0.1.4 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/catppuccin/go v0.2.0 // indirect + github.com/charmbracelet/bubbles v0.18.0 // indirect + github.com/charmbracelet/bubbletea v0.26.6 // indirect + github.com/charmbracelet/lipgloss v0.12.1 // indirect + github.com/charmbracelet/x/ansi v0.1.4 // indirect + github.com/charmbracelet/x/exp/strings v0.0.0-20240725160154-f9f6568126ec // indirect + github.com/charmbracelet/x/input v0.1.3 // indirect + github.com/charmbracelet/x/term v0.1.1 // indirect + github.com/charmbracelet/x/windows v0.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/eapache/go-resiliency v1.3.0 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/eapache/go-resiliency v1.7.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/gookit/color v1.5.3 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-uuid v1.0.3 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect github.com/jcmturner/gofork v1.7.6 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect - github.com/klauspost/compress v1.15.14 // indirect - github.com/linkedin/goavro/v2 v2.11.1 // indirect - github.com/lithammer/fuzzysearch v1.1.8 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/pierrec/lz4/v4 v4.1.17 // indirect + github.com/klauspost/compress v1.17.9 // indirect + github.com/kr/text v0.1.0 // indirect + github.com/linkedin/goavro/v2 v2.13.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rivo/uniseg v0.4.4 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xdg/stringprep v1.0.3 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect + golang.org/x/term v0.22.0 // indirect + golang.org/x/text v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index c4307a7..1d9da35 100644 --- a/go.sum +++ b/go.sum @@ -1,65 +1,72 @@ -atomicgo.dev/assert v0.0.2 h1:FiKeMiZSgRrZsPo9qn/7vmr7mCsh5SZyXY4YGYiYwrg= -atomicgo.dev/cursor v0.1.1 h1:0t9sxQomCTRh5ug+hAMCs59x/UmC9QL6Ci5uosINKD4= -atomicgo.dev/cursor v0.1.1/go.mod h1:Lr4ZJB3U7DfPPOkbH7/6TOtJ4vFGHlgj1nc+n900IpU= -atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8= -atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ= -atomicgo.dev/schedule v0.0.2 h1:2e/4KY6t3wokja01Cyty6qgkQM8MotJzjtqCH70oX2Q= -atomicgo.dev/schedule v0.0.2/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU= -github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs= -github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8= -github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII= -github.com/MarvinJWendt/testza v0.2.10/go.mod h1:pd+VWsoGUiFtq+hRKSU1Bktnn+DMCSrDrXDpX2bG66k= -github.com/MarvinJWendt/testza v0.2.12/go.mod h1:JOIegYyV7rX+7VZ9r77L/eH6CfJHHzXjB69adAhzZkI= -github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/2oUqKc6bF2c= -github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE= -github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4= -github.com/Shopify/sarama v1.38.1 h1:lqqPUPQZ7zPqYlWpTh+LQ9bhYNu2xJL6k1SJN4WVe2A= -github.com/Shopify/sarama v1.38.1/go.mod h1:iwv9a67Ha8VNa+TifujYoWGxWnu2kNVAQdSdZ4X2o5g= -github.com/Shopify/toxiproxy/v2 v2.5.0 h1:i4LPT+qrSlKNtQf5QliVjdP08GyAH8+BUIc9gT0eahc= +github.com/IBM/sarama v1.43.2 h1:HABeEqRUh32z8yzY2hGB/j8mHSzC/HA9zlEjqFNCzSw= +github.com/IBM/sarama v1.43.2/go.mod h1:Kyo4WkF24Z+1nz7xeVUFWIuKVV8RS3wM8mkvPKMdXFQ= github.com/Songmu/prompter v0.5.1 h1:IAsttKsOZWSDw7bV1mtGn9TAmLFAjXbp9I/eYmUUogo= github.com/Songmu/prompter v0.5.1/go.mod h1:CS3jEPD6h9IaLaG6afrl1orTgII9+uDWuw95dr6xHSw= -github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= +github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/catppuccin/go v0.2.0 h1:ktBeIrIP42b/8FGiScP9sgrWOss3lw0Z5SktRoithGA= +github.com/catppuccin/go v0.2.0/go.mod h1:8IHJuMGaUUjQM82qBrGNBv7LFq6JI3NnQCF6MOlZjpc= +github.com/charmbracelet/bubbles v0.18.0 h1:PYv1A036luoBGroX6VWjQIE9Syf2Wby2oOl/39KLfy0= +github.com/charmbracelet/bubbles v0.18.0/go.mod h1:08qhZhtIwzgrtBjAcJnij1t1H0ZRjwHyGsy6AL11PSw= +github.com/charmbracelet/bubbletea v0.26.6 h1:zTCWSuST+3yZYZnVSvbXwKOPRSNZceVeqpzOLN2zq1s= +github.com/charmbracelet/bubbletea v0.26.6/go.mod h1:dz8CWPlfCCGLFbBlTY4N7bjLiyOGDJEnd2Muu7pOWhk= +github.com/charmbracelet/huh v0.5.2 h1:ofeNkJ4iaFnzv46Njhx896DzLUe/j0L2QAf8znwzX4c= +github.com/charmbracelet/huh v0.5.2/go.mod h1:Sf7dY0oAn6N/e3sXJFtFX9hdQLrUdO3z7AYollG9bAM= +github.com/charmbracelet/lipgloss v0.12.1 h1:/gmzszl+pedQpjCOH+wFkZr/N90Snz40J/NR7A0zQcs= +github.com/charmbracelet/lipgloss v0.12.1/go.mod h1:V2CiwIuhx9S1S1ZlADfOj9HmxeMAORuz5izHb0zGbB8= +github.com/charmbracelet/x/ansi v0.1.4 h1:IEU3D6+dWwPSgZ6HBH+v6oUuZ/nVawMiWj5831KfiLM= +github.com/charmbracelet/x/ansi v0.1.4/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/exp/strings v0.0.0-20240725160154-f9f6568126ec h1:G79PnmxvVeo5FbAip3VPqAaBkOeXExwvhIBUfrXD5MA= +github.com/charmbracelet/x/exp/strings v0.0.0-20240725160154-f9f6568126ec/go.mod h1:pBhA0ybfXv6hDjQUZ7hk1lVxBiUbupdw5R31yPUViVQ= +github.com/charmbracelet/x/exp/term v0.0.0-20240524151031-ff83003bf67a h1:k/s6UoOSVynWiw7PlclyGO2VdVs5ZLbMIHiGp4shFZE= +github.com/charmbracelet/x/exp/term v0.0.0-20240524151031-ff83003bf67a/go.mod h1:YBotIGhfoWhHDlnUpJMkjebGV2pdGRCn1Y4/Nk/vVcU= +github.com/charmbracelet/x/input v0.1.3 h1:oy4TMhyGQsYs/WWJwu1ELUMFnjiUAXwtDf048fHbCkg= +github.com/charmbracelet/x/input v0.1.3/go.mod h1:1gaCOyw1KI9e2j00j/BBZ4ErzRZqa05w0Ghn83yIhKU= +github.com/charmbracelet/x/term v0.1.1 h1:3cosVAiPOig+EV4X9U+3LDgtwwAoEzJjNdwbXDjF6yI= +github.com/charmbracelet/x/term v0.1.1/go.mod h1:wB1fHt5ECsu3mXYusyzcngVWWlu1KKUmmLhfgr/Flxw= +github.com/charmbracelet/x/windows v0.1.2 h1:Iumiwq2G+BRmgoayww/qfcvof7W/3uLoelhxojXlRWg= +github.com/charmbracelet/x/windows v0.1.2/go.mod h1:GLEO/l+lizvFDBPLIOk+49gdX49L9YWMB5t+DZd0jkQ= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/eapache/go-resiliency v1.3.0 h1:RRL0nge+cWGlxXbUzJ7yMcq6w2XBEr19dCN6HECGaT0= -github.com/eapache/go-resiliency v1.3.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= -github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6 h1:8yY/I9ndfrgrXUbOGObLHKBR4Fl3nZXwM2c7OYTT8hM= -github.com/eapache/go-xerial-snappy v0.0.0-20230111030713-bf00bc1b83b6/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= +github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= -github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= -github.com/gookit/color v1.5.3 h1:twfIhZs4QLCtimkP7MOxlF3A0U/5cDPseRT9M/+2SCE= -github.com/gookit/color v1.5.3/go.mod h1:NUzwzeehUfl7GIb36pqId+UGmRfQcU/WiiyTTeNjHtE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= @@ -68,156 +75,142 @@ github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVET github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.3 h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE/Tq8= -github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/jedib0t/go-pretty/v6 v6.4.6 h1:v6aG9h6Uby3IusSSEjHaZNXpHFhzqMmjXcPq1Rjl9Jw= -github.com/jedib0t/go-pretty/v6 v6.4.6/go.mod h1:Ndk3ase2CkQbXLLNf5QDHoYb6J9WtVfmHZu9n8rk2xs= -github.com/klauspost/compress v1.15.14 h1:i7WCKDToww0wA+9qrUZ1xOjp218vfFo3nTU6UHp+gOc= -github.com/klauspost/compress v1.15.14/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= -github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/jedib0t/go-pretty/v6 v6.5.9 h1:ACteMBRrrmm1gMsXe9PSTOClQ63IXDUt03H5U+UV8OU= +github.com/jedib0t/go-pretty/v6 v6.5.9/go.mod h1:zbn98qrYlh95FIhwwsbIip0LYpwSG8SUOScs+v9/t0E= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/linkedin/goavro/v2 v2.11.1 h1:4cuAtbDfqkKnBXp9E+tRkIJGa6W6iAjwonwt8O1f4U0= github.com/linkedin/goavro/v2 v2.11.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= -github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= -github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= -github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= -github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/onsi/ginkgo/v2 v2.8.3 h1:RpbK1G8nWPNaCVFBWsOGnEQQGgASi6b8fxcWBvDYjxQ= -github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754= -github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc= -github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= +github.com/linkedin/goavro/v2 v2.13.0 h1:L8eI8GcuciwUkt41Ej62joSZS4kKaYIUdze+6for9NU= +github.com/linkedin/goavro/v2 v2.13.0/go.mod h1:KXx+erlq+RPlGSPmLF7xGo6SAbh8sCQ53x064+ioxhk= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= +github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pterm/pterm v0.12.27/go.mod h1:PhQ89w4i95rhgE+xedAoqous6K9X+r6aSOI2eFF7DZI= -github.com/pterm/pterm v0.12.29/go.mod h1:WI3qxgvoQFFGKGjGnJR849gU0TsEOvKn5Q8LlY1U7lg= -github.com/pterm/pterm v0.12.30/go.mod h1:MOqLIyMOgmTDz9yorcYbcw+HsgoZo3BQfg2wtl3HEFE= -github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEejaWgXU= -github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE= -github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8= -github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s= -github.com/pterm/pterm v0.12.62 h1:Xjj5Wl6UR4Il9xOiDUOZRwReRTdO75if/JdWsn9I59s= -github.com/pterm/pterm v0.12.62/go.mod h1:+c3ujjE7N5qmNx6eKAa7YVSC6m/gCorJJKhzwYTbL90= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/riferrei/srclient v0.6.0 h1:60LWpQW66AAL5TtWuMPZEplwgWLUdCK3OBUbag/JWFg= github.com/riferrei/srclient v0.6.0/go.mod h1:e3nZcDdaOSsaYqiO18INPBK4qnJTjEEyL2rlJcsTtrA= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= -github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.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.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.4/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/thediveo/enumflag/v2 v2.0.2 h1:R3m5ooZgUsSAPfWRb6odxwpRCiPItZG4gWzF40NjEjs= -github.com/thediveo/enumflag/v2 v2.0.2/go.mod h1:dcXs1NWHBzuKen80WfdvAhSmbTWgDeXrktQ5DtBimAo= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/thediveo/enumflag/v2 v2.0.5 h1:VJjvlAqUb6m6mxOrB/0tfBJI0Kvi9wJ8ulh38xK87i8= +github.com/thediveo/enumflag/v2 v2.0.5/go.mod h1:0NcG67nYgwwFsAvoQCmezG0J0KaIxZ0f7skg9eLq1DA= +github.com/thediveo/success v1.0.1 h1:NVwUOwKUwaN8szjkJ+vsiM2L3sNBFscldoDJ2g2tAPg= +github.com/thediveo/success v1.0.1/go.mod h1:AZ8oUArgbIsCuDEWrzWNQHdKnPbDOLQsWOFj9ynwLt0= github.com/xdg/scram v1.0.5 h1:TuS0RFmt5Is5qm9Tm2SoD89OPqe4IRiFtyFY4iwWXsw= github.com/xdg/scram v1.0.5/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.3 h1:cmL5Enob4W83ti/ZHuZLuKD/xqJfus4fVPwE+/BDm+4= github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w= -golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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-20211013075003-97ac67df715c/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-20210809222454-d867a43fc93e/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-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/pkg/configuration/kaftaconfig.go b/internal/pkg/configuration/kaftaconfig.go index 9bffe4d..56540fd 100644 --- a/internal/pkg/configuration/kaftaconfig.go +++ b/internal/pkg/configuration/kaftaconfig.go @@ -7,7 +7,7 @@ import ( "path/filepath" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" "gopkg.in/yaml.v3" ) diff --git a/internal/pkg/flag/bool_flag.go b/internal/pkg/flag/bool_flag.go new file mode 100644 index 0000000..1f90002 --- /dev/null +++ b/internal/pkg/flag/bool_flag.go @@ -0,0 +1,68 @@ +package flag + +import ( + "strconv" + + "github.com/charmbracelet/huh" +) + +// BoolFlag is a bool flag compatible with flags and pflags that keeps track of whether it had a value supplied or not. +type BoolFlag struct { + // If Set has been invoked this value is true + provided bool + // The exact value provided on the flag + value bool +} + +func NewBool(defaultVal bool) BoolFlag { + return BoolFlag{value: defaultVal} +} + +func (f *BoolFlag) Default(value bool) { + f.value = value +} + +func (f BoolFlag) Value() bool { + return f.value +} + +func (f BoolFlag) String() string { + return strconv.FormatBool(f.value) +} + +func (f *BoolFlag) Set(value string) error { + if bValue, err := strconv.ParseBool(value); err == nil { + f.value = bValue + f.provided = true + return nil + + } else { + return err + } + +} + +func (f BoolFlag) Provided() bool { + return f.provided +} + +func (f *BoolFlag) Type() string { + return "bool" +} + +func (f *BoolFlag) HuhWraps() huh.Accessor[bool] { + return huhWrapperBool{f: f} +} + +type huhWrapperBool struct { + f *BoolFlag +} + +func (h huhWrapperBool) Get() bool { + return h.f.Value() +} + +func (h huhWrapperBool) Set(value bool) { + h.f.provided = true + h.f.value = value +} diff --git a/internal/pkg/flag/string_flag.go b/internal/pkg/flag/string_flag.go index 57b8915..9dee41f 100644 --- a/internal/pkg/flag/string_flag.go +++ b/internal/pkg/flag/string_flag.go @@ -1,5 +1,7 @@ package flag +import "github.com/charmbracelet/huh" + // StringFlag is a string flag compatible with flags and pflags that keeps track of whether it had a value supplied or not. type StringFlag struct { // If Set has been invoked this value is true @@ -38,3 +40,19 @@ func (f StringFlag) Provided() bool { func (f *StringFlag) Type() string { return "string" } + +func (f *StringFlag) HuhWraps() huh.Accessor[string] { + return huhWrapperString{f: f} +} + +type huhWrapperString struct { + f *StringFlag +} + +func (h huhWrapperString) Get() string { + return h.f.Value() +} + +func (h huhWrapperString) Set(value string) { + _ = h.f.Set(value) +} diff --git a/internal/pkg/kafka/acl.go b/internal/pkg/kafka/acl.go index 4f12a2e..1cab8af 100644 --- a/internal/pkg/kafka/acl.go +++ b/internal/pkg/kafka/acl.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) diff --git a/internal/pkg/kafka/broker.go b/internal/pkg/kafka/broker.go index c1483a7..ab2f36b 100644 --- a/internal/pkg/kafka/broker.go +++ b/internal/pkg/kafka/broker.go @@ -3,7 +3,7 @@ package kafka import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) const ControllerBrokerLabel = "*" diff --git a/internal/pkg/kafka/broker_config.go b/internal/pkg/kafka/broker_config.go index 49cf194..a2f7325 100644 --- a/internal/pkg/kafka/broker_config.go +++ b/internal/pkg/kafka/broker_config.go @@ -1,7 +1,7 @@ package kafka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) diff --git a/internal/pkg/kafka/broker_manager.go b/internal/pkg/kafka/broker_manager.go index c7a1ffd..53da464 100644 --- a/internal/pkg/kafka/broker_manager.go +++ b/internal/pkg/kafka/broker_manager.go @@ -3,20 +3,21 @@ package kafka import ( "fmt" "sort" - "strconv" "github.com/electric-saw/kafta/pkg/cmd/util" ) -func getBrokerByIdOrAddr(conn *KafkaConnection, idOrAddr string) (*Broker, error) { +func getBrokerByIdOrAddr(conn *KafkaConnection, idOrAddr any) (*Broker, error) { brokers := GetBrokers(conn) - if id, err := strconv.ParseInt(idOrAddr, 10, 64); err == nil { + + switch idOrAddr.(type) { + case int: for _, broker := range brokers { - if int64(broker.Id) == id { + if broker.Id == idOrAddr { return broker, nil } } - } else { + case string: for _, broker := range brokers { if broker.Host == idOrAddr { return broker, nil @@ -43,7 +44,7 @@ func GetBrokers(conn *KafkaConnection) BrokersById { return result } -func DescribeBroker(conn *KafkaConnection, idOrAddr string) *BrokerMetadata { +func DescribeBroker(conn *KafkaConnection, idOrAddr any) *BrokerMetadata { metadata := &BrokerMetadata{ Logs: make([]*LogFile, 0), Details: &Broker{}, @@ -53,6 +54,22 @@ func DescribeBroker(conn *KafkaConnection, idOrAddr string) *BrokerMetadata { metadata.Details = broker + logDirs, err := conn.Admin.DescribeLogDirs([]int32{int32(broker.Id)}) + util.CheckErr(err) + + for _, logDir := range logDirs { + + for _, dir := range logDir { + logFile := newLogFile(dir.Path) + for _, topic := range dir.Topics { + for _, partition := range topic.Partitions { + logFile.set(topic.Topic, partition.Size, partition.IsTemporary) + } + } + metadata.Logs = append(metadata.Logs, logFile) + } + } + err = broker.Open(conn.Client.Config()) util.CheckErr(err) defer broker.Close() diff --git a/internal/pkg/kafka/broker_metadata.go b/internal/pkg/kafka/broker_metadata.go index 36104fa..a78e37a 100644 --- a/internal/pkg/kafka/broker_metadata.go +++ b/internal/pkg/kafka/broker_metadata.go @@ -5,9 +5,9 @@ import ( ) type BrokerMetadata struct { - Details *Broker - ConsumerGroups []string - Logs []*LogFile + Details *Broker + Consumers []string + Logs []*LogFile } type aggregatedTopicSize map[string]*LogEntry @@ -23,25 +23,25 @@ type LogFile struct { Entries aggregatedTopicSize } -// func newLogFile(path string) *LogFile { -// return &LogFile{ -// Path: path, -// Entries: make(aggregatedTopicSize), -// } -// } +func newLogFile(path string) *LogFile { + return &LogFile{ + Path: path, + Entries: aggregatedTopicSize{}, + } +} -// func (l *LogFile) set(topic string, size int64, isTemp bool) { -// if _, ok := l.Entries[topic]; !ok { -// l.Entries[topic] = &LogEntry{ -// Topic: topic, -// } -// } -// if isTemp { -// l.Entries[topic].Temporary += uint64(size) -// } else { -// l.Entries[topic].Permanent += uint64(size) -// } -// } +func (l *LogFile) set(topic string, size int64, isTemp bool) { + if _, ok := l.Entries[topic]; !ok { + l.Entries[topic] = &LogEntry{ + Topic: topic, + } + } + if isTemp { + l.Entries[topic].Temporary += uint64(size) + } else { + l.Entries[topic].Permanent += uint64(size) + } +} func (l *LogFile) SortByPermanentSize() []*LogEntry { result := l.toSlice() diff --git a/internal/pkg/kafka/connection.go b/internal/pkg/kafka/connection.go index e7df4f5..6e48b58 100644 --- a/internal/pkg/kafka/connection.go +++ b/internal/pkg/kafka/connection.go @@ -6,7 +6,7 @@ import ( "encoding/base64" "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/pkg/cmd/util" "github.com/riferrei/srclient" @@ -38,9 +38,8 @@ func MakeConnectionContext(config *configuration.Configuration, context *configu } func (k *KafkaConnection) newTLSConfig() (*tls.Config, error) { - // #nosec tlsConfig := tls.Config{ - InsecureSkipVerify: true, // lgtm [go/disabled-certificate-check] + InsecureSkipVerify: true, // #nosec } // Load CA cert @@ -113,9 +112,11 @@ func (k *KafkaConnection) initAuth(clientConfig *sarama.Config) error { clientConfig.Net.SASL.Password = k.Context.SASL.Password switch k.Context.SASL.Algorithm { case "sha256": + case "SCRAM-SHA-256": clientConfig.Net.SASL.SCRAMClientGeneratorFunc = func() sarama.SCRAMClient { return &XDGSCRAMClient{HashGeneratorFcn: SHA256} } clientConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA256 case "sha512": + case "SCRAM-SHA-512": clientConfig.Net.SASL.SCRAMClientGeneratorFunc = func() sarama.SCRAMClient { return &XDGSCRAMClient{HashGeneratorFcn: SHA512} } clientConfig.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA512 default: diff --git a/internal/pkg/kafka/console_consumer.go b/internal/pkg/kafka/console_consumer.go index 18a8a6d..d682ada 100644 --- a/internal/pkg/kafka/console_consumer.go +++ b/internal/pkg/kafka/console_consumer.go @@ -10,7 +10,7 @@ import ( "syscall" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) @@ -33,7 +33,12 @@ func ConsumeMessage(conn *KafkaConnection, topic string, group string, verbose b } ctx, cancel := context.WithCancel(context.Background()) - client, err := sarama.NewConsumerGroup(conn.Context.BootstrapServers, group, conn.Client.Config()) + + cgConfig := conn.Client.Config() + + cgConfig.Consumer.Offsets.Initial = sarama.OffsetOldest + + client, err := sarama.NewConsumerGroup(conn.Context.BootstrapServers, group, cgConfig) util.CheckErr(err) diff --git a/internal/pkg/kafka/console_producer.go b/internal/pkg/kafka/console_producer.go index 1826fda..edec030 100644 --- a/internal/pkg/kafka/console_producer.go +++ b/internal/pkg/kafka/console_producer.go @@ -9,7 +9,7 @@ import ( "strings" "syscall" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) diff --git a/internal/pkg/kafka/consumer_group.go b/internal/pkg/kafka/consumer_group.go index 70dc16b..3023cae 100644 --- a/internal/pkg/kafka/consumer_group.go +++ b/internal/pkg/kafka/consumer_group.go @@ -1,7 +1,7 @@ package kafka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) diff --git a/internal/pkg/kafka/scram_client.go b/internal/pkg/kafka/scram_client.go index 19e47dd..6d8f51a 100644 --- a/internal/pkg/kafka/scram_client.go +++ b/internal/pkg/kafka/scram_client.go @@ -17,11 +17,11 @@ type XDGSCRAMClient struct { } func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) { - x.Client, err = x.HashGeneratorFcn.NewClient(userName, password, authzID) + x.Client, err = x.NewClient(userName, password, authzID) if err != nil { return err } - x.ClientConversation = x.Client.NewConversation() + x.ClientConversation = x.NewConversation() return nil } diff --git a/internal/pkg/kafka/topic.go b/internal/pkg/kafka/topic.go index 7595a69..d80856f 100644 --- a/internal/pkg/kafka/topic.go +++ b/internal/pkg/kafka/topic.go @@ -6,7 +6,7 @@ import ( "github.com/electric-saw/kafta/pkg/cmd/util" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) func ListAllTopics(conn *KafkaConnection) map[string]sarama.TopicDetail { diff --git a/internal/pkg/kafka/topic_config.go b/internal/pkg/kafka/topic_config.go index 8909d35..25da35a 100644 --- a/internal/pkg/kafka/topic_config.go +++ b/internal/pkg/kafka/topic_config.go @@ -1,7 +1,7 @@ package kafka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/pkg/cmd/util" ) diff --git a/internal/pkg/ui/prompt.go b/internal/pkg/ui/prompt.go deleted file mode 100644 index cfce589..0000000 --- a/internal/pkg/ui/prompt.go +++ /dev/null @@ -1,65 +0,0 @@ -package ui - -import ( - "github.com/manifoldco/promptui" - "github.com/pterm/pterm" -) - -func GetTextOrDef(question string, def string) string { - prompt := promptui.Prompt{ - Label: question, - Default: def, - } - - result, err := prompt.Run() - if err != nil || result == "" { - return def - } - - return result -} - -func GetText(question string, required bool) (string, error) { - for { - output, err := pterm.DefaultInteractiveTextInput. - WithMultiLine(false). - Show(question) - - if err != nil { - return "", err - } - - if len(output) == 0 && required { - println("Value is required!") - continue - } - - return output, nil - } -} - -func GetPassword(question string, required bool) (string, error) { - for { - output, err := pterm.DefaultInteractiveTextInput. - WithMask("*"). - Show(question) - - if err != nil { - return "", err - } - - if len(output) == 0 && required { - println("Value is required!") - continue - } - - return output, nil - } -} - -func GetConfirmation(question string, def bool) (bool, error) { - return pterm.DefaultInteractiveConfirm. - WithDefaultValue(def). - Show(question) - -} diff --git a/pkg/cmd/cli/acl/acl_cmd.go b/pkg/cmd/cli/acl/acl_cmd.go index ee877c1..6fc984f 100644 --- a/pkg/cmd/cli/acl/acl_cmd.go +++ b/pkg/cmd/cli/acl/acl_cmd.go @@ -1,7 +1,7 @@ package acl import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/spf13/cobra" ) diff --git a/pkg/cmd/cli/acl/create_acl.go b/pkg/cmd/cli/acl/create_acl.go index 9006260..99ff073 100644 --- a/pkg/cmd/cli/acl/create_acl.go +++ b/pkg/cmd/cli/acl/create_acl.go @@ -1,7 +1,7 @@ package acl import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/internal/pkg/kafka" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util" diff --git a/pkg/cmd/cli/acl/delete_acl.go b/pkg/cmd/cli/acl/delete_acl.go index 83a1495..7beac1e 100644 --- a/pkg/cmd/cli/acl/delete_acl.go +++ b/pkg/cmd/cli/acl/delete_acl.go @@ -1,7 +1,7 @@ package acl import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/internal/pkg/kafka" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util" diff --git a/pkg/cmd/cli/acl/list_acls.go b/pkg/cmd/cli/acl/list_acls.go index feb4792..1bb4f22 100644 --- a/pkg/cmd/cli/acl/list_acls.go +++ b/pkg/cmd/cli/acl/list_acls.go @@ -3,7 +3,7 @@ package acl import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/internal/pkg/kafka" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util" diff --git a/pkg/cmd/cli/broker/broker_cmd.go b/pkg/cmd/cli/broker/broker_cmd.go index 631f87b..65b3d15 100644 --- a/pkg/cmd/cli/broker/broker_cmd.go +++ b/pkg/cmd/cli/broker/broker_cmd.go @@ -19,6 +19,7 @@ func NewCmdBroker(config *configuration.Configuration) *cobra.Command { // Update config // Reset config? cmd.AddCommand(NewCmdClusterGetConfig(config)) + cmd.AddCommand(NewCmdClusterDescribe(config)) return cmd } diff --git a/pkg/cmd/cli/broker/describe_broker.go b/pkg/cmd/cli/broker/describe_broker.go new file mode 100644 index 0000000..e2cd9f7 --- /dev/null +++ b/pkg/cmd/cli/broker/describe_broker.go @@ -0,0 +1,86 @@ +package broker + +import ( + "strconv" + + "github.com/electric-saw/kafta/internal/pkg/configuration" + "github.com/electric-saw/kafta/internal/pkg/kafka" + "github.com/electric-saw/kafta/pkg/cmd/util" + "github.com/jedib0t/go-pretty/v6/table" + "github.com/spf13/cobra" +) + +type clusterDescribe struct { + config *configuration.Configuration + brokerId string +} + +func NewCmdClusterDescribe(config *configuration.Configuration) *cobra.Command { + options := &clusterDescribe{config: config} + cmd := &cobra.Command{ + Use: "describe BROKER_ID (not required)", + Short: "Show broker details", + Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(options.defaultValue(cmd)) + options.run(cmd) + }, + } + + return cmd +} + +func (o *clusterDescribe) defaultValue(cmd *cobra.Command) error { + args := cmd.Flags().Args() + + if len(args) == 0 { + conn := kafka.MakeConnection(o.config) + defer conn.Close() + + brokers := kafka.GetBrokers(conn) + + for _, broker := range brokers { + if broker.IsController { + o.brokerId = strconv.Itoa(int(broker.ID())) + } + } + + if o.brokerId == "" { + return util.HelpError(cmd, "Impossible find BrokerId coordinator") + } + } else { + o.brokerId = args[0] + } + + return nil +} + +func (o *clusterDescribe) run(cmd *cobra.Command) { + conn := kafka.MakeConnection(o.config) + defer conn.Close() + + description := kafka.DescribeBroker(conn, o.brokerId) + + // Print broker details + header := table.Row{"", ""} + rows := []table.Row{} + + rows = append(rows, table.Row{"ID", description.Details.ID()}) + rows = append(rows, table.Row{"Host", description.Details.Host}) + rows = append(rows, table.Row{"Rack", description.Details.Rack}) + rows = append(rows, table.Row{"Controller", description.Details.IsController}) + + util.PrintTable(header, rows) + + // Print broker logs + header = table.Row{"Path", "Permanent", "Temporary", "Total"} + rows = []table.Row{} + + for _, log := range description.Logs { + for _, entry := range log.Entries { + rows = append(rows, table.Row{log.Path, entry.Permanent, entry.Temporary, entry.Permanent + entry.Temporary}) + } + } + + util.PrintTable(header, rows) + +} diff --git a/pkg/cmd/cli/config/create_context.go b/pkg/cmd/cli/config/create_context.go index ffa9ebb..ec6484e 100644 --- a/pkg/cmd/cli/config/create_context.go +++ b/pkg/cmd/cli/config/create_context.go @@ -6,7 +6,6 @@ import ( "net" "os" "path/filepath" - "strconv" "strings" "time" @@ -15,9 +14,9 @@ import ( cliflag "github.com/electric-saw/kafta/internal/pkg/flag" "github.com/electric-saw/kafta/internal/pkg/kafka" - "github.com/electric-saw/kafta/internal/pkg/ui" + "github.com/charmbracelet/huh" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util" "github.com/spf13/cobra" @@ -35,9 +34,9 @@ type createContextOptions struct { version cliflag.StringFlag user cliflag.StringFlag password cliflag.StringFlag - useSASL cliflag.StringFlag + useSASL cliflag.BoolFlag algorithm cliflag.StringFlag - useTLS cliflag.StringFlag + useTLS cliflag.BoolFlag clientCertFile cliflag.StringFlag clientKeyFile cliflag.StringFlag caCertFile cliflag.StringFlag @@ -166,12 +165,7 @@ func (o *createContextOptions) modifyContext(context configuration.Context) (*co } if o.useSASL.Provided() { - outputUseSASL, err := strconv.ParseBool(o.useSASL.Value()) - if err != nil { - return nil, err - } - - modifiedContext.UseSASL = outputUseSASL + modifiedContext.UseSASL = o.useSASL.Value() } if o.algorithm.Provided() { @@ -187,12 +181,7 @@ func (o *createContextOptions) modifyContext(context configuration.Context) (*co } if o.useTLS.Provided() { - outputUseTLS, err := strconv.ParseBool(o.useTLS.Value()) - if err != nil { - return nil, err - } - - modifiedContext.UseTLS = outputUseTLS + modifiedContext.UseTLS = o.useTLS.Value() } if o.clientCertFile.Provided() { @@ -323,109 +312,122 @@ func (o *createContextOptions) promptNeeded(context *configuration.Context) erro return nil } - if !o.bootstrapServers.Provided() && len(context.BootstrapServers) == 0 { + groupSetup := []huh.Field{} - servers, err := ui.GetText("Bootstrap servers", true) - cmdutil.CheckErr(err) - err = o.bootstrapServers.Set(servers) - cmdutil.CheckErr(err) - } + groupSetup = append(groupSetup, huh.NewText(). + Title("Bootstrap servers"). + Placeholder("b-1.kafka.example.com,b-2.kafka.example.com,b-3.kafka.example.com"). + Accessor(o.bootstrapServers.HuhWraps()), + ) if !o.version.Provided() && len(context.KafkaVersion) == 0 { - version, err := ui.GetText("Kafka version", true) - cmdutil.CheckErr(err) - err = o.version.Set(version) - cmdutil.CheckErr(err) - } - - if !o.useSASL.Provided() { - sasl, err := ui.GetConfirmation("Use SASL", false) - cmdutil.CheckErr(err) - if sasl { - err := o.useSASL.Set("true") - cmdutil.CheckErr(err) - - if !o.algorithm.Provided() && len(context.SASL.Algorithm) == 0 { - algorithm, err := ui.GetText("SASL Algorithm", true) - cmdutil.CheckErr(err) - err = o.algorithm.Set(algorithm) - cmdutil.CheckErr(err) - } - - if !o.user.Provided() && len(context.SASL.Username) == 0 { - user, err := ui.GetText("User", true) - cmdutil.CheckErr(err) - err = o.user.Set(user) - cmdutil.CheckErr(err) - } - - if !o.password.Provided() && len(context.SASL.Password) == 0 { - password, err := ui.GetPassword("Password", true) - cmdutil.CheckErr(err) - err = o.password.Set(password) - cmdutil.CheckErr(err) - } - - } - } + groupSetup = append(groupSetup, huh.NewInput(). + Title("Kafka version"). + Placeholder("2.7.0"). + Accessor(o.version.HuhWraps()), + ) + } + + authGroup := []huh.Field{} + + groupSetup = append(groupSetup, huh.NewConfirm(). + Title("Use SASL Auth"). + Inline(true). + Affirmative("Yes"). + Negative("No"). + Accessor(o.useSASL.HuhWraps()), + ) + + authGroup = append(authGroup, + huh.NewSelect[string](). + Title("SASL Algorithm"). + Options(huh.NewOptions( + "PLAIN", + "SCRAM-SHA-256", + "SCRAM-SHA-512", + )...). + Accessor(o.algorithm.HuhWraps()), + + huh.NewInput(). + Title("User"). + Accessor(o.user.HuhWraps()), + huh.NewInput(). + Title("Password"). + EchoMode(huh.EchoModePassword). + Accessor(o.password.HuhWraps()), + ) if !o.useTLS.Provided() { - tls, err := ui.GetConfirmation("Use TLS", true) - cmdutil.CheckErr(err) - - if tls { - err := o.useTLS.Set("true") - cmdutil.CheckErr(err) - - useTlsCert, err := ui.GetConfirmation("Use TLS Cert files", false) - cmdutil.CheckErr(err) - - if useTlsCert { - if !o.clientCertFile.Provided() && len(context.TLS.ClientCertFile) == 0 { - clientCertFile, err := ui.GetText("TLS ClientCertFile", false) - cmdutil.CheckErr(err) - err = o.clientCertFile.Set(clientCertFile) - cmdutil.CheckErr(err) - } - - if !o.clientKeyFile.Provided() && len(context.TLS.ClientKeyFile) == 0 { - clientKeyFile, err := ui.GetText("TLS ClientKeyFile", false) - cmdutil.CheckErr(err) - err = o.clientKeyFile.Set(clientKeyFile) - cmdutil.CheckErr(err) - } - - if !o.caCertFile.Provided() && len(context.TLS.CaCertFile) == 0 { - caCertFile, err := ui.GetText("CaCertFile", false) - cmdutil.CheckErr(err) - err = o.caCertFile.Set(caCertFile) - cmdutil.CheckErr(err) - } - } - } - } - - if !o.schemaRegistry.Provided() { - schemaRegistry, err := ui.GetText("Schema registry", false) - cmdutil.CheckErr(err) - err = o.schemaRegistry.Set(schemaRegistry) - cmdutil.CheckErr(err) - - if o.schemaRegistry.Provided() && len(context.SchemaRegistryAuth.Secret) == 0 { - secret, err := ui.GetText("SchemaRegistry Secret", false) - cmdutil.CheckErr(err) - err = o.schemaRegistrySecret.Set(secret) - cmdutil.CheckErr(err) - } - - if o.schemaRegistry.Provided() && len(context.SchemaRegistryAuth.Key) == 0 { - key, err := ui.GetPassword("SchemaRegistry Key", false) - cmdutil.CheckErr(err) - err = o.schemaRegistryKey.Set(key) - cmdutil.CheckErr(err) - } - - } - - return nil + o.useTLS.Default(true) + } + + tlsEnable := huh.NewConfirm(). + Title("Use TLS"). + Inline(true). + Affirmative("Yes"). + Negative("No"). + Accessor(o.useTLS.HuhWraps()) + + tlsUseCertFiles := huh.NewConfirm(). + Title("Use TLS Cert files"). + Inline(true). + Affirmative("Yes"). + Negative("No"). + Key("useTLSFiles") + + tlsSetup := []huh.Field{ + huh.NewInput(). + Title("TLS ClientCertFile"). + Accessor(o.clientCertFile.HuhWraps()), + huh.NewInput(). + Title("TLS ClientKeyFile"). + Accessor(o.clientKeyFile.HuhWraps()), + huh.NewInput(). + Title("CaCertFile"). + Accessor(o.caCertFile.HuhWraps()), + } + + groupSchemaRegistry := []huh.Field{} + groupSchemaRegistryAuth := []huh.Field{} + + groupSchemaRegistry = append(groupSchemaRegistry, huh.NewConfirm(). + Title("Use Schema Registry"). + Inline(true). + Affirmative("Yes"). + Negative("No"). + Key("useSchemaRegistry"), + ) + + groupSchemaRegistryAuth = append(groupSchemaRegistryAuth, + huh.NewInput(). + Title("Schema Registry URL"). + Accessor(o.schemaRegistry.HuhWraps()), + + huh.NewInput(). + Title("Schema Registry User"). + Accessor(o.schemaRegistryKey.HuhWraps()), + huh.NewInput(). + Title("Schema Registry password"). + EchoMode(huh.EchoModePassword). + Accessor(o.schemaRegistrySecret.HuhWraps()), + ) + + form := huh.NewForm( + huh.NewGroup(groupSetup...), + huh.NewGroup(authGroup...).WithHideFunc(func() bool { + return !o.useSASL.Value() + }), + huh.NewGroup(tlsEnable), + huh.NewGroup(tlsUseCertFiles).WithHideFunc(func() bool { + return !o.useTLS.Value() + }), + huh.NewGroup(tlsSetup...).WithHideFunc(func() bool { + return !o.useTLS.Value() || !tlsUseCertFiles.GetValue().(bool) + }), + huh.NewGroup(groupSchemaRegistry...), + huh.NewGroup(groupSchemaRegistryAuth...).WithHideFunc(func() bool { + return !groupSchemaRegistry[0].(*huh.Confirm).GetValue().(bool) + }), + ) + return form.Run() } diff --git a/pkg/cmd/cli/consumer/describe_consumer.go b/pkg/cmd/cli/consumer/describe_consumer.go index 4b9e9ec..a563652 100644 --- a/pkg/cmd/cli/consumer/describe_consumer.go +++ b/pkg/cmd/cli/consumer/describe_consumer.go @@ -4,7 +4,7 @@ import ( "fmt" "sort" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/internal/pkg/kafka" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util" diff --git a/pkg/cmd/cli/topic/describe_topic.go b/pkg/cmd/cli/topic/describe_topic.go index f133983..79bcb05 100644 --- a/pkg/cmd/cli/topic/describe_topic.go +++ b/pkg/cmd/cli/topic/describe_topic.go @@ -3,7 +3,7 @@ package topic import ( "sort" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/electric-saw/kafta/internal/pkg/configuration" "github.com/electric-saw/kafta/internal/pkg/kafka" cmdutil "github.com/electric-saw/kafta/pkg/cmd/util"