kafka

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigKeys added in v1.0.0

func ConfigKeys() []string

ConfigKeys lists every mock-config key the plugin accepts (aliases included).

func DefaultPorts added in v1.0.0

func DefaultPorts() map[string]string

DefaultPorts returns the host port used for each port key when the config does not set it.

Types

type KafkaConfig

type KafkaConfig struct {
	Image         string   `json:"image"`
	Port          string   `json:"port"`
	DockerPort    string   `json:"docker-port"`
	Topics        []string `json:"topics"`
	Partitions    int      `json:"partitions"`
	ContainerName string   `json:"container-name"`
}

KafkaConfig holds Kafka-specific configuration

type KafkaPlugin

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

KafkaPlugin implements the ServicePlugin interface for a single-node Kafka broker running in KRaft mode.

func NewKafkaPlugin

func NewKafkaPlugin(dockerClient *docker.Client, logger *zap.Logger) *KafkaPlugin

NewKafkaPlugin creates a new Kafka service plugin

func (*KafkaPlugin) GetConnectionInfo

func (p *KafkaPlugin) GetConnectionInfo() (*plugin.ConnectionInfo, error)

GetConnectionInfo returns connection details

func (*KafkaPlugin) GetLogs

func (p *KafkaPlugin) GetLogs(ctx context.Context, opts *plugin.LogOptions) ([]string, error)

GetLogs retrieves service logs

func (*KafkaPlugin) IsReady

func (p *KafkaPlugin) IsReady(ctx context.Context) (bool, error)

IsReady checks if the Kafka broker is accepting requests

func (*KafkaPlugin) Launch

func (p *KafkaPlugin) Launch(ctx context.Context, config map[string]interface{}) error

Launch starts the Kafka broker with given configuration

func (*KafkaPlugin) Name

func (p *KafkaPlugin) Name() string

Name returns the service identifier

func (*KafkaPlugin) Stop

func (p *KafkaPlugin) Stop(ctx context.Context) error

Stop terminates the Kafka service

Jump to

Keyboard shortcuts

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