cli

package
v0.0.0-...-e78f20e Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIRunner

type CLIRunner struct {
	// contains filtered or unexported fields
}

CLIRunner is a utility that runs commands from either the command-line or the repl.

func NewCLIRunner

func NewCLIRunner(
	adminClient admin.Client,
	printer func(f string, a ...interface{}),
	showSpinner bool,
) *CLIRunner

NewCLIRunner creates and returns a new CLIRunner instance.

func (*CLIRunner) ApplyTopic

func (c *CLIRunner) ApplyTopic(
	ctx context.Context,
	applierConfig apply.TopicApplierConfig,
) error

ApplyTopic does an apply run according to the spec in the argument config.

func (*CLIRunner) BootstrapTopics

func (c *CLIRunner) BootstrapTopics(
	ctx context.Context,
	topics []string,
	clusterConfig config.ClusterConfig,
	matchRegexpStr string,
	excludeRegexpStr string,
	outputDir string,
	overwrite bool,
) error

BootstrapTopics creates configs for one or more topics based on their current state in the cluster.

func (*CLIRunner) CheckTopic

func (c *CLIRunner) CheckTopic(
	ctx context.Context,
	checkConfig check.CheckConfig,
) (bool, error)

CheckTopic runs a topic check against a single topic and prints a summary of the results out.

func (*CLIRunner) GetBrokerBalance

func (c *CLIRunner) GetBrokerBalance(ctx context.Context, topicName string) error

GetBrokerBalance evaluates the balance of the brokers for a single topic and prints a summary out for user inspection.

func (*CLIRunner) GetBrokers

func (c *CLIRunner) GetBrokers(ctx context.Context, full bool) error

GetBrokers gets all brokers and prints out a summary for the user.

func (*CLIRunner) GetConfig

func (c *CLIRunner) GetConfig(ctx context.Context, brokerOrTopic string) error

GetConfig fetches the config for a broker or topic and prints it out for user inspection.

func (*CLIRunner) GetGroupMembers

func (c *CLIRunner) GetGroupMembers(ctx context.Context, groupID string, full bool) error

GetGroupMembers fetches and prints out information about every member in a consumer group.

func (*CLIRunner) GetGroups

func (c *CLIRunner) GetGroups(ctx context.Context) error

GetGroups fetches all consumer groups and prints them out for user inspection.

func (*CLIRunner) GetMemberLags

func (c *CLIRunner) GetMemberLags(
	ctx context.Context,
	topic string,
	groupID string,
	full bool,
	sortByValues bool,
) error

GetMemberLags fetches and prints a summary of the consumer group lag for each partition in a single topic.

func (*CLIRunner) GetOffsets

func (c *CLIRunner) GetOffsets(ctx context.Context, topic string) error

GetOffsets fetches details about all partition offsets in a single topic and prints out a summary.

func (*CLIRunner) GetPartitions

func (c *CLIRunner) GetPartitions(ctx context.Context, topic string) error

GetPartitions fetches the details of each partition in a topic and prints out a summary for user inspection.

func (*CLIRunner) GetTopics

func (c *CLIRunner) GetTopics(ctx context.Context, full bool) error

GetTopics fetches the details of each topic in the cluster and prints out a summary.

func (*CLIRunner) ResetOffsets

func (c *CLIRunner) ResetOffsets(
	ctx context.Context,
	topic string,
	groupID string,
	partitionOffsets map[int]int64,
) error

ResetOffsets resets the offsets for a single consumer group / topic combination.

func (*CLIRunner) Tail

func (c *CLIRunner) Tail(
	ctx context.Context,
	topic string,
	offset int64,
	partitions []int,
	maxMessages int,
	filterRegexp string,
	raw bool,
	headers bool,
) error

Tail prints out a stream of the latest messages in a topic.

type Repl

type Repl struct {
	// contains filtered or unexported fields
}

Repl manages the repl mode for topicctl.

func NewRepl

func NewRepl(
	ctx context.Context,
	adminClient admin.Client,
) (*Repl, error)

NewRepl initializes and returns a Repl instance.

func (*Repl) Run

func (r *Repl) Run()

Run starts the repl main loop.

Jump to

Keyboard shortcuts

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