mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
1114 lines
32 KiB
HTML
1114 lines
32 KiB
HTML
|
|
<!DOCTYPE HTML>
|
|
<html lang="" >
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
|
<title>Flags ยท NATS</title>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="description" content="">
|
|
<meta name="generator" content="GitBook 3.2.3">
|
|
<meta name="author" content="The NATS Maintainers">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/style.css">
|
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism.css">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="HandheldFriendly" content="true"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
|
|
<link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
|
|
|
|
|
|
<link rel="next" href="configuration.html" />
|
|
|
|
|
|
<link rel="prev" href="clients.html" />
|
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.materialdesignicons.com/3.6.95/css/materialdesignicons.min.css">
|
|
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<div class="book">
|
|
<div class="book-summary">
|
|
|
|
|
|
<div id="book-search-input" role="search">
|
|
<input type="text" placeholder="Type to search" />
|
|
</div>
|
|
|
|
|
|
<nav role="navigation">
|
|
|
|
|
|
|
|
<ul class="summary">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<li class="chapter " data-level="1.1" data-path="../">
|
|
|
|
<a href="../">
|
|
|
|
|
|
Introduction
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.1.1" data-path="./">
|
|
|
|
<a href="./">
|
|
|
|
|
|
NATS Server
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.1.1.1" data-path="installation.html">
|
|
|
|
<a href="installation.html">
|
|
|
|
|
|
Installing
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.2" data-path="running.html">
|
|
|
|
<a href="running.html">
|
|
|
|
|
|
Running
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.3" data-path="clients.html">
|
|
|
|
<a href="clients.html">
|
|
|
|
|
|
Clients
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter active" data-level="1.1.1.4" data-path="flags.html">
|
|
|
|
<a href="flags.html">
|
|
|
|
|
|
Flags
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5" data-path="configuration.html">
|
|
|
|
<a href="configuration.html">
|
|
|
|
|
|
Configuration File
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.1.1.5.1" data-path="authentication.html">
|
|
|
|
<a href="authentication.html">
|
|
|
|
|
|
Authentication
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5.2" data-path="authorization.html">
|
|
|
|
<a href="authorization.html">
|
|
|
|
|
|
Authorization
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5.3" data-path="clustering.html">
|
|
|
|
<a href="clustering.html">
|
|
|
|
|
|
Clustering
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5.4" data-path="tls.html">
|
|
|
|
<a href="tls.html">
|
|
|
|
|
|
TLS Security
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5.5" data-path="logging.html">
|
|
|
|
<a href="logging.html">
|
|
|
|
|
|
Logging
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.5.6" data-path="monitoring.html">
|
|
|
|
<a href="monitoring.html">
|
|
|
|
|
|
Monitoring
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.1.1.5.6.1" data-path="natstop.html">
|
|
|
|
<a href="natstop.html">
|
|
|
|
|
|
Statistics
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.1.1.5.6.1.1" data-path="nats_top_tutorial.html">
|
|
|
|
<a href="nats_top_tutorial.html">
|
|
|
|
|
|
NATS Top Tutorial
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.6" data-path="signals.html">
|
|
|
|
<a href="signals.html">
|
|
|
|
|
|
Signals
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.7" data-path="windows_srv.html">
|
|
|
|
<a href="windows_srv.html">
|
|
|
|
|
|
Window Service
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.1.1.8" data-path="upgrading.html">
|
|
|
|
<a href="upgrading.html">
|
|
|
|
|
|
Upgrading a Cluster
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li class="chapter " data-level="1.2" data-path="../developer/">
|
|
|
|
<a href="../developer/">
|
|
|
|
|
|
Developing with NATS
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<ul class="articles">
|
|
|
|
|
|
<li class="chapter " data-level="1.2.1" data-path="../developer/connecting.html">
|
|
|
|
<a href="../developer/connecting.html">
|
|
|
|
|
|
Connecting
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</li>
|
|
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li class="divider"></li>
|
|
|
|
<li>
|
|
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
|
|
Published with GitBook
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="book-body">
|
|
|
|
<div class="body-inner">
|
|
|
|
|
|
|
|
<div class="book-header" role="navigation">
|
|
|
|
|
|
<!-- Title -->
|
|
<h1>
|
|
<i class="fa fa-circle-o-notch fa-spin"></i>
|
|
<a href=".." >Flags</a>
|
|
</h1>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page-wrapper" tabindex="-1" role="main">
|
|
<div class="page-inner">
|
|
|
|
<div id="book-search-results">
|
|
<div class="search-noresults">
|
|
|
|
<section class="normal markdown-section">
|
|
|
|
<h2 id="flags">Flags</h2>
|
|
<p>The NATS server has many flags to customize it's behaviour without having to write a configuration file.</p>
|
|
<p>The configuration flags revolve around:</p>
|
|
<ul>
|
|
<li>Server Options</li>
|
|
<li>Logging</li>
|
|
<li>Authorization</li>
|
|
<li>TLS Security</li>
|
|
<li>Clustering</li>
|
|
<li>Information</li>
|
|
</ul>
|
|
<h3 id="server-options">Server Options</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>-a</code>, <code>--addr</code></td>
|
|
<td style="text-align:left">Host address to bind to (default: <code>0.0.0.0</code> - all interfaces).</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-p</code>, <code>--port</code></td>
|
|
<td style="text-align:left">NATS client port (default: 4222).</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-P</code>, <code>--pid</code></td>
|
|
<td style="text-align:left">File to store the process ID (PID).</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-m</code>, <code>--http_port</code></td>
|
|
<td style="text-align:left">HTTP port for monitoring dashboard (exclusive of <code>--https_port</code>).</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-ms</code>, <code>--https_port</code></td>
|
|
<td style="text-align:left">HTTPS port monitoring for monitoring dashboard (exclusive of <code>--http_port</code>).</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-c</code>, <code>--config</code></td>
|
|
<td style="text-align:left">Path to NATS server configuration file.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-sl</code>, <code>--signal</code></td>
|
|
<td style="text-align:left">Send a signal to nats-server process. See <a href="signals.html">process signaling</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--client_advertise</code></td>
|
|
<td style="text-align:left">Client HostPort to advertise to other servers.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-t</code></td>
|
|
<td style="text-align:left">Test configuration and exit</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="authentication-options">Authentication Options</h3>
|
|
<p>The following options control very simple authentication:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>--user</code></td>
|
|
<td style="text-align:left">Required <em>username</em> for connections.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--pass</code></td>
|
|
<td style="text-align:left">Required <em>password</em> for connections.</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--auth</code></td>
|
|
<td style="text-align:left">Required <em>authorization token</em> for connections.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>You can read more about <a href="authentication.html">autentication configuration here</a>.</p>
|
|
<h3 id="logging-options">Logging Options</h3>
|
|
<p>The following flags are available on the server to configure logging:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>-l</code>, <code>--log</code></td>
|
|
<td style="text-align:left">File to redirect log output</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-T</code>, <code>--logtime</code></td>
|
|
<td style="text-align:left">Specify <code>-T=false</code> to disable timestamping log entries</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-s</code>, <code>--syslog</code></td>
|
|
<td style="text-align:left">Log to syslog or windows event log</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-r</code>, <code>--remote_syslog</code></td>
|
|
<td style="text-align:left">The syslog server address, like <code>udp://localhost:514</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-D</code>, <code>--debug</code></td>
|
|
<td style="text-align:left">Enable debugging output</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-V</code>, <code>--trace</code></td>
|
|
<td style="text-align:left">Enable protocol trace log messages</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-DV</code></td>
|
|
<td style="text-align:left">Enable both debug and protocol trace messages</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>You can read more about <a href="logging.html">logging configuration here</a>.</p>
|
|
<h3 id="tls-options">TLS Options</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>--tls</code></td>
|
|
<td style="text-align:left">Enable TLS, do not verify clients</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--tlscert</code></td>
|
|
<td style="text-align:left">Server certificate file</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--tlskey</code></td>
|
|
<td style="text-align:left">Private key for server certificate</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--tlsverify</code></td>
|
|
<td style="text-align:left">Enable client TLS certificate verification</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--tlscacert</code></td>
|
|
<td style="text-align:left">Client certificate CA for verification</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="cluster-options">Cluster Options</h3>
|
|
<p>The following flags are available on the server to configure clustering:</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>--routes</code></td>
|
|
<td style="text-align:left">Comma separated list of cluster URLs to solicit and connect</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--cluster</code></td>
|
|
<td style="text-align:left">Cluster URL for clustering requests</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--no_advertise</code></td>
|
|
<td style="text-align:left">Do not advertise known cluster information to clients</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--cluster_advertise</code></td>
|
|
<td style="text-align:left">Cluster URL to advertise to other servers</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--connect_retries</code></td>
|
|
<td style="text-align:left">For implicit routes, number of connect retries</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<p>You can read more about <a href="clustering.html">clustering configuration here</a>.</p>
|
|
<h3 id="common-options">Common Options</h3>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th style="text-align:left">Flag</th>
|
|
<th style="text-align:left">Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="text-align:left"><code>-h</code>, <code>--help</code></td>
|
|
<td style="text-align:left">Show this message</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>-v</code>, <code>--version</code></td>
|
|
<td style="text-align:left">Show version</td>
|
|
</tr>
|
|
<tr>
|
|
<td style="text-align:left"><code>--help_tls</code></td>
|
|
<td style="text-align:left">TLS help</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
<div class="search-results">
|
|
<div class="has-results">
|
|
|
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
<ul class="search-results-list"></ul>
|
|
|
|
</div>
|
|
<div class="no-results">
|
|
|
|
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<a href="clients.html" class="navigation navigation-prev " aria-label="Previous page: Clients">
|
|
<i class="fa fa-angle-left"></i>
|
|
</a>
|
|
|
|
|
|
<a href="configuration.html" class="navigation navigation-next " aria-label="Next page: Configuration File">
|
|
<i class="fa fa-angle-right"></i>
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<script>
|
|
var gitbook = gitbook || [];
|
|
gitbook.push(function() {
|
|
gitbook.page.hasChanged({"page":{"title":"Flags","level":"1.1.1.4","depth":3,"next":{"title":"Configuration File","level":"1.1.1.5","depth":3,"path":"nats_server/configuration.md","ref":"nats_server/configuration.md","articles":[{"title":"Authentication","level":"1.1.1.5.1","depth":4,"path":"nats_server/authentication.md","ref":"nats_server/authentication.md","articles":[]},{"title":"Authorization","level":"1.1.1.5.2","depth":4,"path":"nats_server/authorization.md","ref":"nats_server/authorization.md","articles":[]},{"title":"Clustering","level":"1.1.1.5.3","depth":4,"path":"nats_server/clustering.md","ref":"nats_server/clustering.md","articles":[]},{"title":"TLS Security","level":"1.1.1.5.4","depth":4,"path":"nats_server/tls.md","ref":"nats_server/tls.md","articles":[]},{"title":"Logging","level":"1.1.1.5.5","depth":4,"path":"nats_server/logging.md","ref":"nats_server/logging.md","articles":[]},{"title":"Monitoring","level":"1.1.1.5.6","depth":4,"path":"nats_server/monitoring.md","ref":"nats_server/monitoring.md","articles":[{"title":"Statistics","level":"1.1.1.5.6.1","depth":5,"path":"nats_server/natstop.md","ref":"nats_server/natstop.md","articles":[{"title":"NATS Top Tutorial","level":"1.1.1.5.6.1.1","depth":6,"path":"nats_server/nats_top_tutorial.md","ref":"nats_server/nats_top_tutorial.md","articles":[]}]}]}]},"previous":{"title":"Clients","level":"1.1.1.3","depth":3,"path":"nats_server/clients.md","ref":"nats_server/clients.md","articles":[]},"dir":"ltr"},"config":{"plugins":["prism","-highlight","include-html"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"include-html":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"The NATS Maintainers","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"NATS","gitbook":"*","description":"Administrative, developer and conceptual documentation for the NATS messaging system."},"file":{"path":"nats_server/flags.md","mtime":"2019-05-15T18:41:01.921Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-05-15T19:18:57.723Z"},"basePath":"..","book":{"language":""}});
|
|
});
|
|
</script>
|
|
</div>
|
|
|
|
<!-- Viz Support -->
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/viz.js"> </script>
|
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/2.1.2/lite.render.js"> </script>
|
|
|
|
<!-- Site code -->
|
|
<script>
|
|
function flash(elem, text, speed) {
|
|
if (!elem) {
|
|
return;
|
|
}
|
|
var s = elem.style;
|
|
elem.textContent = text;
|
|
s.display = 'block';
|
|
s.opacity = 1;
|
|
(function fade() {
|
|
(s.opacity -= .1) < .1 ? s.display = "none" : setTimeout(fade, speed)
|
|
})();
|
|
}
|
|
|
|
function copyToClipboard(text, el) {
|
|
var copyTest = document.queryCommandSupported('copy');
|
|
var elOriginalText = el.getAttribute('data-original-title');
|
|
|
|
if (copyTest === true) {
|
|
var copyTextArea = document.createElement("textarea");
|
|
copyTextArea.value = text;
|
|
document.body.appendChild(copyTextArea);
|
|
copyTextArea.select();
|
|
try {
|
|
var successful = document.execCommand('copy');
|
|
var msg = successful ? 'Copied!' : 'Whoops, not copied!';
|
|
var parent = el.parentNode.parentNode;
|
|
var msgElem = parent.querySelector(".copy-msg");
|
|
flash(msgElem, msg, 100);
|
|
} catch (err) {
|
|
console.log('Oops, unable to copy', err);
|
|
}
|
|
document.body.removeChild(copyTextArea);
|
|
el.setAttribute('data-original-title', elOriginalText);
|
|
} else {
|
|
// Fallback if browser doesn't support .execCommand('copy')
|
|
window.prompt("Copy to clipboard: Ctrl+C or Command+C, Enter", text);
|
|
}
|
|
}
|
|
|
|
function processGraphVizSections(elements) {
|
|
var elements = document.querySelectorAll("[data-viz]");
|
|
var viz = new Viz();
|
|
Array.prototype.forEach.call(elements, function (x) {
|
|
var engine = x.getAttribute("data-viz");
|
|
var image = viz.renderImageElement(x.innerText, {
|
|
format: "png",
|
|
engine: engine
|
|
}).then(function (element) {
|
|
x.parentNode.insertBefore(element, x);
|
|
});
|
|
});
|
|
|
|
|
|
};
|
|
|
|
function updateLanguageParameter(value) {
|
|
const param = "lang";
|
|
|
|
if (window.location.href.indexOf("?") >= 0) {
|
|
const regExp = new RegExp(param + "(.+?)(&|$)", "g");
|
|
const newUrl = window.location.href.replace(regExp, param + "=" + encodeURIComponent(value) + "$2");
|
|
window.history.pushState("", "", newUrl);
|
|
} else {
|
|
const newUrl = window.location.href + "?" + param + "=" + encodeURIComponent(value);
|
|
window.history.pushState("", "", newUrl);
|
|
}
|
|
}
|
|
|
|
function getLanguageParameter() {
|
|
var match = RegExp('[?&]lang=([^&]*)').exec(window.location.search);
|
|
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
|
|
}
|
|
|
|
function docReady() {
|
|
window.gitbook.events.bind("page.change", function () {
|
|
pageChanged();
|
|
});
|
|
}
|
|
|
|
function pageChanged() {
|
|
document.querySelectorAll('.js-copy').forEach(elem => {
|
|
elem.addEventListener("click", function () {
|
|
var el = this;
|
|
var parent = this.parentNode.parentNode;
|
|
var code = parent.querySelector('code');
|
|
var text = code.textContent || code.innerText;
|
|
copyToClipboard(text, el);
|
|
})
|
|
});
|
|
|
|
document.querySelectorAll('.api-lang').forEach(elem => {
|
|
elem.addEventListener("click", function () {
|
|
var curLang = sessionStorage.getItem('nats-api-language');
|
|
var lang = this.getAttribute('data-language');
|
|
|
|
// Stop the infinite loop
|
|
if (curLang == lang) {
|
|
return;
|
|
}
|
|
|
|
sessionStorage.setItem('nats-api-language', lang); // So we only do this 1x
|
|
|
|
updateLanguageParameter(lang)
|
|
|
|
document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
|
|
elem.click();
|
|
});
|
|
})
|
|
});
|
|
|
|
if (sessionStorage) {
|
|
var curLang = sessionStorage.getItem('nats-api-language');
|
|
var queryLang = getLanguageParameter();
|
|
var lang = curLang;
|
|
|
|
if (queryLang) { // query takes precedent
|
|
lang = queryLang
|
|
}
|
|
|
|
if (lang) {
|
|
document.querySelectorAll('.api-lang[data-language=' + lang + ']').forEach(elem => {
|
|
elem.click();
|
|
});
|
|
}
|
|
}
|
|
|
|
setTimeout(function () {
|
|
processGraphVizSections();
|
|
}, 1);
|
|
}
|
|
|
|
|
|
if (document.readyState != 'loading') docReady();
|
|
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', docReady);
|
|
else document.attachEvent('onreadystatechange', function () {
|
|
if (document.readyState == 'complete') docReady();
|
|
});
|
|
</script>
|
|
|
|
<!-- Github Buttons -->
|
|
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
|
|
<!-- Styles -->
|
|
<style>
|
|
div.graphviz {
|
|
background: transparent;
|
|
border: 0;
|
|
padding-top: 15px;
|
|
padding-right: 15px;
|
|
padding-bottom: 15px;
|
|
padding-left: 15px;
|
|
}
|
|
|
|
code[data-viz] {
|
|
display: none;
|
|
}
|
|
|
|
.tab-wrap {
|
|
transition: 0.3s box-shadow ease;
|
|
border-radius: 6px;
|
|
max-width: 100%;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
position: relative;
|
|
list-style: none;
|
|
background-color: #fff;
|
|
margin: 10px 0;
|
|
/* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);*/
|
|
}
|
|
|
|
.tab-wrap:hover {
|
|
box-shadow: 0 12px 23px rgba(0, 0, 0, 0.23), 0 10px 10px rgba(0, 0, 0, 0.19);
|
|
}
|
|
|
|
.tab {
|
|
display: none;
|
|
}
|
|
|
|
/* Using scss these would be generated, we have to manually create enough for all tabs, start with 8 */
|
|
.tab:checked:nth-of-type(1)~.tab__content:nth-of-type(1) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(2)~.tab__content:nth-of-type(2) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(3)~.tab__content:nth-of-type(3) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(4)~.tab__content:nth-of-type(4) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(5)~.tab__content:nth-of-type(5) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(6)~.tab__content:nth-of-type(6) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(7)~.tab__content:nth-of-type(7) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:checked:nth-of-type(8)~.tab__content:nth-of-type(8) {
|
|
opacity: 1;
|
|
transition: 0.5s opacity ease-in, 0.8s -webkit-transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease;
|
|
transition: 0.5s opacity ease-in, 0.8s transform ease, 0.8s -webkit-transform ease;
|
|
position: relative;
|
|
top: 0;
|
|
z-index: 100;
|
|
-webkit-transform: translateY(0px);
|
|
transform: translateY(0px);
|
|
text-shadow: 0 0 0;
|
|
}
|
|
|
|
.tab:first-of-type:not(:last-of-type)+label {
|
|
border-top-right-radius: 0;
|
|
border-bottom-right-radius: 0;
|
|
}
|
|
|
|
.tab:not(:first-of-type):not(:last-of-type)+label {
|
|
border-radius: 0;
|
|
}
|
|
|
|
.tab:last-of-type:not(:first-of-type)+label {
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
}
|
|
|
|
.tab:checked+label {
|
|
background-color: #fff;
|
|
box-shadow: 0 -1px 0 #fff inset;
|
|
cursor: default;
|
|
font-weight: bold;
|
|
border: 1px solid #ddd;
|
|
border-bottom-color: transparent;
|
|
}
|
|
|
|
.tab:checked+label:hover {
|
|
box-shadow: 0 -1px 0 #fff inset;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.tab+label {
|
|
box-shadow: 0 -1px 0 #eee inset;
|
|
border-radius: 6px 6px 0 0;
|
|
cursor: pointer;
|
|
display: block;
|
|
text-decoration: none;
|
|
color: #27aae1;
|
|
flex-grow: 3;
|
|
text-align: center;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
text-align: center;
|
|
transition: 0.3s background-color ease, 0.3s box-shadow ease;
|
|
height: 50px;
|
|
box-sizing: border-box;
|
|
padding: 15px;
|
|
}
|
|
|
|
.tab+label:hover {
|
|
background-color: #f9f9f9;
|
|
box-shadow: 0 1px 0 #f4f4f4 inset;
|
|
}
|
|
|
|
.tab__content {
|
|
padding: 2px 2px;
|
|
background-color: transparent;
|
|
position: absolute;
|
|
width: 100%;
|
|
z-index: -1;
|
|
opacity: 0;
|
|
left: 0;
|
|
-webkit-transform: translateY(-3px);
|
|
transform: translateY(-3px);
|
|
border-radius: 6px;
|
|
}
|
|
|
|
.tab__content pre {
|
|
margin-bottom: 0px !important;
|
|
}
|
|
|
|
.toolbar-icons {
|
|
display: inline-block;
|
|
position: relative;
|
|
padding-left: 4px;
|
|
}
|
|
|
|
a.toolbar-icons {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.toolbar-icons .mdi {
|
|
color: #4183c4;
|
|
}
|
|
|
|
.copy-msg {
|
|
color: #4183c4;
|
|
}
|
|
|
|
.pull-right {
|
|
float: right !important;
|
|
}
|
|
|
|
.pull-left {
|
|
float: left !important;
|
|
}
|
|
</style>
|
|
|
|
|
|
<script src="../gitbook/gitbook.js"></script>
|
|
<script src="../gitbook/theme.js"></script>
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-search/search.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
|
|
|
|
|
|
|
|
<script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|