Skip to content

Commit

Permalink
make the http options local to Client
Browse files Browse the repository at this point in the history
  • Loading branch information
ffurano committed Jun 11, 2021
1 parent e98cf9a commit f98b551
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ type Options struct {
// SecProtocol is the comma separated list of security protocols used by xrootd.
// For example: "sss, unix"
SecProtocol string

httpopts ehttp.Options
}

func (opt *Options) init() {
Expand All @@ -120,11 +118,6 @@ func (opt *Options) init() {
opt.CacheDirectory = os.TempDir()
}

if opt.httpopts.Init() != nil {
panic("Cant't init the EOS http client options")
}
opt.httpopts.BaseURL = opt.URL

}

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

// GetHTTPCl creates an http client for immediate usage, using the already instantiated resources
func (c *Client) GetHTTPCl() *ehttp.Client {
return ehttp.New(&c.opt.httpopts)
var htopts ehttp.Options

if htopts.Init() != nil {
panic("Cant't init the EOS http client options")
}
htopts.BaseURL = c.opt.URL

return ehttp.New(&htopts)
}

// Create and connect a grpc eos Client
Expand Down

0 comments on commit f98b551

Please sign in to comment.