function

WithUploadStorage

Provide object storage through the Execute lifecycle.

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"),
  })
})

Arguments

ArgumentTypeDescription
factoryStorageFactoryA lazy object-storage constructor invoked during server startup.

Returns

An option to pass directly to ridu.Execute.

ExecuteOption

How 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

Related types