local

package
v0.0.0-...-406b1e7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package local contains a local file-based implementation of kafka.Client.

Normally, outside lib/kafka, you shouldn't import this package directly. Most applications should use DefaultClient from lib/kafka to decide automatically which client to use.

Package local is a local file-based implementation of kafka.Client. It stores data in append-only topic files a local directory. Several instances of local.Kafka communicate correctly via this directory even across process boundaries.

The purpose is to eliminate the memory footprint and hassle of running real Kafka for local testing such as in a box environment.

The implementation is not perfectly reliable: it can theoretically leave a topic file corrupted if a write succeeds partially. However, this is highly unlikely, so the implementation is good enough for local testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dir string) (api.ClientBackdate, error)

New creates a new Kafka instance based on the given directory name. The directory will be created along with its intermediate parents if it doesn't already exist.

Types

This section is empty.

Jump to

Keyboard shortcuts

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