mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-03 22:33:26 +02:00
feat: extract client (#48)
This extracts the client (strategy pattern), this is so that it is will be possible to test the actual querier, without hitting / requiring the dagger-engine running.
This commit is contained in:
@@ -12,15 +12,15 @@ use crate::utility::OptionExt;
|
||||
pub fn render_object(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> {
|
||||
let selection = rust::import("crate::querybuilder", "Selection");
|
||||
let child = rust::import("tokio::process", "Child");
|
||||
let conn = rust::import("dagger_core::connect_params", "ConnectParams");
|
||||
let graphql_client = rust::import("dagger_core::graphql_client", "DynGraphQLClient");
|
||||
let arc = rust::import("std::sync", "Arc");
|
||||
|
||||
Ok(quote! {
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Clone)]
|
||||
pub struct $(t.name.pipe(|s| format_name(s))) {
|
||||
pub proc: $arc<$child>,
|
||||
pub selection: $selection,
|
||||
pub conn: $conn,
|
||||
pub graphql_client: $graphql_client
|
||||
}
|
||||
|
||||
$(t.fields.pipe(|f| render_optional_args(funcs, f)))
|
||||
|
Reference in New Issue
Block a user