Develop #22
			
				
			
		
		
		
	| 
						 | 
					@ -3,6 +3,7 @@ package natsio
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/logrusorgru/aurora"
 | 
						"github.com/logrusorgru/aurora"
 | 
				
			||||||
	"github.com/nats-io/nats.go"
 | 
						"github.com/nats-io/nats.go"
 | 
				
			||||||
| 
						 | 
					@ -32,6 +33,8 @@ func Connect(cfg Config) error {
 | 
				
			||||||
	// Connect options
 | 
						// Connect options
 | 
				
			||||||
	opts := make([]nats.Option, 0)
 | 
						opts := make([]nats.Option, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						opts = append(opts, nats.Timeout(1*time.Minute))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Has authentication
 | 
						// Has authentication
 | 
				
			||||||
	if cfg.User != "" {
 | 
						if cfg.User != "" {
 | 
				
			||||||
		opts = append(opts, nats.UserInfo(cfg.User, cfg.Password))
 | 
							opts = append(opts, nats.UserInfo(cfg.User, cfg.Password))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue