diff --git a/Cargo.lock b/Cargo.lock index dcd81d5..7e6d8fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -514,7 +514,7 @@ dependencies = [ [[package]] name = "healthscript" -version = "0.1.0" +version = "1.0.0" dependencies = [ "ariadne", "async-recursion", @@ -540,7 +540,7 @@ dependencies = [ [[package]] name = "healthscript-cli" -version = "0.1.0" +version = "1.0.0" dependencies = [ "clap", "healthscript", diff --git a/README.md b/README.md index fb1e9cf..b632a7e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# healthscript +# Healthscript -A [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) for writing healthchecks. +A [DSL](https://en.wikipedia.org/wiki/Domain-specific_language) for writing healthchecks ![healthcheck example](https://healthscript.mbund.dev/https://example.com) ![healthcheck example](https://healthscript.mbund.dev/tcp://pwn.osucyber.club:13389%20<"cheese">) @@ -41,6 +41,44 @@ The general philosophy behind the language design are as follows: - `[POST] https://httpbin.org/post` - ![](https://healthscript.mbund.dev/[POST]%20https://httpbin.org/post) +## Error Recovery + +The parser will recover from errors as best as possible to help you write correct healthscript. Errors are available using the CLI. + +![error handling](./errors.png) + +Install the CLI with + +``` +cargo install healthscript-cli +``` + +## Badge Service + +Append healthscript at the end of `https://healthscript.mbund.dev/` to have the hosted server run the healthcheck against your service and generate an svg badge. Then, you can use markdown syntax to include it in your own readmes. + +``` +![healthcheck for example.com](https://healthscript.mbund.dev/https://example.com) +``` + +![healthcheck for example.com](https://healthscript.mbund.dev/https://example.com) + +You may need to url encode your spaces to `%20`. + +## Library + +Integrate healthscript into your own rust project. To do so, add the following to your `Cargo.toml` + +``` +healthscript = "1.0" +``` + +Or use the `cargo` CLI. + +``` +cargo add healthscript +``` + ## TCP Examples - Connect to `pwn.osucyber.club` on port `13389` over TCP, and expect at least one byte to be returned @@ -76,15 +114,3 @@ The general philosophy behind the language design are as follows: - `dns://example.com/1.1.1.1` - ![](https://healthscript.mbund.dev/dns://example.com/1.1.1.1) - -## Badge Service - -Append healthscript at the end of `https://healthscript.mbund.dev/` to have the hosted server run the healthcheck against your service and generate an svg badge. Then, you can use markdown syntax to include it in your own readmes. - -``` -![healthcheck for example.com](https://healthscript.mbund.dev/https://example.com) -``` - -![healthcheck for example.com](https://healthscript.mbund.dev/https://example.com) - -You may need to url encode your spaces to `%20`. diff --git a/errors.png b/errors.png new file mode 100644 index 0000000..e7f4c06 Binary files /dev/null and b/errors.png differ diff --git a/healthscript-cli/Cargo.toml b/healthscript-cli/Cargo.toml index 26fe81e..c1308b6 100644 --- a/healthscript-cli/Cargo.toml +++ b/healthscript-cli/Cargo.toml @@ -1,7 +1,12 @@ [package] name = "healthscript-cli" -version = "0.1.0" +version = "1.0.0" edition = "2021" +description = "CLI for healthscript, a simple DSL for checking the health of a service using HTTP, TCP, ICMP (ping), and more." +authors = ["Mark Bundschuh "] +license = "MIT" +repository = "https://github.com/rhombusgg/healthscript" +keywords = ["http", "health", "monitoring"] [dependencies] clap = { version = "4.5.4", features = ["derive"] } @@ -10,4 +15,3 @@ tokio = { version = "1.38.0", default-features = false, features = ["full"] } tracing = "0.1.40" tracing-subscriber = "0.3.18" yansi = "1.0.1" - diff --git a/healthscript-cli/README.md b/healthscript-cli/README.md new file mode 100644 index 0000000..29cc384 --- /dev/null +++ b/healthscript-cli/README.md @@ -0,0 +1,31 @@ +# Healthscript CLI + +![error handling](../errors.png) + +[Healthscript](https://crates.io/crates/healthscript) is a simple DSL for checking the health of a service using HTTP, TCP, ICMP (ping), and more. + +Install the CLI to run healthchecks locally, and iterate with error messages. + +``` +cargo install healthscript-cli +``` + +``` +$ healthscript-cli --help +CLI for healthscript, a simple DSL for checking the health of a service using HTTP, TCP, ICMP (ping), and more. + +Usage: healthscript-cli