Skip to main content

NewUploader

No overview available.

def NewUploader(
_: context.Context,
store: *storage.DataStore,
format: core.DataLoadingConfig_LiteralMapFormat,
mode: core.IOStrategy_UploadMode,
errorFileName: string
) - > Uploader

Creates and returns a new Uploader instance, configured with the specified data format, storage, upload mode, and error file name. This function initializes the necessary components for handling data uploads according to the provided settings.

Parameters

NameTypeDescription
_context.ContextThe context for the operation, typically used for cancellation or deadlines. It is currently unused in the function's implementation.
store*storage.DataStoreThe data store where the uploaded data will be persisted. This defines the storage backend for the uploader.
formatcore.DataLoadingConfig_LiteralMapFormatThe format of the data to be uploaded, such as CSV, JSON, or XML. This dictates how the uploader will parse the incoming data.
modecore.IOStrategy_UploadModeThe upload mode, specifying how the data should be handled during the upload process (e.g., overwrite, append, upsert). This controls the uploader's behavior when encountering existing data.
errorFileNamestringThe name of the file where any errors encountered during the upload process will be logged or stored. This helps in debugging and monitoring upload failures.

Returns

TypeDescription
UploaderA new Uploader instance configured with the provided parameters.