Rename Object to FileUpload; use native Postgres $n placeholders.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user