@financialforcedev/orizuru-transport-kafka
Version:
Kafka transport layer for the orizuru package
878 lines (276 loc) • 10.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: index</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Module: index</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description">The Index file for project.
Returns the publish and subscribe methods.
These define the API for a transport layer.
In this case, the transport uses Kafka.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line28">line 28</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="~Publish"><span class="type-signature">(inner) </span>Publish<span class="signature">(message)</span><span class="type-signature"> → {Promise}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">{ eventName, buffer, config }
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eventName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the name of the event to publish</td>
</tr>
<tr>
<td class="name"><code>buffer</code></td>
<td class="type">
<span class="param-type">buffer</span>
</td>
<td class="description last">the message to send as a buffer</td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">config object</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>emitter</code></td>
<td class="type">
<span class="param-type">EventEmitter</span>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ERROR</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the error event name</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line49">line 49</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>let buffer = ...,
config = {
}
index.publish({ eventName: 'test', buffer, config });</code></pre>
<h4 class="name" id="~Subscribe"><span class="type-signature">(inner) </span>Subscribe<span class="signature">(subscriberConfig)</span><span class="type-signature"> → {Promise}</span></h4>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>subscriberConfig</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">{ eventName, handler, config }
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>eventName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the name of the event to listen for</td>
</tr>
<tr>
<td class="name"><code>handler</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">handler function called when the event is heard</td>
</tr>
<tr>
<td class="name"><code>config</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">config object</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>emitter</code></td>
<td class="type">
<span class="param-type">EventEmitter</span>
</td>
<td class="description last">
<h6>Properties</h6>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>ERROR</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the error event name</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line69">line 69</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>let handler = (buffer) =>
{
console.log(buffer);
},
config = {
}
index.subscribe({ eventName: 'test', handler, config });</code></pre>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Nov 17 2017 12:46:07 GMT+0000 (GMT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>