Skip to content

Commit

Permalink
initial basic skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
blind-oracle committed Mar 26, 2024
1 parent c094bea commit 8018c40
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target
51 changes: 51 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[package]
name = "ic-gateway"
version = "0.1.0"
edition = "2021"

[dependencies]
anyhow = "1.0"
arc-swap = "1"
async-scoped = { version = "0.8", features = ["use-tokio"] }
async-trait = "0.1"
axum = "0.7"
candid = "0.10"
clap = { version = "4.5", features = ["derive", "string"] }
clap_derive = "4.5"
http = "1.1"
hyper = "1.2"
jemallocator = "0.5"
jemalloc-ctl = "0.5"
lazy_static = "1.4"
little-loadshedder = "0.2"
maxminddb = "0.24"
moka = { version = "0.12", features = ["sync", "future"] }
prometheus = "0.13"
rand = "0.8"
regex = "1.10"
reqwest = "0.12"
rustls = "0.23"
rustls-pemfile = "1"
serde = "1.0"
serde_json = "1.0"
strum = "0.26"
thiserror = "1.0"
tokio = "1.36"
tokio-util = "0.7"
tokio-rustls = "0.26"
tower = "0.4"
tower_governor = "0.3"
tower-http = { version = "0.5", features = [
"trace",
"request-id",
"compression-full",
] }
tracing = "0.1"
tracing-core = "0.1"
tracing-serde = "0.1"
tracing-subscriber = "0.3"
url = "2.5"

[dev-dependencies]
criterion = { version = "0.5", features = ["async_tokio"] }
mockall = "0.12"
11 changes: 11 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use std::{net::SocketAddr, path::PathBuf};

use clap::{Args, Parser};
use url::Url;

use crate::core::{AUTHOR_NAME, SERVICE_NAME};

#[derive(Parser)]
#[clap(name = SERVICE_NAME)]
#[clap(author = AUTHOR_NAME)]
pub struct Cli {}
10 changes: 10 additions & 0 deletions src/core.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use anyhow::Error;

use crate::cli::Cli;

pub const SERVICE_NAME: &str = "ic_gateway";
pub const AUTHOR_NAME: &str = "Boundary Node Team <[email protected]>";

pub async fn main(cli: Cli) -> Result<(), Error> {
Ok(())
}
18 changes: 18 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use anyhow::Error;
use clap::Parser;
use jemallocator::Jemalloc;

use crate::cli::Cli;

mod cli;
mod core;

#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

#[tokio::main]
async fn main() -> Result<(), Error> {
let cli = Cli::parse();

core::main(cli).await
}

0 comments on commit 8018c40

Please sign in to comment.