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
|
## Running
|
||||||
```bash
|
```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
|
## Contributing
|
||||||
|
|
|
@ -13,6 +13,8 @@ rustPlatform.buildRustPackage {
|
||||||
PROTOC = "${protobuf}/bin/protoc";
|
PROTOC = "${protobuf}/bin/protoc";
|
||||||
PROTOC_INCLUDE = "${protobuf}/include";
|
PROTOC_INCLUDE = "${protobuf}/include";
|
||||||
|
|
||||||
|
RUSTFLAGS = "--cfg tokio_unstable";
|
||||||
|
|
||||||
nativeBuildInputs = [ ];
|
nativeBuildInputs = [ ];
|
||||||
|
|
||||||
passthru.tests = { inherit (nixosTests) pict-rs-admin; };
|
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)]
|
#[derive(Debug, Parser)]
|
||||||
struct Args {
|
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,
|
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,
|
pict_rs_endpoint: Url,
|
||||||
#[clap(long, env = "PICTRS_ADMIN__PICTRS_API_KEY")]
|
#[clap(long, env = "PICTRS_ADMIN__PICTRS_API_KEY")]
|
||||||
pict_rs_api_key: String,
|
pict_rs_api_key: String,
|
||||||
|
|
Loading…
Reference in a new issue