Skip to content

Commit

Permalink
- moved config to cli as only cli cares about the file structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
laststylebender14 committed Jun 17, 2024
1 parent d19b21c commit 3c66c7e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/cli/generator.rs → src/cli/generator/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ use pathdiff::diff_paths;

use crate::core::config::{self, ConfigModule};
use crate::core::generator::source::{ConfigSource, ImportSource};
use crate::core::generator::{
ConfigInput, Generator, GeneratorConfig, InputSource, JsonInput, ProtoInput, Resolved,
};
use crate::core::generator::{ConfigInput, Generator, JsonInput, ProtoInput};
use crate::core::proto_reader::ProtoReader;
use crate::core::resource_reader::ResourceReader;
use crate::core::runtime::TargetRuntime;

use super::config::{GeneratorConfig, InputSource, Resolved};

/// Checks if file or folder already exists or not.
fn is_exists(path: &str) -> bool {
fs::metadata(path).is_ok()
Expand Down
4 changes: 4 additions & 0 deletions src/cli/generator/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mod generator;
mod config;

pub use generator::ConfigConsoleGenerator;
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
source: src/core/generator/config.rs
source: src/cli/generator/config.rs
expression: "&config"
---
GeneratorConfig {
input: [
Input {
source: Import {
src: "../protobuf/news.proto",
_marker: PhantomData<tailcall::core::generator::config::UnResolved>,
_marker: PhantomData<tailcall::cli::generator::config::UnResolved>,
},
},
Input {
source: Config {
src: "../configs/user-posts.graphql",
_marker: PhantomData<tailcall::core::generator::config::UnResolved>,
_marker: PhantomData<tailcall::cli::generator::config::UnResolved>,
},
},
Input {
source: Import {
src: "https://jsonplaceholder.typicode.com/posts",
_marker: PhantomData<tailcall::core::generator::config::UnResolved>,
_marker: PhantomData<tailcall::cli::generator::config::UnResolved>,
},
},
],
output: Output {
format: GraphQL,
file: "./output.graphql",
_markder: PhantomData<tailcall::core::generator::config::UnResolved>,
_markder: PhantomData<tailcall::cli::generator::config::UnResolved>,
},
generate: GenerateOptions {
schema: Schema {
Expand Down Expand Up @@ -55,5 +55,5 @@ GeneratorConfig {
},
),
},
_marker: PhantomData<tailcall::core::generator::config::UnResolved>,
_marker: PhantomData<tailcall::cli::generator::config::UnResolved>,
}
2 changes: 0 additions & 2 deletions src/core/generator/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mod config;
mod from_json;
mod from_proto;
mod generator;
Expand All @@ -7,7 +6,6 @@ mod json;
mod proto;
pub mod source;

pub use config::*;
pub use from_json::{FromJsonGenerator, RequestSample};
pub use generator::{ConfigInput, Generator, JsonInput, ProtoInput};
pub use json::NameGenerator;
Expand Down

1 comment on commit 3c66c7e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running 30s test @ http://localhost:8000/graphql

4 threads and 100 connections

Thread Stats Avg Stdev Max +/- Stdev
Latency 6.68ms 3.02ms 72.43ms 71.74%
Req/Sec 3.78k 204.52 4.18k 93.67%

451860 requests in 30.00s, 2.26GB read

Requests/sec: 15059.70

Transfer/sec: 77.30MB

Please sign in to comment.