kafka

package
v0.0.0-...-44e1a4f Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

Broker implements the broker interface for Kafka.

func (*Broker) Start

func (k *Broker) Start(host, port string) (interface{}, error)

Start will start the message broker and prepare it for testing.

func (*Broker) Stop

func (k *Broker) Stop() (interface{}, error)

Stop will stop the message broker.

type Peer

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

Peer implements the peer interface for Kafka.

func NewPeer

func NewPeer(host string) (*Peer, error)

NewPeer creates and returns a new Peer for communicating with Kafka.

func (*Peer) Done

func (k *Peer) Done()

Done signals to the peer that message publishing has completed.

func (*Peer) Errors

func (k *Peer) Errors() <-chan error

Errors returns the channel on which the peer sends publish errors.

func (*Peer) Recv

func (k *Peer) Recv() ([]byte, error)

Recv returns a single message consumed by the peer. Subscribe must be called before this. It returns an error if the receive failed.

func (*Peer) Send

func (k *Peer) Send() chan<- []byte

Send returns a channel on which messages can be sent for publishing.

func (*Peer) Setup

func (k *Peer) Setup()

Setup prepares the peer for testing.

func (*Peer) Subscribe

func (k *Peer) Subscribe() error

Subscribe prepares the peer to consume messages.

func (*Peer) Teardown

func (k *Peer) Teardown()

Teardown performs any cleanup logic that needs to be performed after the test is complete.

Jump to

Keyboard shortcuts

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