@@ -15,9 +15,9 @@ The goals of the project are resiliency, performance, and ease of use.
15
15
## Usage
16
16
17
17
``` elixir
18
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 })
18
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 })
19
19
# Or if the server requires TLS you can start a connection with:
20
- # {:ok, gnat} = Gnat.start_link(%{host: ' 127.0.0.1' , port: 4222, tls: true})
20
+ # {:ok, gnat} = Gnat.start_link(%{host: " 127.0.0.1" , port: 4222, tls: true})
21
21
22
22
{:ok , subscription} = Gnat .sub (gnat, self (), " pawnee.*" )
23
23
:ok = Gnat .pub (gnat, " pawnee.news" , " Leslie Knope recalled from city council (Jammed)" )
31
31
32
32
``` elixir
33
33
# with user and password
34
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 , username: " joe" , password: " 123" , auth_required: true })
34
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 , username: " joe" , password: " 123" , auth_required: true })
35
35
36
36
# with token
37
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 , token: " secret" , auth_required: true })
37
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 , token: " secret" , auth_required: true })
38
38
39
39
# with an nkey seed
40
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 , nkey_seed: " SUAM..." , auth_required: true })
40
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 , nkey_seed: " SUAM..." , auth_required: true })
41
41
42
42
# with decentralized user credentials (JWT)
43
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 , nkey_seed: " SUAM..." , jwt: " eyJ0eX..." , auth_required: true })
43
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 , nkey_seed: " SUAM..." , jwt: " eyJ0eX..." , auth_required: true })
44
44
45
45
# connect to NGS with JWT
46
46
{:ok , gnat} = Gnat .start_link (%{host: " connect.ngs.global" , tls: true , jwt: " ey..." , nkey_seed: " SUAM..." })
@@ -53,7 +53,7 @@ In order to connect to these clusters you'll want to pass some extra TLS setting
53
53
54
54
``` elixir
55
55
# using a basic TLS connection
56
- {:ok , gnat} = Gnat .start_link (%{host: ' 127.0.0.1' , port: 4222 , tls: true })
56
+ {:ok , gnat} = Gnat .start_link (%{host: " 127.0.0.1" , port: 4222 , tls: true })
57
57
58
58
# Passing a Client Certificate for verification
59
59
{:ok , gnat} = Gnat .start_link (%{tls: true , ssl_opts: [certfile: " client-cert.pem" , keyfile: " client-key.pem" ]})
0 commit comments