kafka

package
v0.1.72 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2019 License: MIT Imports: 4 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 interface {
	CreateTopics(request *sarama.CreateTopicsRequest) (*sarama.CreateTopicsResponse, error)
	DeleteTopics(request *sarama.DeleteTopicsRequest) (*sarama.DeleteTopicsResponse, error)
	DescribeConfigs(request *sarama.DescribeConfigsRequest) (*sarama.DescribeConfigsResponse, error)
	GetMetadata(request *sarama.MetadataRequest) (*sarama.MetadataResponse, error)
	Open(conf *sarama.Config) error
	Close() error
}

Broker needs to be wrapped so it can be tested

type FlowKafka

type FlowKafka interface {
	CreateTopic(topic string, numPartitions int, replicationFactor int, retentionMs string) error
	DeleteTopic(topic string) error
	DescribeTopic(topic ...string) ([]*pkg.Topic, error)
	GetMetadata() (*pkg.Metadata, error)
	Produce(topic string, msg []byte) error
}

FlowKafka is an interface representing operations that can be make with Kafka Cluster

func NewFlowKafka

func NewFlowKafka(c *ServiceConfig) FlowKafka

NewFlowKafka create new instance of service

type ServiceConfig

type ServiceConfig struct {
	BootstrapBroker string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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