MCPcopy
hub / github.com/segmentio/kafka-go / Offset

Method Offset

conn.go:592–608  ·  view source on GitHub ↗

Offset returns the current offset of the connection as pair of integers, where the first one is an offset value and the second one indicates how to interpret it. See Seek for more details about the offset and whence values.

()

Source from the content-addressed store, hash-verified

590//
591// See Seek for more details about the offset and whence values.
592func (c *Conn) Offset() (offset int64, whence int) {
593 c.mutex.Lock()
594 offset = c.offset
595 c.mutex.Unlock()
596
597 switch offset {
598 case FirstOffset:
599 offset = 0
600 whence = SeekStart
601 case LastOffset:
602 offset = 0
603 whence = SeekEnd
604 default:
605 whence = SeekAbsolute
606 }
607 return
608}
609
610const (
611 SeekStart = 0 // Seek relative to the first offset available in the partition.

Callers 3

ReadBatchWithMethod · 0.95
testConnFirstOffsetFunction · 0.45

Calls

no outgoing calls

Tested by 2

testConnFirstOffsetFunction · 0.36