Have got uploads working

This commit is contained in:
Leon Mika 2026-03-02 20:48:41 +11:00
parent 97112d99dd
commit 6b697e008f
20 changed files with 751 additions and 7 deletions

View file

@ -6,7 +6,7 @@ type userKeyType struct{}
type siteKeyType struct{}
var userKey = userKeyType{}
var siteKey = userKeyType{}
var siteKey = siteKeyType{}
func WithUser(ctx context.Context, user User) context.Context {
return context.WithValue(ctx, userKey, user)

23
models/uploads.go Normal file
View file

@ -0,0 +1,23 @@
package models
import "time"
type Upload struct {
ID int64 `json:"id"`
SiteID int64 `json:"site_id"`
GUID string `json:"guid"`
MIMEType string `json:"mime_type"`
Filename string `json:"filename"`
CreatedAt int64 `json:"created_at"`
Alt string `json:"alt"`
}
type PendingUpload struct {
GUID string `json:"guid"`
SiteID int64 `json:"site_id"`
UserID int64 `json:"user_id"`
FileSize int64 `json:"file_size"`
Filename string `json:"filename"`
MIMEType string `json:"mime_type"`
UploadStarted time.Time `json:"upload_started"`
}