package @eventicle/eventicle-utilities
Interfaces
Name | Summary |
---|---|
Allow querying against a single field. Will be mapped to a specific query technology by the underlying Datastore implementation. |
|
Sort a |
|
Abstraction around data storage in the form of document style records. Eventicle contains a built in InMemoryDatastore. Others can be imported as needed. |
|
Bag of data that is associated with a given Transaction inside the Datastore. Datastore/ eventClient specific. Can be added to by user code, but data inside it should be considered subject to change between versions |
|
Datastore implementations that support Transactions will emit events on transaction start and commit. This interface defines the listener for those interfaces. Notably, eventClient implementations register a TransactionListener in order to commit events after any local database is committed. |
|
Control whether a new Datastore transaction is required, and if so, if it should join an existing transaction or create a new one to use. |
|
Lock abstraction. This interface is used inside of Eventicle to provide semaphore access to shared resources. Notably, this obtains exclusive locks around AggregateRoot instances when processing inside of Commands and Saga steps. |
|
Functions
ds.dataStore()
The current implementation that Eventicle uses for internal data. Can be used by application code to obtain a reference if required.
declare function dataStore(): DataStore;
ds.setDataStore(dataStore)
Set the Datastore implementation that Eventicle will use to persist in.
Name | Type | Description |
---|---|---|
|
||
Returns |
|
declare function setDataStore(dataStore: DataStore): void;
elasticApmEventicle(apm)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function elasticApmEventicle(apm: any): ApmApi;
hashCode(str)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function hashCode(str: string): number;
loggerUtil.getFileNameAndLineNumber(numberOfLinesToFetch)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function getFileNameAndLineNumber(numberOfLinesToFetch?: number): {
file: any;
lineno: any;
timestamp: string;
};
loggerUtil.handleNestedContextualError(info)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function handleNestedContextualError(info: any): any;
loggerUtil.handleTopLevelContextualError(info)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function handleTopLevelContextualError(info: any): any;
loggerUtil.isError(data)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function isError(data: any): data is Error;
loggerUtil.maybeInsertContext(context, source, fields)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns |
|
export declare function maybeInsertContext(context: any, source: any, ...fields: string[]): any;
loggerUtil.maybeInsertInlineContext(message, source, fields)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
Returns |
|
export declare function maybeInsertInlineContext(message: string, source: any, ...fields: string[]): string;
loggerUtil.maybeRenderError(data)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function maybeRenderError(data: any): any;
loggerUtil.proxyLogger(logger, baseDirName)
Name | Type | Description |
---|---|---|
|
|
|
|
|
|
Returns |
|
export declare function proxyLogger(logger: Logger, baseDirName: string): winston.Logger;
pause(ms)
Utility function to pause for a given number of ms.
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
declare function pause(ms: number): Promise<void>;
setEventicleApm(apm)
Name | Type | Description |
---|---|---|
|
|
|
Returns |
|
export declare function setEventicleApm(apm: ApmApi): void;
setLockManager(lockManager)
Name | Type | Description |
---|---|---|
|
||
Returns |
|
export declare function setLockManager(lockManager: LockManager): void;
setLogApi(log)
Name | Type | Description |
---|---|---|
|
||
Returns |
|
export declare function setLogApi(log: LogApi): void;