Quickstart
Before diving into the installation process, ensure that your environment is adequately prepared. You should be operating with Go 1.20 and have access to the github.com/go-redis/redis/v8
package (version v8.11.5
).
Docker Installation
Utilizing Docker for the installation simplifies the setup process, promoting a uniform operational environment.
Installation Steps:
Pull the Docker Image
docker pull transfa/sendhooks:latest
Run the Docker Image
docker run -t transfa/sendhooks
Direct Binary Installation
The binary can be obtained directly from the releases page.
Installation Steps:
Download the Binary
curl -LO https://github.com/Transfa/sendhooks-engine/releases/latest/download/sendhooks
Make the Binary Executable
chmod +x sendhooks
Run the Binary
./sendhooks
Examples
Here are some examples on how to start sending data to sendhooks :
- JavaScript
- Python
- Java
- C#
- Terminal
const redis = require("redis");
const client = redis.createClient();
const payload = {
url: "https://webhook.site/your-endpoint",
webhookId: "12345",
data: {
key: "value",
},
secretHash: "secret",
};
client.publish("hooks", JSON.stringify(payload));
client.quit();
import redis
import json
def send_data_to_hooks(payload, channel='hooks'):
redis_client = redis.Redis(host='127.0.0.1', port=6379, db=0)
redis_client.publish(channel, json.dumps(payload))
data = {
"url": "https://webhook.site/your-endpoint",
"webhookId": "12345",
"data": {
"key": "value"
},
"secretHash": "secret"
}
send_data_to_hooks(data)
import redis.clients.jedis.Jedis;
public class Main {
public static void main(String[] args) {
try (Jedis jedis = new Jedis("localhost")) {
String payload = "{"
+ "\"url\": \"https://webhook.site/your-endpoint\","
+ "\"webhookId\": \"12345\","
+ "\"data\": { \"key\": \"value\" },"
+ "\"secretHash\": \"secret\""
+ "}";
jedis.publish("hooks", payload);
}
}
}
using StackExchange.Redis;
using System;
using System.Text.Json;
public class Program
{
public static void Main()
{
ConnectionMultiplexer redis = ConnectionMultiplexer.Connect("localhost:6379");
ISubscriber sub = redis.GetSubscriber();
var payload = new {
url = "https://webhook.site/your-endpoint",
webhookId = "12345",
data = new { key = "value" },
secretHash = "secret"
};
sub.Publish("hooks", JsonSerializer.Serialize(payload));
}
}
#!/bin/bash
payload='{
"url": "https://webhook.site/your-endpoint",
"webhookId": "12345",
"data": {
"key": "value"
},
"secretHash": "secret"
}'
redis-cli publish hooks "$payload"