ReadOffsets returns the absolute first and last offsets of the topic used by the connection.
()
| 910 | // ReadOffsets returns the absolute first and last offsets of the topic used by |
| 911 | // the connection. |
| 912 | func (c *Conn) ReadOffsets() (first, last int64, err error) { |
| 913 | // We have to submit two different requests to fetch the first and last |
| 914 | // offsets because kafka refuses requests that ask for multiple offsets |
| 915 | // on the same topic and partition. |
| 916 | if first, err = c.ReadFirstOffset(); err != nil { |
| 917 | return |
| 918 | } |
| 919 | if last, err = c.ReadLastOffset(); err != nil { |
| 920 | first = 0 // don't leak the value on error |
| 921 | return |
| 922 | } |
| 923 | return |
| 924 | } |
| 925 | |
| 926 | func (c *Conn) readOffset(t int64) (offset int64, err error) { |
| 927 | err = c.readOperation( |