https://github.com/crates-lurey-io/space-traders-api
Generated API client for SpaceTraders
https://github.com/crates-lurey-io/space-traders-api
openapi rust space-traders
Last synced: 7 months ago
JSON representation
Generated API client for SpaceTraders
- Host: GitHub
- URL: https://github.com/crates-lurey-io/space-traders-api
- Owner: crates-lurey-io
- License: mit
- Created: 2025-07-03T18:07:12.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-07-03T19:04:41.000Z (7 months ago)
- Last Synced: 2025-07-03T20:20:31.304Z (7 months ago)
- Topics: openapi, rust, space-traders
- Language: Rust
- Homepage:
- Size: 187 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# space-traders-api
Generated API client for [SpaceTraders](https://spacetraders.io).
[](https://github.com/crates-lurey-io/space-traders-api/actions/workflows/test.yml)
[](https://crates.io/crates/space-traders-api)
## Installing
```sh
cargo add space-traders-api
```
By default `reqwest/default-tls` is included (feature `default-tls`).
## Usage
```rust
use space_traders_api::apis::{configuration::Configuration, global_api};
#[tokio::main]
async fn main() -> Result<(), Box> {
let mut config = Configuration::new();
if let Ok(token) = std::env::var("SPACE_TRADERS_AGENT_TOKEN") {
config.bearer_access_token = Some(token);
}
let status = global_api::get_status(&config).await?;
println!("Status: {}", status.status);
}
```
See [`examples/main.rs`](examples/main.rs) for an example to get started.
```sh
cargo run --example main
```
To provide an agent token to the example, set `SPACE_TRADERS_AGENT_TOKEN`:
```sh
export SPACE_TRADERS_AGENT_TOKEN=...
cargo run --example main
```
## Contributing
This project uses [`just`][] to run commands the same way as the CI:
- `cargo just check` to check formatting and lints.
- `cargo just doc` to generate and preview docs.
[`just`]: https://crates.io/crates/just
For a full list of commands, see the [`Justfile`](./Justfile).