factory

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMemoryProfileHandler

func CreateMemoryProfileHandler() http.Handler

func CreateOffsetManagerHandler

func CreateOffsetManagerHandler(db libkv.DB, cancel context.CancelFunc) http.Handler

CreateOffsetManagerHandler creates a standardized HTTP handler for DB-based offset management. This handler provides a RESTful interface to manage Kafka consumer offsets stored in a database.

Parameters:

  • db: Database connection for storing offset information
  • cancel: Context cancellation function for graceful shutdown

Returns an HTTP handler that can be mounted at /offsetmanager endpoint.

Example usage:

router.Path("/offsetmanager").Handler(factory.CreateOffsetManagerHandler(db, cancel))

func CreateResetBucketHandler

func CreateResetBucketHandler(db libkv.DB, cancel context.CancelFunc) http.Handler

func CreateResetHandler

func CreateResetHandler(db libkv.DB, cancel context.CancelFunc) http.Handler

func CreateSaramaOffsetManagerHandler

func CreateSaramaOffsetManagerHandler(
	saramaClientProvider libkafka.SaramaClientProvider,
	group libkafka.Group,
	cancel context.CancelFunc,
) http.Handler

CreateSaramaOffsetManagerHandler creates a standardized HTTP handler for Sarama-based offset management. This handler provides a RESTful interface to manage Kafka consumer offsets using Sarama client.

Parameters:

  • saramaClient: Sarama Kafka client for offset operations
  • group: Kafka consumer group for offset management
  • cancel: Context cancellation function for graceful shutdown

Returns an HTTP handler that can be mounted at /offsetmanager endpoint.

Example usage:

router.Path("/offsetmanager").Handler(factory.CreateSaramaOffsetManagerHandler(saramaClient, group, cancel))

func CreateSetLoglevelHandler

func CreateSetLoglevelHandler(ctx context.Context) http.Handler

func NewSyncProducerWithName

func NewSyncProducerWithName(
	ctx context.Context,
	brokers libkafka.Brokers,
	name string,
	opts ...libkafka.SaramaConfigOptions,
) (libkafka.SyncProducer, error)

NewSyncProducerWithName creates a sync producer that adds a 'name' header to all messages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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