Add http endpoints

This commit is contained in:
Barak Michener 2020-12-04 18:06:24 -08:00
parent 3b05f4316c
commit 56116aea2a
7 changed files with 136 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package main
import (
"encoding/binary"
"errors"
"fmt"
"sync"
"time"
@ -62,6 +63,7 @@ func (mem *MemObjectStore) AwaitObjects(ids []ObjectID, c chan ObjectResult, tim
v, ok := mem.db[id]
if !ok {
waitingFor[id] = true
fmt.Println("want", id)
} else {
found++
c <- ObjectResult{&Object{ID: id, Data: v}, nil}