kafkatransport

package module
v0.0.0-...-e84f055 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

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

func NewConsumer

func NewConsumer(
	channel string,
	endpoint endpoint.Endpoint,
	client sarama.ConsumerGroup,
	dec DecodeMessageFunc,
	options ...ConsumerOption) *Consumer

func (*Consumer) Consume

func (c *Consumer) Consume(ctx context.Context)

type ConsumerHook

type ConsumerHook func(sarama.ConsumerGroupSession) error

type ConsumerOption

type ConsumerOption func(*Consumer)

func ConsumerBefore

func ConsumerBefore(before ...ConsumerRequestFunc) ConsumerOption

func WithCleanupHook

func WithCleanupHook(hook ConsumerHook) ConsumerOption

func WithErrorHandler

func WithErrorHandler(errorHandler transport.ErrorHandler) ConsumerOption

func WithSetupHook

func WithSetupHook(hook ConsumerHook) ConsumerOption

type ConsumerRequestFunc

type ConsumerRequestFunc func(context.Context) context.Context

type DecodeMessageFunc

type DecodeMessageFunc func(ctx context.Context, msg *sarama.ConsumerMessage) (request interface{}, err error)

type EncodeMessageFunc

type EncodeMessageFunc func(ctx context.Context, request interface{}) (msg *sarama.ProducerMessage, err error)

type Producer

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

func NewProducer

func NewProducer(
	topic string,
	client sarama.Client,
	enc EncodeMessageFunc,
	options ...ProducerOption,
) *Producer

func (Producer) Endpoint

func (p Producer) Endpoint() endpoint.Endpoint

type ProducerOption

type ProducerOption func(*Producer)

func ProducerAfter

func ProducerAfter(after ...ProducerResponseFunc) ProducerOption

func ProducerBefore

func ProducerBefore(before ...ProducerRequestFunc) ProducerOption

type ProducerRequestFunc

type ProducerRequestFunc func(context.Context) context.Context

type ProducerResponseFunc

type ProducerResponseFunc func(partition int32, offset int64, msg *sarama.ProducerMessage)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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