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

Method For

mockresponses.go:479–496  ·  view source on GitHub ↗
(reqBody versionedDecoder)

Source from the content-addressed store, hash-verified

477}
478
479func (mr *MockFindCoordinatorResponse) For(reqBody versionedDecoder) encoderWithHeader {
480 req := reqBody.(*FindCoordinatorRequest)
481 res := &FindCoordinatorResponse{Version: req.version()}
482 var v any
483 switch req.CoordinatorType {
484 case CoordinatorGroup:
485 v = mr.groupCoordinators[req.CoordinatorKey]
486 case CoordinatorTransaction:
487 v = mr.transCoordinators[req.CoordinatorKey]
488 }
489 switch v := v.(type) {
490 case *MockBroker:
491 res.Coordinator = &Broker{id: v.BrokerID(), addr: v.Addr()}
492 case KError:
493 res.Err = v
494 }
495 return res
496}
497
498// MockOffsetCommitResponse is a `OffsetCommitResponse` builder.
499type MockOffsetCommitResponse struct {

Callers

nothing calls this directly

Calls 3

BrokerIDMethod · 0.80
versionMethod · 0.65
AddrMethod · 0.45

Tested by

no test coverage detected