Skip to content

Commit

Permalink
NATS module init
Browse files Browse the repository at this point in the history
  • Loading branch information
im-kulikov committed Feb 24, 2019
0 parents commit 98e6e7f
Show file tree
Hide file tree
Showing 6 changed files with 580 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Evgeniy Kulikov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# NATS Module for Helium

Module provides you with the following things:
- [`*nats.Conn`](https://godoc.org/github.com/nats-io/go-nats#Conn) represents a bare connection to a nats-server. It can send and receive []byte payloads
- [`stan.Conn`](https://godoc.org/github.com/nats-io/go-nats-streaming#Conn) represents a connection to the NATS Streaming subsystem. It can Publish and Subscribe to messages within the NATS Streaming cluster.

Configuration:
- yaml example
```yaml
nats:
url: nats://<host>:<port>
cluster_id: string
client_id: string
servers: [...server slice...]
no_randomize: bool
name: string
verbose: bool
pedantic: bool
secure: bool
allow_reconnect: bool
max_reconnect: int
reconnect_wait: duration
timeout: duration
flusher_timeout: duration
ping_interval: duration
max_pings_out: int
reconnect_buf_size: int
sub_chan_len: int
user: string
password: string
token: string
```
- env example
```
NATS_URL=nats://<host>:<port>
NATS_CLUSTER_ID=string
NATS_CLIENT_ID=string
NATS_SERVERS=[...server slice...]
NATS_NO_RANDOMIZE=bool
NATS_NAME=string
NATS_VERBOSE=bool
NATS_PEDANTIC=bool
NATS_SECURE=bool
NATS_ALLOW_RECONNECT=bool
NATS_MAX_RECONNECT=int
NATS_RECONNECT_WAIT=duration
NATS_TIMEOUT=duration
NATS_FLUSHER_TIMEOUT=duration
NATS_PING_INTERVAL=duration
NATS_MAX_PINGS_OUT=int
NATS_RECONNECT_BUF_SIZE=int
NATS_SUB_CHAN_LEN=int
NATS_USER=string
NATS_PASSWORD=string
NATS_TOKEN=string
```
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/go-helium/nats

require (
github.com/im-kulikov/helium v0.9.2
github.com/nats-io/go-nats v1.7.2
github.com/nats-io/go-nats-streaming v0.4.0
github.com/nats-io/nats-streaming-server v0.11.2
github.com/pkg/errors v0.8.1
github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa
github.com/spf13/viper v1.3.1
go.etcd.io/bbolt v1.3.2 // indirect
)
Loading

0 comments on commit 98e6e7f

Please sign in to comment.