function
WithUploadStorage
Provide object storage through the Execute lifecycle.
Example
ridu.WithUploadStorage(func(context.Context) (storage.Backend, error) {
return s3.New(s3.Config{
Region: os.Getenv("S3_REGION"),
Bucket: os.Getenv("S3_BUCKET"),
})
})Arguments
| Argument | Type | Description |
|---|---|---|
factory | StorageFactory | A lazy object-storage constructor invoked during server startup. |
Returns
An option to pass directly to ridu.Execute.
ExecuteOptionHow it works
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.
Full signature
func WithUploadStorage(factory StorageFactory) ExecuteOptionRelated types
StorageFactoryA lazy, lifecycle-owned object-storage constructor.
ExecuteOptionOne opaque runtime option accepted by Execute.