topic.ts 558 B

1234567891011121314151617181920212223242526272829303132
  1. import { FetchStatus } from 'types';
  2. export type TopicName = string;
  3. export interface TopicConfigs {
  4. [key: string]: string;
  5. }
  6. export interface TopicReplica {
  7. broker: number;
  8. leader: boolean;
  9. in_sync: true;
  10. }
  11. export interface TopicPartition {
  12. partition: number;
  13. leader: number;
  14. replicas: TopicReplica[];
  15. }
  16. export interface Topic {
  17. name: TopicName;
  18. configs: TopicConfigs;
  19. partitions: TopicPartition[];
  20. }
  21. export interface TopicsState {
  22. fetchStatus: FetchStatus;
  23. items: Topic[];
  24. brokers?: Broker[];
  25. }
  26. export type Broker = number;