Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/magiclen/wait-service
Wait Service is a pure rust program to test and wait on the availability of multiple services.
https://github.com/magiclen/wait-service
cli rust tcp uds unix wait-for-it
Last synced: 28 days ago
JSON representation
Wait Service is a pure rust program to test and wait on the availability of multiple services.
- Host: GitHub
- URL: https://github.com/magiclen/wait-service
- Owner: magiclen
- License: mit
- Created: 2021-10-24T16:50:31.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-11-14T09:16:22.000Z (about 1 year ago)
- Last Synced: 2024-11-18T11:27:30.858Z (about 1 month ago)
- Topics: cli, rust, tcp, uds, unix, wait-for-it
- Language: Rust
- Homepage:
- Size: 38.1 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Wait Service
====================[![CI](https://github.com/magiclen/wait-service/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/wait-service/actions/workflows/ci.yml)
Wait Service is a pure rust program to test and wait on the availability of multiple services.
## Help
```
EXAMPLES:
wait-service --tcp localhost:27017 --tcp localhost:27018 -t 5 -- npm start # Wait for localhost:27017 and localhost:27018 (max 5 seconds) and then run `npm start`
wait-service --tcp localhost:27017 --uds /var/run/app.sock -t 0 -- npm start # Wait for localhost:27017 and /var/run/app.sock (forever) and then run `npm start`
wait-service --uds /var/run/app.sock --json /path/to/json -- npm start # Wait for /var/run/app.sock and other services defined in the json file (max 60 seconds) and then run `npm start`Usage: wait-service [OPTIONS] -- ...
Arguments:
... Command to execute after service is availableOptions:
-t, --timeout Set the timeout in seconds, zero for no timeout [default: 60]
--tcp ... Test and wait on the availability of TCP services
--uds ... Test and wait on the availability of UDS services [aliases: unix]
--json ... Test and wait on the availability of TCP or UDS services
-h, --help Print help
-V, --version Print version
```## The Config File
With the `--json` option, you can input one or more JSON files to import your TCP / UDS services. The content of each file needs to be a JSON array of objects.
For a TCP service, the object format is
```json
{
"host": "example.com",
"port": 443
}
```For a UDS service, the object format is
```json
{
"uds": "/path/to/socket_file"
}
```## License
[MIT](LICENSE)