// Version performs the version request to the CA and returns the
// api.VersionResponse struct.
Version performs the version request to the CA and returns the
api.VersionResponse struct.
// Version performs the version request to the CA and returns the // api . VersionResponse struct .
func (c *Client) Version() (*api.VersionResponse, error) {
	var retried bool
	u := c.endpoint.ResolveReference(&url.URL{Path: "/version"})
retry:
	resp, err := c.client.Get(u.String())
	if err != nil {
		return nil, errs.Wrapf(http.StatusInternalServerError, err, "client.Version; client GET %s failed", u)
	}
	if resp.StatusCode >= 400 {
		if !retried && c.retryOnError(resp) {
			retried = true
			goto retry
		}
		return nil, readError(resp.Body)
	}
	var version api.VersionResponse
	if err := readJSON(resp.Body, &version); err != nil {
		return nil, errs.Wrapf(http.StatusInternalServerError, err, "client.Version; error reading %s", u)
	}
	return &version, nil
}
func ( c * Client ) Version ( ) ( * api . VersionResponse , error ) { var retried bool u := c . endpoint . ResolveReference ( & url . URL { Path : " " } ) retry : resp , err := c . client . Get ( u . String ( ) ) if err != nil { return nil , errs . Wrapf ( http . StatusInternalServerError , err , " " , u ) } if resp . StatusCode >= 400 { if ! retried && c . retryOnError ( resp ) { retried = true goto retry } return nil , readError ( resp . Body ) } var version api . VersionResponse if err := readJSON ( resp . Body , & version ) ; err != nil { return nil , errs . Wrapf ( http . StatusInternalServerError , err , " " , u ) } return & version , nil }
Version performs the version request to the CA and returns the
api.VersionResponse struct.
Version performs the version request to the CA and returns the api . VersionResponse struct .