(name string)
| 62 | } |
| 63 | |
| 64 | func GetCollection(name string) (err error) { |
| 65 | response := &CommonResponse{} |
| 66 | |
| 67 | body, err := Send(http.MethodGet, collectionApi+"/"+name, nil) |
| 68 | if err != nil { |
| 69 | common.Logger.Error(err.Error()) |
| 70 | return |
| 71 | } |
| 72 | |
| 73 | err = json.Unmarshal(body, &response) |
| 74 | if err != nil { |
| 75 | return |
| 76 | } |
| 77 | if response.Result == nil { |
| 78 | return errors.New(response.Status.(map[string]interface{})["error"].(string)) |
| 79 | } |
| 80 | return |
| 81 | |
| 82 | } |