func (r commonResult) Extract() (*Router, error) {
	if r.Err != nil {
		return nil, r.Err
	}
	var res struct {
		Router *Router `json:"router"`
	}
	err := mapstructure.Decode(r.Body, &res)
	return res.Router, err
}
Extract is a function that accepts a result and extracts a router.
package routers
import (
	"github.com/mitchellh/mapstructure"
	"github.com/rackspace/gophercloud"
	"github.com/rackspace/gophercloud/pagination"
)
type GatewayInfo struct {
	NetworkID string `json:"network_id" mapstructure:"network_id"`
}
type Router struct {
	Status string `json:"status" mapstructure:"status"`
	GatewayInfo GatewayInfo `json:"external_gateway_info" mapstructure:"external_gateway_info"`
	AdminStateUp bool `json:"admin_state_up" mapstructure:"admin_state_up"`
	Name string `json:"name" mapstructure:"name"`
	ID string `json:"id" mapstructure:"id"`
	TenantID string `json:"tenant_id" mapstructure:"tenant_id"`
}
type RouterPage struct {
	pagination.LinkedPageBase
}
func (p RouterPage) NextPageURL() (string, error) {
	type resp struct {
		Links []gophercloud.Link `mapstructure:"routers_links"`
	}
	var r resp
	err := mapstructure.Decode(p.Body, &r)
	if err != nil {
		return "", err
	}
	return gophercloud.ExtractNextURL(r.Links)
}
func (p RouterPage) IsEmpty() (bool, error) {
	is, err := ExtractRouters(p)
	if err != nil {
		return true, nil
	}
	return len(is) == 0, nil
}
func ExtractRouters(page pagination.Page) ([]Router, error) {
	var resp struct {
		Routers []Router `mapstructure:"routers" json:"routers"`
	}
	err := mapstructure.Decode(page.(RouterPage).Body, &resp)
	return resp.Routers, err
}
type commonResult struct {
	gophercloud.Result
}