Rename Object to FileUpload; use native Postgres $n placeholders.

This commit is contained in:
2026-08-21 23:53:00 -07:00
parent a36bc723cc
commit a249965fc1
6 changed files with 41 additions and 71 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ func (s *Server) handleProfile(w http.ResponseWriter, r *http.Request) {
}
key := path.Join("avatars", u.ID, uuid.NewString()+ext)
limited := io.LimitReader(file, (2<<20)+1)
url, upErr := s.cfg.Blob.Upload(r.Context(), blob.Object{
url, upErr := s.cfg.Blob.Upload(r.Context(), blob.FileUpload{
Key: key,
Body: limited,
ContentType: contentType,
+1 -1
View File
@@ -296,7 +296,7 @@ type fakeBlob struct {
func (f *fakeBlob) Enabled() bool { return true }
func (f *fakeBlob) Upload(_ context.Context, obj blob.Object) (string, error) {
func (f *fakeBlob) Upload(_ context.Context, obj blob.FileUpload) (string, error) {
f.calls++
f.last = obj.Key
return "https://cdn.example.com/" + obj.Key, nil