client: Use http.Client instead of a string for the socket
This converts the client and weldrcheck functions to use http.Client for connections instead of passing around the socket path and opening it for each test.
This commit is contained in:
parent
2778efed6f
commit
46c3bed153
7 changed files with 73 additions and 57 deletions
|
|
@ -4,10 +4,11 @@ package client
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// GetStatusV0 makes a GET request to /api/status and returns the v0 response as a StatusResponseV0
|
||||
func GetStatusV0(socket string) (reply StatusV0, resp *APIResponse, err error) {
|
||||
func GetStatusV0(socket *http.Client) (reply StatusV0, resp *APIResponse, err error) {
|
||||
body, resp, err := GetRaw(socket, "GET", "/api/status")
|
||||
if resp != nil || err != nil {
|
||||
return reply, resp, err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue