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