Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/diced/hiven-gw
Useful for microservicing Hiven bots (please contribute lmao)
https://github.com/diced/hiven-gw
gateway go hiven hivenapp microsservices
Last synced: about 1 month ago
JSON representation
Useful for microservicing Hiven bots (please contribute lmao)
- Host: GitHub
- URL: https://github.com/diced/hiven-gw
- Owner: diced
- Created: 2020-11-17T05:55:08.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-19T03:01:40.000Z (about 4 years ago)
- Last Synced: 2023-03-04T02:34:00.332Z (almost 2 years ago)
- Topics: gateway, go, hiven, hivenapp, microsservices
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hiven-gw
This can be useful for microservicing hiven bots.
# how 2 use
In order to accomplish 0 loss on messages, hiven-gw uses `RPUSH` and `BLPOP` in redis.
Now create a `.env` and put the contents in```bash
TOKEN="your hiven token (found in localStorage)"
REDIS="localhost:6379"
LIST="gateway"
DISABLED_EVENTS="TYPING_START" # comma separeted list of disabled events (will not push to redis)
ZLIB=true # enable if you would like to recieve compressed zlib from hiven
DEBUG=true # enable if you want to recieve debug msgs (op, hb)
```Then you will need to build hiven-gw by doing `go build`
Now you can run the executable it creates: `./hivengw`# recieving
You can run `BLPOP gateway 0` in redis to get data. You can do a while loop that does that command.
# fetching gateway runtime stats
Gateway runtime stats are sent every 30 seconds to the configured list (e.g. `gateway`) (on every heartbeat). The payload will look like this:
_Note: stats event can't be disabled with DISABLED_EVENTS_```js
{
"e": "stats",
"stats": {
Alloc: 17310048,
...otherstats
}
}
```