kafka

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package kafka profiles kafka-go producers and consumers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Connection   string
	Topic        string
	GroupID      string
	CaptureValue bool
	ValueLimit   int
}

Config controls Kafka metadata and optional bounded message-value capture.

type Reader

type Reader interface {
	// ReadMessage waits for and returns the next message using ctx.
	ReadMessage(context.Context) (kafka.Message, error)
}

Reader is the kafka-go consumer method wrapped by ProfileReader.

func ProfileReader

func ProfileReader(reader Reader, configs ...Config) Reader

ProfileReader wraps reader with the default profiler and records each consumed message as a job.

func ProfileReaderWith

func ProfileReaderWith(p *webpprof.Profiler, reader Reader, configs ...Config) Reader

ProfileReaderWith wraps reader with p. Nil profilers or readers are returned unchanged.

type Writer

type Writer interface {
	// WriteMessages writes one or more messages using ctx.
	WriteMessages(context.Context, ...kafka.Message) error
}

Writer is the kafka-go producer method wrapped by ProfileWriter.

func ProfileWriter

func ProfileWriter(writer Writer, configs ...Config) Writer

ProfileWriter wraps writer with the default profiler and records each producer attempt as a job dispatch.

func ProfileWriterWith

func ProfileWriterWith(p *webpprof.Profiler, writer Writer, configs ...Config) Writer

ProfileWriterWith wraps writer with p. Nil profilers or writers are returned unchanged.

Jump to

Keyboard shortcuts

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