topicreaderinternal

package
v3.117.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicGetPartitionStartOffsetFunc

type PublicGetPartitionStartOffsetFunc func(
	ctx context.Context,
	req PublicGetPartitionStartOffsetRequest,
) (res PublicGetPartitionStartOffsetResponse, err error)

PublicGetPartitionStartOffsetFunc callback function for optional manage read progress store at own side

type PublicGetPartitionStartOffsetRequest

type PublicGetPartitionStartOffsetRequest struct {
	Topic       string
	PartitionID int64

	// ExampleOnly
	PartitionSessionID int64
}

PublicGetPartitionStartOffsetRequest info about partition

type PublicGetPartitionStartOffsetResponse

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

PublicGetPartitionStartOffsetResponse allow to set start offset for read messages for the partition

func (*PublicGetPartitionStartOffsetResponse) StartFrom

func (r *PublicGetPartitionStartOffsetResponse) StartFrom(offset int64)

StartFrom set start offset for read the partition

type PublicReadBatchOption

type PublicReadBatchOption interface {
	Apply(options ReadMessageBatchOptions) ReadMessageBatchOptions
}

PublicReadBatchOption для различных пожеланий к батчу вроде WithMaxMessages(int)

type PublicReaderOption

type PublicReaderOption func(cfg *ReaderConfig)

func WithCredentials added in v3.37.8

func WithCredentials(cred credentials.Credentials) PublicReaderOption

func WithTrace added in v3.38.0

func WithTrace(tracer *trace.Topic) PublicReaderOption

type ReadMessageBatchOptions

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

type Reader

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

func NewReader

func NewReader(
	client TopicClient,
	connector TopicSteamReaderConnect,
	consumer string,
	readSelectors []topicreadercommon.PublicReadSelector,
	opts ...PublicReaderOption,
) (Reader, error)

func (*Reader) Close

func (r *Reader) Close(ctx context.Context) error

func (*Reader) Commit

func (r *Reader) Commit(ctx context.Context, offsets topicreadercommon.PublicCommitRangeGetter) (err error)

func (*Reader) CommitRanges

func (r *Reader) CommitRanges(ctx context.Context, ranges []topicreadercommon.PublicCommitRange) error

func (*Reader) ID added in v3.52.0

func (r *Reader) ID() int64

func (*Reader) PopBatchTx added in v3.76.4

func (*Reader) ReadMessage

func (r *Reader) ReadMessage(ctx context.Context) (*topicreadercommon.PublicMessage, error)

ReadMessage read exactly one message

func (*Reader) ReadMessageBatch

func (r *Reader) ReadMessageBatch(
	ctx context.Context,
	opts ...PublicReadBatchOption,
) (
	batch *topicreadercommon.PublicBatch,
	err error,
)

ReadMessageBatch read batch of messages. Batch is collection of messages, which can be atomically committed

func (*Reader) TopicOnReaderStart added in v3.108.4

func (r *Reader) TopicOnReaderStart(consumer string, err error)

func (*Reader) Tracer added in v3.52.0

func (r *Reader) Tracer() *trace.Topic

func (*Reader) WaitInit added in v3.52.3

func (r *Reader) WaitInit(ctx context.Context) error

type ReaderConfig

type ReaderConfig struct {
	config.Common

	RetrySettings      topic.RetrySettings
	DefaultBatchConfig ReadMessageBatchOptions
	// contains filtered or unexported fields
}

func (*ReaderConfig) Validate added in v3.68.0

func (cfg *ReaderConfig) Validate() []error

type TopicClient added in v3.76.4

type TopicClient interface {
	UpdateOffsetsInTransaction(ctx context.Context, req *rawtopic.UpdateOffsetsInTransactionRequest) error
}

TopicClient is part of rawtopic.Client

type TopicSteamReaderConnect

type TopicSteamReaderConnect func(
	connectionCtx context.Context,
	readerID int64,
	tracer *trace.Topic,
) (topicreadercommon.RawTopicReaderStream, error)

TopicSteamReaderConnect connect to grpc stream when connectionCtx closed stream must stop work and return errors for all methods

Jump to

Keyboard shortcuts

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