Sync runs a synchronization iteration, which executes requests in the event table.
()
| 114 | // Sync runs a synchronization iteration, which |
| 115 | // executes requests in the event table. |
| 116 | func (writer *SyncWriter) Sync() (synced int, err error) { |
| 117 | resourceList, err := writer.listEvents() |
| 118 | if err != nil { |
| 119 | return |
| 120 | } |
| 121 | for _, resource := range resourceList { |
| 122 | err = writer.syncEvent(resource) |
| 123 | if err != nil { |
| 124 | return |
| 125 | } |
| 126 | synced++ |
| 127 | } |
| 128 | return |
| 129 | } |
| 130 | |
| 131 | func (writer *SyncWriter) listEvents() ([]*schema.Resource, error) { |
| 132 | var resourceList []*schema.Resource |
no test coverage detected