| 66 | } |
| 67 | |
| 68 | func (ar *ActiveReplicator) Start(ctx context.Context) error { |
| 69 | |
| 70 | if ar.Push == nil && ar.Pull == nil { |
| 71 | return fmt.Errorf("Attempted to start activeReplicator for %s with neither Push nor Pull defined", base.UD(ar.ID)) |
| 72 | } |
| 73 | |
| 74 | var pushErr error |
| 75 | if ar.Push != nil { |
| 76 | pushErr = ar.Push.Start(ctx) |
| 77 | } |
| 78 | |
| 79 | var pullErr error |
| 80 | if ar.Pull != nil { |
| 81 | pullErr = ar.Pull.Start(ctx) |
| 82 | } |
| 83 | |
| 84 | if pushErr != nil { |
| 85 | return pushErr |
| 86 | } |
| 87 | |
| 88 | if pullErr != nil { |
| 89 | return pullErr |
| 90 | } |
| 91 | |
| 92 | return nil |
| 93 | } |
| 94 | |
| 95 | func (ar *ActiveReplicator) Stop() error { |
| 96 | |