method

App.Upload

Validate, store, and create an upload document atomically.

Arguments

ArgumentTypeDescription
ctxcontext.ContextThe ctx value.
collectionstringThe collection value.
inputUploadInputThe input value.

Returns

The declared result.

(store.Document, error)

How it works

Staged objects are rolled back if the document transaction fails. Storage keys are namespaced and opaque.

Full signature

func (application *App) Upload( ctx context.Context, collection string, input UploadInput, ) (store.Document, error)

Source core/uploads.go:168

Related types

  • App

    A resolved application bound to operation services.

  • UploadInput

    File bytes and application-owned metadata for one upload.

  • Document

    A stored document with status and version metadata.