Have got uploads working
This commit is contained in:
parent
97112d99dd
commit
6b697e008f
20 changed files with 751 additions and 7 deletions
|
|
@ -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
23
models/uploads.go
Normal 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"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue