Raises a document change event based on the the document body and channel set. If the event manager doesn't have a listener for this event, ignores.
(ctx context.Context, docBytes []byte, docID string, oldBodyJSON string, channels base.Set, winningRevChange bool)
| 161 | // Raises a document change event based on the the document body and channel set. If the |
| 162 | // event manager doesn't have a listener for this event, ignores. |
| 163 | func (em *EventManager) RaiseDocumentChangeEvent(ctx context.Context, docBytes []byte, docID string, oldBodyJSON string, channels base.Set, winningRevChange bool) error { |
| 164 | |
| 165 | if !em.activeEventTypes[DocumentChange] { |
| 166 | return nil |
| 167 | } |
| 168 | event := &DocumentChangeEvent{ |
| 169 | DocID: docID, |
| 170 | DocBytes: docBytes, |
| 171 | OldDoc: oldBodyJSON, |
| 172 | Channels: channels, |
| 173 | WinningRevChange: winningRevChange, |
| 174 | } |
| 175 | |
| 176 | return em.raiseEvent(ctx, event) |
| 177 | |
| 178 | } |
| 179 | |
| 180 | // Raises a DB state change event based on the db name, admininterface, new state, reason and local system time. |
| 181 | // If the event manager doesn't have a listener for this event, ignores. |