diff options
author | =Corey Hulen <corey@hulen.com> | 2015-06-25 12:21:47 -0400 |
---|---|---|
committer | =Corey Hulen <corey@hulen.com> | 2015-06-25 12:21:47 -0400 |
commit | 16505ffe94ef09102e2bd1ecdca72541c2d85ae6 (patch) | |
tree | 4260356d839f8905c237eee62ba18aa928d23159 /Godeps/_workspace/src/github.com/huandu/facebook/batch_result.go | |
parent | 6ee153d7f8cfc14d3339e5e341e8ead330456c0d (diff) | |
download | chat-16505ffe94ef09102e2bd1ecdca72541c2d85ae6.tar.gz chat-16505ffe94ef09102e2bd1ecdca72541c2d85ae6.tar.bz2 chat-16505ffe94ef09102e2bd1ecdca72541c2d85ae6.zip |
updating make
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 -} |