| type topicPartition struct { |
| func (tp *topicPartition) String() string { |
| return fmt.Sprintf("%s-%d", tp.Topic, tp.Partition) |
| func (i offsetInfo) NextOffset(fallback int64) int64 { |
| func (p int32Slice) Len() int { return len(p) } |
| func (p int32Slice) Less(i, j int) bool { return p[i] < p[j] } |
| func (p int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } |
| func (p int32Slice) Diff(o int32Slice) (res []int32) { |
| n := sort.Search(on, func(i int) bool { return o[i] >= x }) |
| // -------------------------------------------------------------------- |
| func newLoopTomb() *loopTomb { |
| return &loopTomb{c: make(chan none)} |
| func (t *loopTomb) stop() { t.o.Do(func() { close(t.c) }) } |
| func (t *loopTomb) Close() { t.stop(); t.w.Wait() } |
| func (t *loopTomb) Dying() <-chan none { return t.c } |
| func (t *loopTomb) Go(f func(<-chan none)) { |