cluster.go 681 B

12345678910111213141516171819202122232425
  1. package cluster
  2. // Strategy for partition to consumer assignement
  3. type Strategy string
  4. const (
  5. // StrategyRange is the default and assigns partition ranges to consumers.
  6. // Example with six partitions and two consumers:
  7. // C1: [0, 1, 2]
  8. // C2: [3, 4, 5]
  9. StrategyRange Strategy = "range"
  10. // StrategyRoundRobin assigns partitions by alternating over consumers.
  11. // Example with six partitions and two consumers:
  12. // C1: [0, 2, 4]
  13. // C2: [1, 3, 5]
  14. StrategyRoundRobin Strategy = "roundrobin"
  15. )
  16. // Error instances are wrappers for internal errors with a context and
  17. // may be returned through the consumer's Errors() channel
  18. type Error struct {
  19. Ctx string
  20. error
  21. }