finder

package
v0.0.0-...-f428e55 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorBeforeFirstMessageTime = fmt.Errorf("the given time is before the first message time")
	ErrorAfterLastMessageTime   = fmt.Errorf("the given time is after the last message time")
	ErrorNotFound               = fmt.Errorf("not found")
	ErrorAllMessagesFetched     = fmt.Errorf("all messages fetched")
)
View Source
var (
	ErrorContextCanceled = fmt.Errorf("parent context canceled")
)

Functions

This section is empty.

Types

type BoundOffset

type BoundOffset struct {
	From int64
	To   int64
}

type Config

type Config struct {
	Kafka Kafka
}

type Kafka

type Kafka struct {
	Addresses []string
	Topic     string
}

type PartitionBoundOffsets

type PartitionBoundOffsets map[int]BoundOffset

type Service

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

func NewService

func NewService(ctx context.Context, conf Config) (s *Service, err error)

func (*Service) FindMessageInBoundOffsets

func (s *Service) FindMessageInBoundOffsets(ctx context.Context, partOffsets PartitionBoundOffsets, cond condition.Cond) (msg *kafka.Message, err error)

func (*Service) GetMessageAt

func (s *Service) GetMessageAt(ctx context.Context, t time.Time) (msgs []kafka.Message, err error)

func (*Service) ResolveBoundOffsets

func (s *Service) ResolveBoundOffsets(ctx context.Context, from, to time.Time) (partOffsets PartitionBoundOffsets, err error)

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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