diff options
| author | Tuowen Zhao <ztuowen@gmail.com> | 2026-01-04 22:47:54 -0800 |
|---|---|---|
| committer | Tuowen Zhao <ztuowen@gmail.com> | 2026-01-04 22:47:54 -0800 |
| commit | 2aa4cb7a52b28722816ecfd55f3b06293332c55c (patch) | |
| tree | f02a9f3d59d109c70caf932a24e43368994e0e8c /plugins/localstack | |
| parent | 7e951c254e779ff0620537cf43ca69dd878387b4 (diff) | |
| parent | d23d3ea69fdb839088e6e5589557cce77b34aaf8 (diff) | |
| download | zsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.tar.gz zsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.tar.bz2 zsh-2aa4cb7a52b28722816ecfd55f3b06293332c55c.zip | |
Diffstat (limited to 'plugins/localstack')
| -rw-r--r-- | plugins/localstack/README.md | 24 | ||||
| -rw-r--r-- | plugins/localstack/localstack.plugin.zsh | 37 | ||||
| -rw-r--r-- | plugins/localstack/sqs-send-result.png | bin | 0 -> 70661 bytes |
3 files changed, 61 insertions, 0 deletions
diff --git a/plugins/localstack/README.md b/plugins/localstack/README.md new file mode 100644 index 000000000..2c71e9edf --- /dev/null +++ b/plugins/localstack/README.md @@ -0,0 +1,24 @@ +# Localstack plugin # + +CLI support for LOCALSTACK interaction + +## Description ## +To use it, add `localstack` to the plugins array in your zshrc file: + +```zsh +plugins=(... localstack) +``` + +## Usage ## + +This plugin supplies one command, `lsk`, through which all its features are exposed. + +## Commands + +| Command | Description | +| :------------ | :-------------------------------------------------------------------- | +| `lsk sqs-send <queue> <message.json>` | sends a given message in sqs to a given queue | + +## Examples + + diff --git a/plugins/localstack/localstack.plugin.zsh b/plugins/localstack/localstack.plugin.zsh new file mode 100644 index 000000000..080b14a54 --- /dev/null +++ b/plugins/localstack/localstack.plugin.zsh @@ -0,0 +1,37 @@ +# CLI support for LOCALSTACK interaction +# +# See README.md for details +lsk() { + case $1 in + sqs-send) + shift + sqs-send "$@" + ;; + *) + echo "Command not found: $1" + return 1 + ;; + esac +} + +# Send SQS function +# +# This function sends a given message in sqs to a given queue, when used Localstack +# +# Use: +# sqs-send <queue> <message> +# +# Parameters +# <queue> A given queue +# <message> A content of message em json archive +# +# Example +# sqs-send user user.json +sqs-send(){ + if [ -z "$1" ]; then + echo "Use: sqs-send <queue> <payload>" + return 1 + fi + + curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)" +}
\ No newline at end of file diff --git a/plugins/localstack/sqs-send-result.png b/plugins/localstack/sqs-send-result.png Binary files differnew file mode 100644 index 000000000..69eb2a640 --- /dev/null +++ b/plugins/localstack/sqs-send-result.png |
