-
Notifications
You must be signed in to change notification settings - Fork 7
/
client.go
38 lines (31 loc) · 933 Bytes
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package natsbackend
import (
nats "github.com/nats-io/nats.go"
)
// natsClient creates an object storing
// the client.
type NatsClient struct {
*nats.Conn
}
// // newClient creates a new client to access HashiCups
// // and exposes it for any secrets or roles to use.
// func newClient(config *natsConfig) (*natsClient, error) {
// if config == nil {
// return nil, errors.New("client configuration was nil")
// }
// if config.Username == "" {
// return nil, errors.New("client username was not defined")
// }
// if config.Password == "" {
// return nil, errors.New("client password was not defined")
// }
// if config.URL == "" {
// return nil, errors.New("client URL was not defined")
// }
// // c, err := hashicups.NewClient(&config.URL, &config.Username, &config.Password)
// nc, err := nats.Connect(nats.DefaultURL)
// if err != nil {
// return nil, err
// }
// return &natsClient{nc}, nil
// }