Skip to content

Commit 007005c

Browse files
committed
make the http options local to Client
1 parent ea83b38 commit 007005c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/eosclient/eosgrpc/eosgrpc.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ type Options struct {
102102
// SecProtocol is the comma separated list of security protocols used by xrootd.
103103
// For example: "sss, unix"
104104
SecProtocol string
105-
106-
httpopts ehttp.Options
107105
}
108106

109107
func (opt *Options) init() {
@@ -120,11 +118,6 @@ func (opt *Options) init() {
120118
opt.CacheDirectory = os.TempDir()
121119
}
122120

123-
if opt.httpopts.Init() != nil {
124-
panic("Cant't init the EOS http client options")
125-
}
126-
opt.httpopts.BaseURL = opt.URL
127-
128121
}
129122

130123
// Client performs actions against a EOS management node (MGM)
@@ -136,7 +129,14 @@ type Client struct {
136129

137130
// GetHTTPCl creates an http client for immediate usage, using the already instantiated resources
138131
func (c *Client) GetHTTPCl() *ehttp.Client {
139-
return ehttp.New(&c.opt.httpopts)
132+
var htopts ehttp.Options
133+
134+
if htopts.Init() != nil {
135+
panic("Cant't init the EOS http client options")
136+
}
137+
htopts.BaseURL = c.opt.URL
138+
139+
return ehttp.New(&htopts)
140140
}
141141

142142
// Create and connect a grpc eos Client

0 commit comments

Comments
 (0)