package simkafka

import "github.com/google/trillian/docs/storage/commit_log/simkafka"

Package simkafka is a toy simulation of a Kafka commit log.

Index

Functions

func Append

func Append(which string, what string) int

Append adds a value to the end of a topic, and returns the offset of the added value.

func Read

func Read(which string, offset int) string

Read returns a value for a topic at a specific offset.

func ReadLast

func ReadLast(which string) (string, int)

ReadLast returns the latest value for a topic, and its offset

func ReadMultiple

func ReadMultiple(which string, offset, max int) []string

ReadMultiple reads values for a topic, starting at the given offset, up to the given maximum number of results.

func Status

func Status() string

Status reports the current status of the simulated Kafka instance

Source Files

kafka.go

Version
v1.7.1 (latest)
Published
Jan 9, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
5 days ago

Tools for package owners.