mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-25 16:32:42 +01:00
document usage
This commit is contained in:
parent
6be8482b46
commit
578c2a6883
@ -2,9 +2,9 @@
|
||||
|
||||
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
|
||||
|
||||
@ -23,7 +23,7 @@ Work in progress. This is not ready for usage yet
|
||||
- [x] Add codegen to hook into querier
|
||||
- [ ] fix build / release cycle
|
||||
- [ ] general api stabilisation
|
||||
- [ ] document usage
|
||||
- [x] document usage
|
||||
- [ ] make async variant
|
||||
|
||||
## Architecture
|
||||
|
@ -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
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user