kafka

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 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 added in v0.2.2

type Broker struct {
	ID   string `json:"id,omitempty"`
	Addr string `json:"addr,omitempty"`
}

Broker represents kafka broker.

type ConfigEntry

type ConfigEntry struct {
	Name      string
	Value     string
	ReadOnly  bool
	Default   bool
	Sensitive bool
}

ConfigEntry represents topic configuration.

type FlowKafka

type FlowKafka interface {
	CreateTopic(topic string, numPartitions int, replicationFactor int, retentionMs string) error
	DeleteTopic(topic string) error
	DescribeTopic(topic string) (*Topic, error)
	Pipe(ctx context.Context, c <-chan Message, topic string) error
	Produce(ctx context.Context, topic string, msg Message) error
	Read(ctx context.Context, topic string, bufferSize int) <-chan Message
	BrokerInfo(ctx context.Context) ([]Broker, error)
}

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

func NewFlowKafka

func NewFlowKafka(c *ServiceConfig) FlowKafka

NewFlowKafka create new instance of service

type Message added in v0.2.1

type Message struct {
	Key, Value []byte
}

type Metadata

type Metadata struct {
	Topics []*Topic
}

Metadata represents topics details.

type ServiceConfig

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

type Topic

type Topic struct {
	Name     string         `json:"name,omitempty"`
	Configs  []*ConfigEntry `json:"configs,omitempty"`
	ErrorMsg *string        `json:"errorMsg,omitempty"`
}

Topic represents kafka topic.

Jump to

Keyboard shortcuts

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