interfaces.js | |
|---|---|
| |
| Definition of modules used in eventstore. You can check an object against
the interface with the checkInterface function. | var root = this
, interfaces;
if (typeof exports !== 'undefined') {
interfaces = exports;
} else {
interfaces = root.eventStore.interfaces = {};
}
interfaces.VERSION = '0.5.0'; |
storage interface | interfaces.IStorage = { |
| addEvents: add events to the underlaying storage:
| addEvents: function(){},
|
| getEvents: get events from the underlaying storage:
| getEvents: function(){},
|
| getUndispatchedEvents: get undispatched events from the underlaying storage:
| getUndispatchedEvents: function(){},
|
| setEventToDispatched: sets an undispatched event to dispatched:
| setEventToDispatched: function(){},
|
| getId: gets a unique id from storage:
| getId: function(){}
}; |
publisher interface | interfaces.IPublisher = { |
| publish: publishes an event:
| publish: function(){}
}; |
logger interface | interfaces.ILogger = { |
| info: logs a message with level info:
| info: function(){},
|
| warn: logs a message with level warning:
| warn: function(){},
|
| error: logs a message with level error:
| error: function(){}
}
|