pkg

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ContentTypeApplicationJson = "application/json"
View Source
const ContentTypeField = "Content-Type"

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	changesProvider ChangesProvider,
) libhttp.WithError

func SendJSONResponse

func SendJSONResponse(resp http.ResponseWriter, data interface{}, statusCode int) error

Types

type ChangesProvider

type ChangesProvider interface {
	Changes(
		ctx context.Context,
		topic libkafka.Topic,
		partition libkafka.Partition,
		offset libkafka.Offset,
		limit uint64,
	) (Records, error)
}

func NewChangesProvider

func NewChangesProvider(
	sentryClient sentry.Client,
	saramaClient libkafka.SaramaClient,
	converter Converter,
	logSamplerFactory log.SamplerFactory,
) ChangesProvider

type Converter

type Converter interface {
	Convert(ctx context.Context, msg *sarama.ConsumerMessage) (*Record, error)
}

func NewConverter

func NewConverter() Converter

type Page

type Page struct {
	NextOffset *libkafka.Offset `json:"nextOffset,omitempty"`
	Records    Records          `json:"records"`
}

type Record

type Record struct {
	Key       string             `json:"key"`
	Value     interface{}        `json:"value"`
	Offset    libkafka.Offset    `json:"offset"`
	Partition libkafka.Partition `json:"partition"`
	Topic     libkafka.Topic     `json:"topic"`
	Header    libkafka.Header    `json:"header"`
}

type Records

type Records []Record

Jump to

Keyboard shortcuts

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