func (c *CLCRunnerClient) GetVersion(IP string) (version.Version, error) {
	var version version.Version
	var err error

	rawURL := fmt.Sprintf("https://%s:%d/%s/%s", IP, c.clcRunnerPort, clcRunnerPath, clcRunnerVersionPath)

	req, err := http.NewRequest("GET", rawURL, nil)
	if err != nil {
		return version, err
	}
	req.Header = c.clcRunnerAPIRequestHeaders

	resp, err := c.clcRunnerAPIClient.Do(req)
	if err != nil {
		return version, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return version, fmt.Errorf("unexpected status code from CLC runner: %d", resp.StatusCode)
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return version, err
	}

	err = json.Unmarshal(body, &version)

	return version, err
}
// GetVersion fetches the version of the CLC Runner
GetVersion fetches the version of the CLC Runner
// GetVersion fetches the version of the CLC Runner
func (c *CLCRunnerClient) GetVersion(IP string) (version.Version, error) {
	var version version.Version
	var err error
	rawURL := fmt.Sprintf("https://%s:%d/%s/%s", IP, c.clcRunnerPort, clcRunnerPath, clcRunnerVersionPath)
	req, err := http.NewRequest("GET", rawURL, nil)
	if err != nil {
		return version, err
	}
	req.Header = c.clcRunnerAPIRequestHeaders
	resp, err := c.clcRunnerAPIClient.Do(req)
	if err != nil {
		return version, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return version, fmt.Errorf("unexpected status code from CLC runner: %d", resp.StatusCode)
	}
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return version, err
	}
	err = json.Unmarshal(body, &version)
	return version, err
}
func ( c * CLCRunnerClient ) GetVersion ( IP string ) ( version . Version , error ) { var version version . Version var err error rawURL := fmt . Sprintf ( " " , IP , c . clcRunnerPort , clcRunnerPath , clcRunnerVersionPath ) req , err := http . NewRequest ( " " , rawURL , nil ) if err != nil { return version , err } req . Header = c . clcRunnerAPIRequestHeaders resp , err := c . clcRunnerAPIClient . Do ( req ) if err != nil { return version , err } defer resp . Body . Close ( ) if resp . StatusCode != http . StatusOK { return version , fmt . Errorf ( " " , resp . StatusCode ) } body , err := ioutil . ReadAll ( resp . Body ) if err != nil { return version , err } err = json . Unmarshal ( body , & version ) return version , err }
GetVersion fetches the version of the CLC Runner
GetVersion fetches the version of the CLC Runner