MCPcopy
hub / github.com/rclone/rclone / PutUnchecked

Method PutUnchecked

backend/crypt/crypt.go:718–732  ·  view source on GitHub ↗

PutUnchecked uploads the object This will create a duplicate if we upload a new file without checking to see if there is one already - use Put() for that.

(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption)

Source from the content-addressed store, hash-verified

716// This will create a duplicate if we upload a new file without
717// checking to see if there is one already - use Put() for that.
718func (f *Fs) PutUnchecked(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error) {
719 do := f.Fs.Features().PutUnchecked
720 if do == nil {
721 return nil, errors.New("can't PutUnchecked")
722 }
723 wrappedIn, encrypter, err := f.cipher.encryptData(in)
724 if err != nil {
725 return nil, err
726 }
727 o, err := do(ctx, wrappedIn, f.newObjectInfo(src, encrypter.nonce))
728 if err != nil {
729 return nil, err
730 }
731 return f.newObject(o), nil
732}
733
734// CleanUp the trash in the Fs
735//

Callers

nothing calls this directly

Calls 4

newObjectInfoMethod · 0.95
newObjectMethod · 0.95
encryptDataMethod · 0.80
FeaturesMethod · 0.65

Tested by

no test coverage detected