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.
()
| 590 | // |
| 591 | // See Seek for more details about the offset and whence values. |
| 592 | func (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 | |
| 610 | const ( |
| 611 | SeekStart = 0 // Seek relative to the first offset available in the partition. |
no outgoing calls