Version: v0.19.1 Latest Latest

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

Go to latest
Published: Dec 15, 2015 License: MIT, Apache-2.0 Imports: 10 Imported by: 0



Integration with kafka & zoopeeker test helpers.

KafkaCluster depends on docker and docker-compose commands.

IMPORTANT: Make sure to update KAFKA_ADVERTISED_HOST_NAME in kafka-docker/docker-compose.yml before running tests.


kafka-docker directory is copy of wurstmeister/kafka-docker repository.




This section is empty.


This section is empty.


This section is empty.


type Container

type Container struct {
	ID     string `json:"Id"`
	Image  string
	Args   []string
	Config struct {
		Cmd          []string
		Env          []string
		ExposedPorts map[string]interface{}
	NetworkSettings struct {
		Gateway   string
		IPAddress string
		Ports     map[string][]PortMapping
	// contains filtered or unexported fields

func (*Container) Kill

func (c *Container) Kill() error

func (*Container) RunningKafka

func (c *Container) RunningKafka() bool

RunningKafka returns true if container is running kafka node

func (*Container) Start

func (c *Container) Start() error

Start starts current container

func (*Container) Stop

func (c *Container) Stop() error

Stop stops current container

type KafkaCluster

type KafkaCluster struct {
	// contains filtered or unexported fields

func NewKafkaCluster

func NewKafkaCluster(kafkaDockerDir string, size int) *KafkaCluster

func (*KafkaCluster) ContainerKill

func (cluster *KafkaCluster) ContainerKill(containerID string) error

func (*KafkaCluster) ContainerStart

func (cluster *KafkaCluster) ContainerStart(containerID string) error

func (*KafkaCluster) ContainerStop

func (cluster *KafkaCluster) ContainerStop(containerID string) error

func (*KafkaCluster) Containers

func (cluster *KafkaCluster) Containers() ([]*Container, error)

Containers inspect all containers running within cluster and return information about them.

func (*KafkaCluster) KafkaAddrs

func (cluster *KafkaCluster) KafkaAddrs() ([]string, error)

KafkaAddrs return list of kafka node addresses as strings, in form <host>:<port>

func (*KafkaCluster) Start

func (cluster *KafkaCluster) Start() error

Start start zookeeper and kafka nodes using docker-compose command. Upon successful process spawn, cluster is scaled to required amount of nodes.

func (*KafkaCluster) Stop

func (cluster *KafkaCluster) Stop() error

Stop stop all services running for the cluster by sending SIGINT to docker-compose process.

type PortMapping

type PortMapping struct {
	HostIP   string `json:"HostIp"`
	HostPort string

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL