function

WithUploadStorage

Provide object storage through the Execute lifecycle.

Source ridu.go:245

@param factory
A lazy object-storage constructor invoked during server startup.
@returns
An option to pass directly to ridu.Execute.

The factory runs only in the server branch. It supplies Config.Storage before application construction, keeping credentials and network setup out of the resolved schema manifest.

Upload-enabled config still needs a stable Config.StorageNamespace and a document store with the upload capability contracts. Closable object storage shuts down before the document store.

Example

go
ridu.WithUploadStorage(func(context.Context) (storage.Backend, error) {
  return s3.New(s3.Config{
    Region: os.Getenv("S3_REGION"),
    Bucket: os.Getenv("S3_BUCKET"),
  })
})

Related types