(s store.Store, ns, cluster string)
| 62 | } |
| 63 | |
| 64 | func NewClusterChecker(s store.Store, ns, cluster string) *ClusterChecker { |
| 65 | ctx, cancel := context.WithCancel(context.Background()) |
| 66 | c := &ClusterChecker{ |
| 67 | namespace: ns, |
| 68 | clusterName: cluster, |
| 69 | |
| 70 | clusterStore: s, |
| 71 | options: ClusterCheckOptions{ |
| 72 | pingInterval: time.Second * 3, |
| 73 | maxFailureCount: 5, |
| 74 | }, |
| 75 | failureCounts: make(map[string]int64), |
| 76 | syncCh: make(chan struct{}, 1), |
| 77 | |
| 78 | ctx: ctx, |
| 79 | cancelFn: cancel, |
| 80 | } |
| 81 | return c |
| 82 | } |
| 83 | |
| 84 | func (c *ClusterChecker) Start() { |
| 85 | c.wg.Add(1) |
no outgoing calls