Add tokio_unstable config, defaults for values
This commit is contained in:
parent
38fcea194c
commit
0930b56101
2
.cargo/config
Normal file
2
.cargo/config
Normal file
|
@ -0,0 +1,2 @@
|
|||
[build]
|
||||
rustflags = ["--cfg", "tokio_unstable"]
|
17
README.md
17
README.md
|
@ -5,7 +5,22 @@ Note: pict-rs-admin is not intended to be exposed to the internet.
|
|||
|
||||
## Running
|
||||
```bash
|
||||
$ pict-rs-admin -h
|
||||
$ ./pict-rs-admin -h
|
||||
Usage: pict-rs-admin [OPTIONS] --pict-rs-api-key <PICT_RS_API_KEY>
|
||||
|
||||
Options:
|
||||
-b, --bind-address <BIND_ADDRESS>
|
||||
[env: PICTRS_ADMIN__BIND_ADDRESS=] [default: 127.0.0.0:8084]
|
||||
--pict-rs-endpoint <PICT_RS_ENDPOINT>
|
||||
[env: PICTRS_ADMIN__PICTRS_ENDPOINT=] [default: http://localhost:8080]
|
||||
--pict-rs-api-key <PICT_RS_API_KEY>
|
||||
[env: PICTRS_ADMIN__PICTRS_API_KEY=]
|
||||
--opentelemetry-url <OPENTELEMETRY_URL>
|
||||
[env: PICTRS_ADMIN__OPENTELEMETRY_URL=]
|
||||
--opentelemetry-event-buffer-size <OPENTELEMETRY_EVENT_BUFFER_SIZE>
|
||||
[env: PICTRS_ADMIN__OPENTELEMETRY_EVENT_BUFFER_SIZE=]
|
||||
-h, --help
|
||||
Print help
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
|
|
@ -13,6 +13,8 @@ rustPlatform.buildRustPackage {
|
|||
PROTOC = "${protobuf}/bin/protoc";
|
||||
PROTOC_INCLUDE = "${protobuf}/include";
|
||||
|
||||
RUSTFLAGS = "--cfg tokio_unstable";
|
||||
|
||||
nativeBuildInputs = [ ];
|
||||
|
||||
passthru.tests = { inherit (nixosTests) pict-rs-admin; };
|
||||
|
|
13
src/main.rs
13
src/main.rs
|
@ -22,9 +22,18 @@ use url::Url;
|
|||
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
#[clap(short, long, env = "PICTRS_ADMIN__BIND_ADDRESS")]
|
||||
#[clap(
|
||||
short,
|
||||
long,
|
||||
env = "PICTRS_ADMIN__BIND_ADDRESS",
|
||||
default_value = "127.0.0.0:8084"
|
||||
)]
|
||||
bind_address: SocketAddr,
|
||||
#[clap(long, env = "PICTRS_ADMIN__PICTRS_ENDPOINT")]
|
||||
#[clap(
|
||||
long,
|
||||
env = "PICTRS_ADMIN__PICTRS_ENDPOINT",
|
||||
default_value = "http://localhost:8080"
|
||||
)]
|
||||
pict_rs_endpoint: Url,
|
||||
#[clap(long, env = "PICTRS_ADMIN__PICTRS_API_KEY")]
|
||||
pict_rs_api_key: String,
|
||||
|
|
Loading…
Reference in a new issue