| "github.com/mitchellh/mapstructure" |
| "github.com/rackspace/gophercloud" |
| os "github.com/rackspace/gophercloud/openstack/db/v1/instances" |
| Created string //time.Time |
| Updated string //time.Time |
| func commonExtract(err error, body interface{}) (*Instance, error) { |
| Instance Instance `mapstructure:"instance"` |
| err = mapstructure.Decode(body, &response) |
| return &response.Instance, err |
| // CreateResult represents the result of a Create operation. |
| type CreateResult struct { |
| func (r CreateResult) Extract() (*Instance, error) { |
| return commonExtract(r.Err, r.Body) |
| func (r GetResult) Extract() (*Instance, error) { |
| return commonExtract(r.Err, r.Body) |