document usage

This commit is contained in:
2023-02-17 18:00:20 +01:00
parent 6be8482b46
commit 578c2a6883
3 changed files with 43 additions and 11 deletions

View File

@@ -2,14 +2,46 @@
A dagger sdk written in rust for rust.
## Disclaimer
## Examples
Work in progress. This is not ready for usage yet
See [examples](./examples/)
### Status
Run them like so
- [x] dagger cli downloader
- [x] dagger network session
- [ ] graphql rust codegen (User API)
- [ ] fix build / release cycle
- [ ] general api stabilisation
```bash
cargo run --example first-pipeline
```
The examples match the folder name in each directory in examples
## Install
Simply install like:
```bash
cargo install dagger-sdk
```
### Usage
```rust
fn main() -> eyre::Result<()> {
let client = dagger_sdk::client::connect()?;
let version = client
.container(None)
.from("golang:1.19".into())
.with_exec(vec!["go".into(), "version".into()], None)
.stdout();
println!("Hello from Dagger and {}", version.trim());
Ok(())
}
```
And run it like a normal application:
```bash
cargo run
```