consumer

package
v0.0.0-...-07ad8dd Latest Latest
Warning

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

Go to latest
Published: May 5, 2018 License: BSD-2-Clause Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOffsetNotFound          = errors.New("offset not found")
	ErrFailToFetchOffsetByTime = errors.New("fail to fetch offset by time")
)

Functions

This section is empty.

Types

type C

type C struct {
	MaxWaitTime     time.Duration
	MinBytes        int
	MaxBytes        int
	OffsetRetention time.Duration
	Cluster         model.Cluster
}

func New

func New(cluster model.Cluster) *C

func (*C) Commit

func (c *C) Commit(topic string, partition int32, consumerGroup string, offset int64) error

func (*C) Consume

func (c *C) Consume(topic string, partition int32, offset int64) (messages []Message, err error)

func (*C) FetchOffsetByTime

func (c *C) FetchOffsetByTime(topic string, partition int32, keyTime time.Time) (int64, error)

func (*C) Offset

func (c *C) Offset(topic string, partition int32, consumerGroup string) (int64, error)

func (*C) SearchOffsetByTime

func (c *C) SearchOffsetByTime(topic string, partition int32, keyTime time.Time, getTime proto.GetTimeFunc) (int64, error)

type Message

type Message struct {
	Key    []byte
	Value  []byte
	Offset int64
}

Jump to

Keyboard shortcuts

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