ResponseAggregator defines the interface for aggregating responses from multiple shards.
| 21 | |
| 22 | // ResponseAggregator defines the interface for aggregating responses from multiple shards. |
| 23 | type ResponseAggregator interface { |
| 24 | // Add processes a single shard response. |
| 25 | Add(result interface{}, err error) error |
| 26 | |
| 27 | // AddWithKey processes a single shard response for a specific key (used by keyed aggregators). |
| 28 | AddWithKey(key string, result interface{}, err error) error |
| 29 | |
| 30 | BatchAdd(map[string]AggregatorResErr) error |
| 31 | |
| 32 | BatchSlice([]AggregatorResErr) error |
| 33 | |
| 34 | // Result returns the final aggregated result and any error. |
| 35 | Result() (interface{}, error) |
| 36 | } |
| 37 | |
| 38 | type AggregatorResErr struct { |
| 39 | Result interface{} |
no outgoing calls
no test coverage detected