mocks

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsumerGroupsCommandClient

type ConsumerGroupsCommandClient struct {
	GroupsFn         func() ([]string, error)
	GroupInvocations int

	DescribeGroupFn          func(group string) ([]exporter.PartitionInfo, error)
	DescribeGroupInvocations int
}

ConsumerGroupsCommandClient is a fake Kafka queries which can be used for testing purposes when Kafka and/or the `kafka-consumer-groups.sh` is missing.

func NewBasicConsumerGroupsCommandClient

func NewBasicConsumerGroupsCommandClient() *ConsumerGroupsCommandClient

NewBasicConsumerGroupsCommandClient creates a new ConsumerGroupsCommandClient with prepopulated functions. For mocking, you can override the function implementations.

func (*ConsumerGroupsCommandClient) DescribeGroup

func (col *ConsumerGroupsCommandClient) DescribeGroup(_ context.Context, group string) ([]exporter.PartitionInfo, error)

DescribeGroup returns a single fake partition for the group that Groups returns. For other consumer groups it returns an error.

func (*ConsumerGroupsCommandClient) Groups

Groups returns a list of a single group.

Source Files

  • collector.go

Jump to

Keyboard shortcuts

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