saramahelpers

package
v1.25.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package saramahelpers contains helper function to be used in code based on Sarama library with Kafka interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringToSaramaConsumerMessage

func StringToSaramaConsumerMessage(str string) *sarama.ConsumerMessage

StringToSaramaConsumerMessage converts string to sarama consumer message

Types

type MockConsumerGroupClaim

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

MockConsumerGroupClaim MockConsumerGroupClaim

func NewMockConsumerGroupClaim

func NewMockConsumerGroupClaim(messages []*sarama.ConsumerMessage) *MockConsumerGroupClaim

NewMockConsumerGroupClaim creates MockConsumerGroupClaim with provided messages

func (*MockConsumerGroupClaim) HighWaterMarkOffset

func (cgc *MockConsumerGroupClaim) HighWaterMarkOffset() int64

HighWaterMarkOffset returns the high water mark offset of the partition,

func (*MockConsumerGroupClaim) InitialOffset

func (cgc *MockConsumerGroupClaim) InitialOffset() int64

InitialOffset returns the initial offset that was used as a starting point for this claim.

func (*MockConsumerGroupClaim) Messages

func (cgc *MockConsumerGroupClaim) Messages() <-chan *sarama.ConsumerMessage

Messages returns the read channel for the messages that are returned by

func (*MockConsumerGroupClaim) Partition

func (cgc *MockConsumerGroupClaim) Partition() int32

Partition returns the consumed partition.

func (*MockConsumerGroupClaim) Topic

func (cgc *MockConsumerGroupClaim) Topic() string

Topic returns the consumed topic name.

type MockConsumerGroupSession

type MockConsumerGroupSession struct{}

MockConsumerGroupSession MockConsumerGroupSession

func (*MockConsumerGroupSession) Claims

func (*MockConsumerGroupSession) Claims() map[string][]int32

Claims returns information about the claimed partitions by topic.

func (*MockConsumerGroupSession) Commit

func (*MockConsumerGroupSession) Commit()

Commit commits

func (*MockConsumerGroupSession) Context

Context returns the session context.

func (*MockConsumerGroupSession) GenerationID

func (*MockConsumerGroupSession) GenerationID() int32

GenerationID returns the current generation ID.

func (*MockConsumerGroupSession) MarkMessage

func (*MockConsumerGroupSession) MarkMessage(msg *sarama.ConsumerMessage, metadata string)

MarkMessage marks a message as consumed.

func (*MockConsumerGroupSession) MarkOffset

func (*MockConsumerGroupSession) MarkOffset(topic string, partition int32, offset int64, metadata string)

MarkOffset marks the provided offset, alongside a metadata string

func (*MockConsumerGroupSession) MemberID

func (*MockConsumerGroupSession) MemberID() string

MemberID returns the cluster member ID.

func (*MockConsumerGroupSession) ResetOffset

func (*MockConsumerGroupSession) ResetOffset(topic string, partition int32, offset int64, metadata string)

ResetOffset resets to the provided offset, alongside a metadata string that

Jump to

Keyboard shortcuts

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