kafkatest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = 3 * time.Second
View Source
var KafkaRawClient = kafka.Client{
	Addr:      kafka.TCP("localhost:9093"),
	Timeout:   DefaultTimeout,
	Transport: nil,
}
View Source
var LocalBroker = "localhost:9093"

Functions

func AppNameAndArgs added in v0.1.3

func AppNameAndArgs(cmd string) (appName string, args []string)

func CreateTopicWithConfig

func CreateTopicWithConfig(ctx context.Context, topic kafka.TopicConfig) error

func DeleteTopic

func DeleteTopic(ctx context.Context, topic string) error

func GetOutput added in v0.1.3

func GetOutput(cmd *exec.Cmd, wantErr bool) (io.ReadCloser, error)

func MinifyString added in v0.1.4

func MinifyString(str string) string

func ReadChanMessages

func ReadChanMessages(ctx context.Context, c <-chan consumer.Result) []consumer.Result

func SendMessage

func SendMessage(t *testing.T, brokers []string, topic string, key, message []byte)

func SendMessageToPartition

func SendMessageToPartition(t *testing.T, brokers []string, topic string, partition int, key, message []byte)

func SendMultipleMessagesToPartition added in v0.1.4

func SendMultipleMessagesToPartition(t *testing.T, brokers []string, topic string, msgs map[int]string)

func StreamToRead added in v0.1.3

func StreamToRead(wantErr bool, stdout, stderr io.ReadCloser) io.ReadCloser

Types

type Command added in v0.1.3

type Command struct {
	T *testing.T

	Cmd     string
	WantErr bool
	// contains filtered or unexported fields
}

func (*Command) Execute added in v0.1.3

func (c *Command) Execute(ctx context.Context)

func (*Command) GetOutput added in v0.1.3

func (c *Command) GetOutput() string

Jump to

Keyboard shortcuts

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