document usage

This commit is contained in:
Kasper Juul Hermansen 2023-02-17 18:00:20 +01:00
parent 6be8482b46
commit 578c2a6883
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
3 changed files with 43 additions and 11 deletions

View File

@ -2,9 +2,9 @@
A dagger sdk written in rust for rust. A dagger sdk written in rust for rust.
## Disclaimer # Usage
Work in progress. This is not ready for usage yet See [dagger-sdk](./crates/dagger-sdk/README.md)
### Status ### Status
@ -23,7 +23,7 @@ Work in progress. This is not ready for usage yet
- [x] Add codegen to hook into querier - [x] Add codegen to hook into querier
- [ ] fix build / release cycle - [ ] fix build / release cycle
- [ ] general api stabilisation - [ ] general api stabilisation
- [ ] document usage - [x] document usage
- [ ] make async variant - [ ] make async variant
## Architecture ## Architecture

View File

@ -2,14 +2,46 @@
A dagger sdk written in rust for rust. 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 ```bash
- [x] dagger network session cargo run --example first-pipeline
- [ ] graphql rust codegen (User API) ```
- [ ] fix build / release cycle
- [ ] general api stabilisation 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
```