<commit_before># Gusher.Cluster

 [gusher](https://github.com/syhlion/gusher) Plus version ,support cluster

## Requirements

* redis

## Usage

Install from source

`go get -u github.com/syhlion/gusher.cluster`

And Set .env like [example](https://github.com/syhlion/gusher.cluster/blob/master/.env.example)

master mode
`./gusher.cluster master`

slave mode
`./gusher.cluster slave`

## Slave  Api

Connect:
`GET /ws/{app_key}?auth={auth}`

## Master Api

Check app_key exist:
`GET /api/check/{app_key}`
Scuess Response:
```
{
    "app_key":""
}
```

Push Message:
`POST /api/push/{app_key}/{channel}/{event}?data={data}`
Scuess Response:
```
{
    "channel":"",
    "event":"",
    "data":""
}
```

Slave Server Info:
`GET /api/system/slaveinfos`
Scuess Response:
```
{
    "'{ip}'+'@'+'{listen_port}'":{
        "ip":"",
        "local_listen":"",
        "version":"",
        "runtime_version":"",
        "cpu":,
        "usage-memory":,
        "goroutines":6,
        "connections":,
        "send_interval":"",
        "update_time":<commit_msg>fix syntax<commit_after># Gusher.Cluster

 [gusher](https://github.com/syhlion/gusher) Plus version ,support cluster

## Requirements

* redis

## Usage

Install from source:

`go get -u github.com/syhlion/gusher.cluster`

And Set .env like [example](https://github.com/syhlion/gusher.cluster/blob/master/.env.example)

master mode:

`./gusher.cluster master`

slave mode:

`./gusher.cluster slave`

## Slave  Api

Connect:

`GET /ws/{app_key}?auth={auth}`

## Master Api

Check app_key exist:

`GET /api/check/{app_key}`


Scuess Response:


```
{
    "app_key":""
}
```

Push Message:

`POST /api/push/{app_key}/{channel}/{event}?data={data}`


Scuess Response:
```
{
    "channel":"",
    "event":"",
    "data":""
}
```

Slave Server Info:

`GET /api/system/slaveinfos`


Scuess Response:

```
{
    "'{ip}'+'@'+'{listen_port}'":{
        "ip":"",
        "local_listen":"",
        "version":"",
        "runtime_version":"",
        "cpu":,
        "usage-memory":,
        "goroutines":6,
        "connections":,
        "send_interval":"",
        "update_time":
{'fraction_non_alphanumeric': 0.2028235294117647, 'fraction_numerical': 0.0009411764705882353, 'mean_word_length': 3.1768172888015718, 'pattern_counts': {'":': 30, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1132502', 'n_tokens_mistral': 810, 'n_tokens_neox': 775, 'n_words': 144}