Move Spaces FromEnv into blob; Upload takes Object; drop logSpaces.

This commit is contained in:
2026-08-21 23:48:18 -07:00
parent 3eb75cfd80
commit a36bc723cc
4 changed files with 45 additions and 39 deletions
+4 -4
View File
@@ -3,7 +3,6 @@ package web
import (
"bytes"
"context"
"io"
"mime/multipart"
"net/http"
"net/http/httptest"
@@ -13,6 +12,7 @@ import (
"github.com/alexedwards/scs/v2"
"plumber"
"plumber/internal/blob"
)
func newTestServer(t *testing.T) (*Server, *memDB, scs.Store) {
@@ -296,10 +296,10 @@ type fakeBlob struct {
func (f *fakeBlob) Enabled() bool { return true }
func (f *fakeBlob) Upload(_ context.Context, key string, _ io.Reader, _ string, _ int64) (string, error) {
func (f *fakeBlob) Upload(_ context.Context, obj blob.Object) (string, error) {
f.calls++
f.last = key
return "https://cdn.example.com/" + key, nil
f.last = obj.Key
return "https://cdn.example.com/" + obj.Key, nil
}
func TestProfilePageAndState(t *testing.T) {