~thrrgilag/woodstock

woodstock/client_info.go -rw-r--r-- 531 bytes
62b10b5cMorgan McMillian Update for new project location and module name 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package woodstock

// ClientInfoResult object, https://pnut.io/docs/resources/clients
type ClientInfoResult struct {
	*CommonResponse
	Data ClientInfo `json:"data"`
}

// GetClient retrieves client object based on the id
// https://pnut.io/docs/resources/clients#get-clients-id
func (c *Client) GetClient(id string) (result ClientInfoResult, err error) {
	responseCh := make(chan response)
	c.queryQueue <- query{url: ClientAPI + "/" + id, data: &result, method: "GET", responseCh: responseCh}
	return result, (<-responseCh).err
}