add leveldb support for needle map
This supposedly should reduce memory consumption. However, for tests with millions of, this shows consuming more memories. Need to see whether this will work out. If not, later boltdb will be tested.
This commit is contained in:
@@ -26,12 +26,12 @@ func init() {
|
||||
func PostBytes(url string, body []byte) ([]byte, error) {
|
||||
r, err := client.Post(url, "application/octet-stream", bytes.NewReader(body))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("Post to %s: %v", url, err)
|
||||
}
|
||||
defer r.Body.Close()
|
||||
b, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("Read response body: %v", err)
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user