feat(sdk): re-export through lib.rs

this means that you can now use dagger_sdk::connect() instead of
dagger_sdk::client::connect();
This commit is contained in:
Kasper Juul Hermansen 2023-02-19 15:24:37 +01:00
parent 2695a10f24
commit 986a64cbc7
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
10 changed files with 17 additions and 32 deletions

View File

@ -1,7 +1,7 @@
use dagger_sdk::gen::HostDirectoryOpts; use dagger_sdk::HostDirectoryOpts;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory( let host_source_dir = client.host().directory(
"examples/build-the-application/app".into(), "examples/build-the-application/app".into(),

View File

@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts; use dagger_sdk::HostDirectoryOpts;
use rand::Rng; use rand::Rng;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory( let host_source_dir = client.host().directory(
"./examples/caching/app".into(), "./examples/caching/app".into(),

View File

@ -3,7 +3,7 @@ use rand::Rng;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let mut rng = rand::thread_rng(); let mut rng = rand::thread_rng();
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let context_dir = client let context_dir = client
.host() .host()

View File

@ -1,5 +1,5 @@
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let version = client let version = client
.container(None) .container(None)

View File

@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts; use dagger_sdk::HostDirectoryOpts;
use rand::Rng; use rand::Rng;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory( let host_source_dir = client.host().directory(
"examples/publish-the-application/app".into(), "examples/publish-the-application/app".into(),

View File

@ -1,8 +1,8 @@
use dagger_sdk::gen::HostDirectoryOpts; use dagger_sdk::HostDirectoryOpts;
use rand::Rng; use rand::Rng;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let output = "examples/publish-the-application/app/build"; let output = "examples/publish-the-application/app/build";
let host_source_dir = client.host().directory( let host_source_dir = client.host().directory(

View File

@ -1,7 +1,7 @@
use dagger_sdk::gen::HostDirectoryOpts; use dagger_sdk::HostDirectoryOpts;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?; let client = dagger_sdk::connect()?;
let host_source_dir = client.host().directory( let host_source_dir = client.host().directory(
"examples/test-the-application/app".into(), "examples/test-the-application/app".into(),

View File

@ -1,18 +1,6 @@
pub mod client; mod client;
pub mod gen; mod gen;
mod querybuilder; mod querybuilder;
pub fn add(left: usize, right: usize) -> usize { pub use client::*;
left + right pub use gen::*;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}

View File

@ -1,5 +1,4 @@
use dagger_sdk::client::connect; use dagger_sdk::{connect, ContainerExecOpts};
use dagger_sdk::gen::ContainerExecOpts;
#[test] #[test]
fn test_example_container() { fn test_example_container() {

View File

@ -4,8 +4,6 @@ pub mod cli;
mod cli_generate; mod cli_generate;
fn main() -> eyre::Result<()> { fn main() -> eyre::Result<()> {
//
color_eyre::install().unwrap(); color_eyre::install().unwrap();
let args = std::env::args(); let args = std::env::args();