blob: 970b226f2ae81744b838e287242adba62a208df0 [file] [log] [blame]
jrperrittc5c590a2016-11-04 14:41:15 -05001package imagedata
2
3import (
4 "fmt"
5 "io"
6
7 "github.com/gophercloud/gophercloud"
8)
9
10// UploadResult is the result of an upload image operation
11type UploadResult struct {
12 gophercloud.ErrResult
13}
14
15// DownloadResult is the result of a download image operation
16type DownloadResult struct {
17 gophercloud.Result
18}
19
20// Extract builds images model from io.Reader
21func (r DownloadResult) Extract() (io.Reader, error) {
22 if r, ok := r.Body.(io.Reader); ok {
23 return r, nil
24 }
25 return nil, fmt.Errorf("Expected io.Reader but got: %T(%#v)", r.Body, r.Body)
26}