integration

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: MIT Imports: 10 Imported by: 0

README

integration

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
}

Jump to

Keyboard shortcuts

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