responder
Version, currently 0.1.03 versions
- 0.1.2latestDec 17, 2020
- 0.1.1not indexedDec 17, 2020
- 0.1.0not indexedDec 17, 2020
github.com/Green-Edge/responder
A simple RESP server which accepts requests, pattern matches the command using regexp, and returns a corresponding response from a YAML file.
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
responder:
github: Green-Edge/responder
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Responder
A simple RESP server which accepts requests, pattern matches the command using regexp, and returns a corresponding response from a YAML file.
Install
Responder requires a recent version of Crystal (0.35.1 as of this time).
To build, follow the standard Crystal build process:
# shards install
# crystal build --release --no-debug src/responder.cr
This will produce a single responder binary that can then be moved
to somewhere in your PATH, for example /usr/local/bin.
Usage
# responder
Usage: responder [arguments]
-c FILE, --config=FILE Configuration YAML file
-h, --help Show this help
Configuration
The YAML file format is as follows:
host: "{your IP or localhost}"
port: {your port, for example 3001}
rules:
- match: "{a regex}"
wait: {int}
response: "{response value}"
Rules are made up of the following values:
match: a regular expression which should match the RESP command and arguments, in the format you would issue viaredis-cliwait: an optional delay, in milliseconds, before returning the resultresponse: the response value
Responses
Responses can be defined in YAML. For example:
rules:
- match: "PING"
response:
success: true
result: "PONG"
The response will be converted to a JSON string, which can then be parsed using a JSON or YAML parser by the client.
Regular expressions
Captures can be used in the match regular expression, and those
captures can be returned in the response. For example:
rules:
- match: "HELLO ([^\\s]+)" # regex
response: >-
{"success": true, "result": "HELLO $1"}
Calling this with HELLO world will capture world and
return it in the place of $1 in the response.
Contributing
- Fork it (https://github.com/Green-Edge/responder/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new pull request
Liability
We take no responsibility for the use of our tool, or external instances provided by third parties. We strongly recommend you abide by the valid official regulations in your country. Furthermore, we refuse liability for any inappropriate or malicious use of this tool. This tool is provided to you in the spirit of free, open software.
You may view the LICENSE in which this software is provided to you here.
- Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Dec 17, 2020
- Commit
a075a41038f1- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Green-Edge/responder
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 3