quilkin/
lib.rs

1/*
2 * Copyright 2020 Google LLC
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#![deny(unused_must_use)]
18
19// Above other modules for thr `uring_spawn` macro.
20#[macro_use]
21pub mod net;
22
23pub mod alloc;
24pub mod cli;
25pub mod codec;
26pub mod collections;
27pub mod components;
28pub mod config;
29pub mod filters;
30pub mod metrics;
31pub mod providers;
32pub mod service;
33pub mod signal;
34pub mod time;
35pub mod xds;
36
37#[doc(hidden)]
38pub mod test;
39
40pub use {providers::Providers, quilkin_proto as generated, service::Service};
41
42pub type Result<T, E = eyre::Error> = std::result::Result<T, E>;
43
44#[doc(inline)]
45pub use self::{cli::Cli, config::Config};
46
47pub use quilkin_macros::include_proto;
48
49pub(crate) use self::net::maxmind_db::MaxmindDb;
50
51/// A type which can be logged, usually error types.
52pub(crate) trait Loggable {
53    /// Output a log.
54    fn log(&self);
55}
56
57#[cfg(doctest)]
58mod external_doc_tests {
59    #![doc = include_str!("../docs/src/services/proxy/filters.md")]
60    #![doc = include_str!("../docs/src/services/proxy/filters/capture.md")]
61    #![doc = include_str!("../docs/src/services/proxy/filters/concatenate.md")]
62    #![doc = include_str!("../docs/src/services/proxy/filters/debug.md")]
63    #![doc = include_str!("../docs/src/services/proxy/filters/firewall.md")]
64    #![doc = include_str!("../docs/src/services/proxy/filters/load_balancer.md")]
65    #![doc = include_str!("../docs/src/services/proxy/filters/local_rate_limit.md")]
66    #![doc = include_str!("../docs/src/services/proxy/filters/match.md")]
67    #![doc = include_str!("../docs/src/services/proxy/filters/timestamp.md")]
68    #![doc = include_str!("../docs/src/services/proxy/filters/token_router.md")]
69    #![doc = include_str!("../docs/src/services/xds/providers/filesystem.md")]
70}