blob: 4384d47a94ecf6753c5c3aae062362ab1a9f16ec [file] [log] [blame]
jrperrittc5c590a2016-11-04 14:41:15 -05001package imagedata
2
3import (
4 "fmt"
5 "io"
6
Krzysztof Szukiełojć3f41d082017-05-07 14:43:06 +02007 "gerrit.mcp.mirantis.net/debian/gophercloud.git"
jrperrittc5c590a2016-11-04 14:41:15 -05008)
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}