Skip to content

Commit b595a25

Browse files
committed
Deploy site + cookbook: Merge pull request #84 from Tuntii/docs-update-versions-learning-path-7313343372344987490
Update documentation versions and expand learning path 59c1b9a
1 parent ce84f62 commit b595a25

41 files changed

Lines changed: 263 additions & 67 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cookbook/404.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
const path_to_root = "";
3838
const default_light_theme = "light";
3939
const default_dark_theme = "navy";
40-
window.path_to_searchindex_js = "searchindex-af852796.js";
40+
window.path_to_searchindex_js = "searchindex-b8492182.js";
4141
</script>
4242
<!-- Start loading toc.js asap -->
4343
<script src="toc-5ece1d58.js"></script>

cookbook/architecture/system_overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/concepts/handlers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/concepts/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/concepts/performance.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/concepts/testing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/crates/cargo_rustapi.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/crates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/crates/rustapi_core.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>

cookbook/crates/rustapi_extras.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
const path_to_root = "../";
3737
const default_light_theme = "light";
3838
const default_dark_theme = "navy";
39-
window.path_to_searchindex_js = "../searchindex-af852796.js";
39+
window.path_to_searchindex_js = "../searchindex-b8492182.js";
4040
</script>
4141
<!-- Start loading toc.js asap -->
4242
<script src="../toc-5ece1d58.js"></script>
@@ -196,6 +196,7 @@ <h2 id="feature-flags"><a class="header" href="#feature-flags">Feature Flags</a>
196196
<tr><td><code>cors</code></td><td><code>CorsLayer</code></td></tr>
197197
<tr><td><code>csrf</code></td><td><code>CsrfLayer</code>, <code>CsrfToken</code> extractor</td></tr>
198198
<tr><td><code>audit</code></td><td><code>AuditStore</code>, <code>AuditLogger</code></td></tr>
199+
<tr><td><code>insight</code></td><td><code>InsightLayer</code>, <code>InsightStore</code></td></tr>
199200
<tr><td><code>rate-limit</code></td><td><code>RateLimitLayer</code></td></tr>
200201
</tbody>
201202
</table>
@@ -258,6 +259,34 @@ <h2 id="audit-logging"><a class="header" href="#audit-logging">Audit Logging</a>
258259
);
259260
}
260261
<span class="boring">}</span></code></pre>
262+
<h2 id="traffic-insight"><a class="header" href="#traffic-insight">Traffic Insight</a></h2>
263+
<p>The <code>insight</code> feature provides powerful real-time traffic analysis and debugging capabilities without external dependencies. It is designed to be low-overhead and privacy-conscious.</p>
264+
<pre><code class="language-toml">[dependencies]
265+
rustapi-extras = { version = "0.1", features = ["insight"] }
266+
</code></pre>
267+
<h3 id="setup"><a class="header" href="#setup">Setup</a></h3>
268+
<pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
269+
</span><span class="boring">fn main() {
270+
</span>use rustapi_extras::insight::{InsightLayer, InMemoryInsightStore, InsightConfig};
271+
use std::sync::Arc;
272+
273+
let store = Arc::new(InMemoryInsightStore::new());
274+
let config = InsightConfig::default();
275+
276+
let app = RustApi::new()
277+
.layer(InsightLayer::new(config, store.clone()));
278+
<span class="boring">}</span></code></pre>
279+
<h3 id="accessing-data"><a class="header" href="#accessing-data">Accessing Data</a></h3>
280+
<p>You can inspect the collected data (e.g., via an admin dashboard):</p>
281+
<pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
282+
</span><span class="boring">fn main() {
283+
</span>#[rustapi_rs::get("/admin/insights")]
284+
async fn get_insights(State(store): State&lt;Arc&lt;InMemoryInsightStore&gt;&gt;) -&gt; Json&lt;InsightStats&gt; {
285+
// Returns aggregated stats like req/sec, error rates, p99 latency
286+
Json(store.get_stats().await)
287+
}
288+
<span class="boring">}</span></code></pre>
289+
<p>The <code>InsightStore</code> trait allows you to implement custom backends (e.g., ClickHouse or Elasticsearch) if you need long-term retention.</p>
261290

262291
</main>
263292

0 commit comments

Comments
 (0)