Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support file as config for multiple Waitables #3

Open
EstebanBorai opened this issue May 17, 2024 · 0 comments
Open

Support file as config for multiple Waitables #3

EstebanBorai opened this issue May 17, 2024 · 0 comments

Comments

@EstebanBorai
Copy link
Owner

EstebanBorai commented May 17, 2024

Some use cases may require waiting for multiple resources of different kinds to be available
before exiting.

Theres 2 ways to approach this:

  1. Use subcommand chaining, so a one liner could be written allowing to specify multiple resources. This relies on Command Chaining which is not yet supported in Clap.
  2. Use a file (e.g. Configuration File), where multiple resources are specified

File Specs

A nice format (as well as familiar) in the Rust ecosystem is TOML. Based on the assumption of
such format as input, the following spec could be of help to determine how the file is structured.

# Top-Level Definitions for the process

name = "Wain on Docker Services"
timeout = "120s"

[resources.tcp.server]
host = "127.0.0.1"
port = 7878
uri = "/healthcheck"
exit_on_http_status = 200

[resources.tcp.api_gateway]
host = "127.0.0.1"
port = 80
exit_on_http_status = 200
inteval = "2s"

[resources.file.logs]
path = "server.log"
exit_on_size = "5MB"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant