function
WithUploadStorage
func WithUploadStorage(factory StorageFactory) ExecuteOptionProvide object storage through the Execute lifecycle.
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
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
StorageFactoryA lazy, lifecycle-owned object-storage constructor.
ExecuteOptionOne opaque runtime option accepted by Execute.