Giter Club home page Giter Club logo

wait-on's Introduction

wait-on

Library and CLI Utility to wait on the availability of resources such as Files, HTTP Servers, Ports & Sockets

Crates.io Documentation Build Clippy Formatter

Installation

cargo install wait-on

Usage

Wait for a file to exist

wait-on file /path/to/file

Wait for a HTTP Resource to respond

wait-on http GET https://example.com

Wait for a Socket to be available using TCP Protocol

wait-on tcp -i 127.0.0.1 -p 8080

License

This project is licensed under the MIT license and the Apache License 2.0.

wait-on's People

Contributors

estebanborai avatar github-actions[bot] avatar

Stargazers

 avatar

Watchers

 avatar

wait-on's Issues

Support file as config for multiple `Waitable`s

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"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.