list

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListConsumerGroupsCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists the consumer groups",
	Run: func(command *cobra.Command, args []string) {
		cobraUtil := base.NewCobraUtil(command)

		addr := strings.Split(cobraUtil.GetStringArg("broker-list"), ",")

		cgl := consumerGroupAdmin{
			saramaClient: client.NewSaramaClient(addr),
		}
		err := cgl.ListGroups(cobraUtil.GetStringArg("topic"))
		if err != nil {
			logger.Fatalf("Error while listing consumer groups for %v topic", err)
		}
	},
}
View Source
var ListTopicCmd = &cobra.Command{
	Use:   "list",
	Short: "Lists the topics satisfying the passed criteria if any",
	Run: func(command *cobra.Command, args []string) {
		cobraUtil := base.NewCobraUtil(command)
		lastWrite := int64(cobraUtil.GetIntArg("last-write"))
		size := int64(cobraUtil.GetIntArg("size"))
		var baseCmd *base.Cmd
		if lastWrite == 0 {
			baseCmd = base.Init(cobraUtil)
		} else {
			baseCmd = base.Init(cobraUtil, base.WithSSH())
		}

		l := listTopic{
			Lister:            baseCmd.GetTopic(),
			replicationFactor: cobraUtil.GetIntArg("replication-factor"),
			lastWrite:         lastWrite,
			dataDir:           cobraUtil.GetStringArg("data-dir"),
			size:              size,
		}
		l.listTopic()
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL