Documentation
¶
Index ¶
- func RegisterFile(ctx context.Context, bk UploadBackend, dc MetadataClient, ...) (*drsapi.DrsObject, error)
- func ReplaceFile(ctx context.Context, bk UploadBackend, dc MetadataClient, ...) (*drsapi.DrsObject, error)
- func Upload(ctx context.Context, backend transfer.MultipartBackend, ...) error
- type MetadataClient
- type UploadBackend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFile ¶
func RegisterFile(ctx context.Context, bk UploadBackend, dc MetadataClient, drsObject *drsapi.DrsObject, filePath, bucketName string, canonicalLocation ...string) (*drsapi.DrsObject, error)
RegisterFile uploads filePath and registers drsObject with the DRS server. canonicalLocation overrides URL resolution from the uploaded location.
func ReplaceFile ¶ added in v0.3.9
func ReplaceFile(ctx context.Context, bk UploadBackend, dc MetadataClient, drsObject *drsapi.DrsObject, filePath, bucketName, expectedOldSHA string, canonicalLocation ...string) (*drsapi.DrsObject, error)
ReplaceFile uploads bytes first, then atomically replaces the existing DID only if its checksum still matches the preflight value.
func Upload ¶
func Upload(ctx context.Context, backend transfer.MultipartBackend, sourcePath, objectKey, guid, bucket string, metadata common.FileMetadata, _ bool, forceMultipart bool) error
Upload forwards an upload to the transfer engine. Deprecated: use engine.GenericUploader.Upload with a transfer.TransferRequest. The unused boolean remains for compatibility with published client versions.
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)
ReplaceObject(ctx context.Context, objectID, expectedOldSHA string, candidate drsapi.DrsObjectCandidate) (drsapi.DrsObject, error)
UpdateObjectAccessMethods(ctx context.Context, objectID string, accessMethods []drsapi.AccessMethod) (drsapi.DrsObject, error)
}
type UploadBackend ¶
Click to show internal directories.
Click to hide internal directories.