MCPcopy
hub / github.com/IBM/sarama / SetOffset

Method SetOffset

mockresponses.go:236–249  ·  view source on GitHub ↗
(topic string, partition int32, time, offset int64)

Source from the content-addressed store, hash-verified

234}
235
236func (mor *MockOffsetResponse) SetOffset(topic string, partition int32, time, offset int64) *MockOffsetResponse {
237 partitions := mor.offsets[topic]
238 if partitions == nil {
239 partitions = make(map[int32]map[int64]int64)
240 mor.offsets[topic] = partitions
241 }
242 times := partitions[partition]
243 if times == nil {
244 times = make(map[int64]int64)
245 partitions[partition] = times
246 }
247 times[time] = offset
248 return mor
249}
250
251func (mor *MockOffsetResponse) For(reqBody versionedDecoder) encoderWithHeader {
252 offsetRequest := reqBody.(*OffsetRequest)

Calls

no outgoing calls