feat(discosrv): in-memory storage with S3 backing

This commit is contained in:
Jakob Borg
2024-09-13 08:48:03 +02:00
parent 68a1fd010f
commit aed2c66e52
12 changed files with 485 additions and 453 deletions
+2 -5
View File
@@ -106,14 +106,11 @@ func addr(host string, port int) *net.TCPAddr {
}
func BenchmarkAPIRequests(b *testing.B) {
db, err := newLevelDBStore(b.TempDir())
if err != nil {
b.Fatal(err)
}
db := newInMemoryStore(b.TempDir(), 0)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
go db.Serve(ctx)
api := newAPISrv("127.0.0.1:0", tls.Certificate{}, db, nil, true, true, 1)
api := newAPISrv("127.0.0.1:0", tls.Certificate{}, db, nil, true, true)
srv := httptest.NewServer(http.HandlerFunc(api.handler))
kf := b.TempDir() + "/cert"