Documentation
¶
Index ¶
- func FormatSize(size int64) string
- func RegisterFile(ctx context.Context, bk UploadBackend, dc MetadataClient, ...) (*drsapi.DrsObject, error)
- func Upload(ctx context.Context, bk transfer.MultipartBackend, ...) error
- func UploadSingle(ctx context.Context, bk transfer.Uploader, logger transfer.TransferLogger, ...) error
- func UploadWithOptions(ctx context.Context, bk transfer.MultipartBackend, ...) error
- type MetadataClient
- type RenamedOrSkippedFileInfo
- type UploadBackend
- type UploadConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
FormatSize helps to parse a int64 size into string
func RegisterFile ¶
func RegisterFile(ctx context.Context, bk UploadBackend, dc MetadataClient, drsObject *drsapi.DrsObject, filePath string, bucketName string) (*drsapi.DrsObject, error)
RegisterFile orchestrates the full registration and upload flow: 1. Build a DRS object from the local file (if not provided). 2. Register metadata with the DRS server via the provided drs.Client. 3. Upload the file content via the provided Backend.
func Upload ¶
func Upload(ctx context.Context, bk transfer.MultipartBackend, sourcePath, objectKey, guid, bucket string, metadata common.FileMetadata, showProgress bool, forceMultipart bool) error
Upload is now a thin wrapper around the generic EngineUploader.
func UploadSingle ¶
func UploadSingle(ctx context.Context, bk transfer.Uploader, logger transfer.TransferLogger, sourcePath, objectKey, guid, bucket string, metadata common.FileMetadata, showProgress bool) error
UploadSingle is a compatibility shim that preserves the old entrypoint while routing the actual byte transfer through the shared engine uploader.
func UploadWithOptions ¶
func UploadWithOptions(ctx context.Context, bk transfer.MultipartBackend, sourcePath, objectKey, guid, bucket string, metadata common.FileMetadata, showProgress bool, forceMultipart bool) error
Types ¶
type MetadataClient ¶
type MetadataClient interface {
GetObject(ctx context.Context, objectID string) (drsapi.DrsObject, error)
RegisterObjects(ctx context.Context, req drsapi.RegisterObjectsJSONRequestBody) (drsapi.N201ObjectsCreated, error)
UpdateObjectAccessMethods(ctx context.Context, objectID string, accessMethods []drsapi.AccessMethod) (drsapi.DrsObject, error)
}
type RenamedOrSkippedFileInfo ¶
RenamedOrSkippedFileInfo is a helper struct for recording renamed or skipped files
type UploadBackend ¶
type UploadBackend interface {
transfer.Uploader
transfer.MultipartBackend
}
Click to show internal directories.
Click to hide internal directories.