feat(sdk): with _opts methods

Now all opt values enter into a _opts function instead of the original.
This avoids a lot of verbosity for both None in the case opts are
unwanted, and Some() if they actually are.

They are used like so:

```rust
client.container().from("...");
client.container_opts(Some(ContainerOpts{ ... }))
```

Some from opts will be removed in a future commit/pr
This commit is contained in:
2023-02-19 17:43:12 +01:00
committed by Kasper Juul Hermansen
parent 02006d40fc
commit 9762da895a
10 changed files with 447 additions and 99 deletions

View File

@@ -2,9 +2,9 @@ fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?;
let version = client
.container(None)
.container()
.from("golang:1.19")
.with_exec(vec!["go", "version".into()], None)
.with_exec(vec!["go", "version".into()])
.stdout()?;
println!("Hello from Dagger and {}", version.trim());