diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go b/Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go deleted file mode 100644 index 43a38358e..000000000 --- a/Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go +++ /dev/null @@ -1,52 +0,0 @@ -// A facebook graph api client in go. -// https://github.com/huandu/facebook/ -// -// Copyright 2012 - 2015, Huan Du -// Licensed under the MIT license -// https://github.com/huandu/facebook/blob/master/LICENSE - -package facebook - -import ( - "encoding/json" - "net/http" -) - -type batchResultHeader struct { - Name string `facebook=",required"` - Value string `facebook=",required"` -} - -type batchResultData struct { - Code int `facebook=",required"` - Headers []batchResultHeader `facebook=",required"` - Body string `facebook=",required"` -} - -func newBatchResult(res Result) (*BatchResult, error) { - var data batchResultData - err := res.Decode(&data) - - if err != nil { - return nil, err - } - - result := &BatchResult{ - StatusCode: data.Code, - Header: http.Header{}, - Body: data.Body, - } - - err = json.Unmarshal([]byte(result.Body), &result.Result) - - if err != nil { - return nil, err - } - - // add headers to result. - for _, header := range data.Headers { - result.Header.Add(header.Name, header.Value) - } - - return result, nil -} |