type
UploadInput
File bytes and application-owned metadata for one upload.
Properties
| Property | Type | Description |
|---|---|---|
Filename | string | Original client-supplied file name. |
Reader | io.Reader | Stream providing the uploaded bytes. |
Image | *UploadImageEdit | Image stages a crop and focal point with the document mutation. |
Draft | *bool | Draft selects working (true) or published (false) content on creation. |
Data | store.Values | Application-owned fields for the upload document. |
Actor | *store.Document | Authenticated actor evaluated by access rules. |
ActorCollection | schema.CollectionSlug | Exact auth collection that owns Actor. |
Locale | LocaleOptions | Content locale for application-owned upload metadata. |
How it works
Bytes, metadata, access, validation, hooks, storage, and document persistence run through one upload operation. The caller retains ownership of Reader.
Full signature
type UploadInput struct {
// Filename is the original client-supplied file name.
Filename string
// Reader provides the uploaded bytes.
Reader io.Reader
// Image stages a crop and focal point with the document mutation.
Image *UploadImageEdit
// Draft selects working (true) or published (false) content on creation.
Draft *bool
// Data contains application-owned upload document fields.
Data store.Values
// Actor is the authenticated document used by access rules.
Actor *store.Document
// ActorCollection identifies the exact auth collection that owns Actor.
ActorCollection schema.CollectionSlug
// Locale selects the content locale for application-owned upload metadata.
Locale LocaleOptions
}