mirror of
https://github.com/rclone/rclone.git
synced 2025-02-06 21:51:02 +01:00
doc: fix typos throughout docs and code
This commit is contained in:
parent
9db8ecbc32
commit
041b201abd
@ -33,7 +33,7 @@ Rclone uses the labels like this:
|
|||||||
* `duplicate` - normally close these and ask the user to subscribe to the original
|
* `duplicate` - normally close these and ask the user to subscribe to the original
|
||||||
* `enhancement: new remote` - a new rclone backend
|
* `enhancement: new remote` - a new rclone backend
|
||||||
* `enhancement` - a new feature
|
* `enhancement` - a new feature
|
||||||
* `FUSE` - do do with `rclone mount` command
|
* `FUSE` - to do with `rclone mount` command
|
||||||
* `good first issue` - mark these if you find a small self contained issue - these get shown to new visitors to the project
|
* `good first issue` - mark these if you find a small self contained issue - these get shown to new visitors to the project
|
||||||
* `help` wanted - mark these if you find a self contained issue - these get shown to new visitors to the project
|
* `help` wanted - mark these if you find a self contained issue - these get shown to new visitors to the project
|
||||||
* `IMPORTANT` - note to maintainers not to forget to fix this for the release
|
* `IMPORTANT` - note to maintainers not to forget to fix this for the release
|
||||||
|
@ -1455,7 +1455,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
|||||||
httpHeaders.ContentType = fs.MimeType(ctx, o)
|
httpHeaders.ContentType = fs.MimeType(ctx, o)
|
||||||
// Compute the Content-MD5 of the file, for multiparts uploads it
|
// Compute the Content-MD5 of the file, for multiparts uploads it
|
||||||
// will be set in PutBlockList API call using the 'x-ms-blob-content-md5' header
|
// will be set in PutBlockList API call using the 'x-ms-blob-content-md5' header
|
||||||
// Note: If multipart, a MD5 checksum will also be computed for each uploaded block
|
// Note: If multipart, an MD5 checksum will also be computed for each uploaded block
|
||||||
// in order to validate its integrity during transport
|
// in order to validate its integrity during transport
|
||||||
if !o.fs.opt.DisableCheckSum {
|
if !o.fs.opt.DisableCheckSum {
|
||||||
if sourceMD5, _ := src.Hash(ctx, hash.MD5); sourceMD5 != "" {
|
if sourceMD5, _ := src.Hash(ctx, hash.MD5); sourceMD5 != "" {
|
||||||
|
4
backend/cache/cache.go
vendored
4
backend/cache/cache.go
vendored
@ -87,7 +87,7 @@ func init() {
|
|||||||
Advanced: true,
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
Name: "plex_insecure",
|
Name: "plex_insecure",
|
||||||
Help: "Skip all certificate verifications when connecting to the Plex server",
|
Help: "Skip all certificate verification when connecting to the Plex server",
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
}, {
|
}, {
|
||||||
Name: "chunk_size",
|
Name: "chunk_size",
|
||||||
@ -339,7 +339,7 @@ func parseRootPath(path string) (string, error) {
|
|||||||
return strings.Trim(path, "/"), nil
|
return strings.Trim(path, "/"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFs constructs a Fs from the path, container:path
|
// NewFs constructs an Fs from the path, container:path
|
||||||
func NewFs(name, rootPath string, m configmap.Mapper) (fs.Fs, error) {
|
func NewFs(name, rootPath string, m configmap.Mapper) (fs.Fs, error) {
|
||||||
// Parse config into Options struct
|
// Parse config into Options struct
|
||||||
opt := new(Options)
|
opt := new(Options)
|
||||||
|
@ -559,7 +559,7 @@ func (n *nonce) increment() {
|
|||||||
n.carry(0)
|
n.carry(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// add an uint64 to the nonce
|
// add a uint64 to the nonce
|
||||||
func (n *nonce) add(x uint64) {
|
func (n *nonce) add(x uint64) {
|
||||||
carry := uint16(0)
|
carry := uint16(0)
|
||||||
for i := 0; i < 8; i++ {
|
for i := 0; i < 8; i++ {
|
||||||
|
@ -263,7 +263,7 @@ videos.
|
|||||||
Setting this flag will cause Google photos and videos to return a
|
Setting this flag will cause Google photos and videos to return a
|
||||||
blank MD5 checksum.
|
blank MD5 checksum.
|
||||||
|
|
||||||
Google photos are identifed by being in the "photos" space.
|
Google photos are identified by being in the "photos" space.
|
||||||
|
|
||||||
Corrupted checksums are caused by Google modifying the image/video but
|
Corrupted checksums are caused by Google modifying the image/video but
|
||||||
not updating the checksum.`,
|
not updating the checksum.`,
|
||||||
@ -2074,7 +2074,7 @@ func (f *Fs) MergeDirs(ctx context.Context, dirs []fs.Directory) error {
|
|||||||
}
|
}
|
||||||
dstDir := dirs[0]
|
dstDir := dirs[0]
|
||||||
for _, srcDir := range dirs[1:] {
|
for _, srcDir := range dirs[1:] {
|
||||||
// list the the objects
|
// list the objects
|
||||||
infos := []*drive.File{}
|
infos := []*drive.File{}
|
||||||
_, err := f.list(ctx, []string{srcDir.ID()}, "", false, false, true, func(info *drive.File) bool {
|
_, err := f.list(ctx, []string{srcDir.ID()}, "", false, false, true, func(info *drive.File) bool {
|
||||||
infos = append(infos, info)
|
infos = append(infos, info)
|
||||||
|
@ -298,7 +298,7 @@ func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
|
|||||||
|
|
||||||
// Put in to the remote path with the modTime given of the given size
|
// Put in to the remote path with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
||||||
// return an error or upload it properly (rather than e.g. calling panic).
|
// return an error or upload it properly (rather than e.g. calling panic).
|
||||||
//
|
//
|
||||||
|
@ -101,7 +101,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadClo
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
||||||
|
@ -1210,7 +1210,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read
|
|||||||
// The cleanup function should be called when out is finished with
|
// The cleanup function should be called when out is finished with
|
||||||
// regardless of whether this function returned an error or not.
|
// regardless of whether this function returned an error or not.
|
||||||
func readMD5(in io.Reader, size, threshold int64) (md5sum string, out io.Reader, cleanup func(), err error) {
|
func readMD5(in io.Reader, size, threshold int64) (md5sum string, out io.Reader, cleanup func(), err error) {
|
||||||
// we need a MD5
|
// we need an MD5
|
||||||
md5Hasher := md5.New()
|
md5Hasher := md5.New()
|
||||||
// use the teeReader to write to the local file AND calculate the MD5 while doing so
|
// use the teeReader to write to the local file AND calculate the MD5 while doing so
|
||||||
teeReader := io.TeeReader(in, md5Hasher)
|
teeReader := io.TeeReader(in, md5Hasher)
|
||||||
|
@ -79,7 +79,7 @@ type Options struct {
|
|||||||
Enc encoder.MultiEncoder `config:"encoding"`
|
Enc encoder.MultiEncoder `config:"encoding"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Fs is a representation of a remote Koofr Fs
|
// An Fs is a representation of a remote Koofr Fs
|
||||||
type Fs struct {
|
type Fs struct {
|
||||||
name string
|
name string
|
||||||
mountID string
|
mountID string
|
||||||
@ -250,7 +250,7 @@ func (f *Fs) Hashes() hash.Set {
|
|||||||
return hash.Set(hash.MD5)
|
return hash.Set(hash.MD5)
|
||||||
}
|
}
|
||||||
|
|
||||||
// fullPath constructs a full, absolute path from a Fs root relative path,
|
// fullPath constructs a full, absolute path from an Fs root relative path,
|
||||||
func (f *Fs) fullPath(part string) string {
|
func (f *Fs) fullPath(part string) string {
|
||||||
return f.opt.Enc.FromStandardPath(path.Join("/", f.root, part))
|
return f.opt.Enc.FromStandardPath(path.Join("/", f.root, part))
|
||||||
}
|
}
|
||||||
|
@ -1164,7 +1164,7 @@ func (o *Object) setMetadata(info os.FileInfo) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stat a Object into info
|
// Stat an Object into info
|
||||||
func (o *Object) lstat() error {
|
func (o *Object) lstat() error {
|
||||||
info, err := o.fs.lstat(o.path)
|
info, err := o.fs.lstat(o.path)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -871,7 +871,7 @@ func (f *Fs) MergeDirs(ctx context.Context, dirs []fs.Directory) error {
|
|||||||
return errors.Errorf("MergeDirs failed to find node for: %v", srcDir)
|
return errors.Errorf("MergeDirs failed to find node for: %v", srcDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// list the the objects
|
// list the objects
|
||||||
infos := []*mega.Node{}
|
infos := []*mega.Node{}
|
||||||
_, err := f.list(ctx, srcDirNode, func(info *mega.Node) bool {
|
_, err := f.list(ctx, srcDirNode, func(info *mega.Node) bool {
|
||||||
infos = append(infos, info)
|
infos = append(infos, info)
|
||||||
|
@ -63,7 +63,7 @@ func init() {
|
|||||||
// ? (question mark) -> '?' // FULLWIDTH QUESTION MARK
|
// ? (question mark) -> '?' // FULLWIDTH QUESTION MARK
|
||||||
// * (asterisk) -> '*' // FULLWIDTH ASTERISK
|
// * (asterisk) -> '*' // FULLWIDTH ASTERISK
|
||||||
//
|
//
|
||||||
// Additionally names can't begin or end with a ASCII whitespace.
|
// Additionally names can't begin or end with an ASCII whitespace.
|
||||||
// List of replaced characters:
|
// List of replaced characters:
|
||||||
// (space) -> '␠' // SYMBOL FOR SPACE
|
// (space) -> '␠' // SYMBOL FOR SPACE
|
||||||
// (horizontal tab) -> '␉' // SYMBOL FOR HORIZONTAL TABULATION
|
// (horizontal tab) -> '␉' // SYMBOL FOR HORIZONTAL TABULATION
|
||||||
|
@ -255,7 +255,7 @@ func (mu *multiUploader) readChunk(ch chan chunk) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// initiate init an Multiple Object and obtain UploadID
|
// initiate init a Multiple Object and obtain UploadID
|
||||||
func (mu *multiUploader) initiate() error {
|
func (mu *multiUploader) initiate() error {
|
||||||
bucketInit, _ := mu.bucketInit()
|
bucketInit, _ := mu.bucketInit()
|
||||||
req := qs.InitiateMultipartUploadInput{
|
req := qs.InitiateMultipartUploadInput{
|
||||||
|
@ -85,7 +85,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadClo
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
||||||
|
@ -528,7 +528,7 @@ func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
|
|||||||
|
|
||||||
// Put in to the remote path with the modTime given of the given size
|
// Put in to the remote path with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
||||||
// return an error or upload it properly (rather than e.g. calling panic).
|
// return an error or upload it properly (rather than e.g. calling panic).
|
||||||
//
|
//
|
||||||
|
@ -35,7 +35,7 @@ func (f *Fs) getAuthorizationToken(ctx context.Context) (string, error) {
|
|||||||
return getAuthorizationToken(ctx, f.srv, f.opt.User, f.opt.Password, "")
|
return getAuthorizationToken(ctx, f.srv, f.opt.User, f.opt.Password, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
// getAuthorizationToken can be called outside of a fs (during configuration of the remote to get the authentication token)
|
// getAuthorizationToken can be called outside of an fs (during configuration of the remote to get the authentication token)
|
||||||
// it's doing a single call (no pacer involved)
|
// it's doing a single call (no pacer involved)
|
||||||
func getAuthorizationToken(ctx context.Context, srv *rest.Client, user, password, oneTimeCode string) (string, error) {
|
func getAuthorizationToken(ctx context.Context, srv *rest.Client, user, password, oneTimeCode string) (string, error) {
|
||||||
// API Documentation
|
// API Documentation
|
||||||
|
@ -94,7 +94,7 @@ when the ssh-agent contains many keys.`,
|
|||||||
Name: "use_insecure_cipher",
|
Name: "use_insecure_cipher",
|
||||||
Help: `Enable the use of insecure ciphers and key exchange methods.
|
Help: `Enable the use of insecure ciphers and key exchange methods.
|
||||||
|
|
||||||
This enables the use of the the following insecure ciphers and key exchange methods:
|
This enables the use of the following insecure ciphers and key exchange methods:
|
||||||
|
|
||||||
- aes128-cbc
|
- aes128-cbc
|
||||||
- aes192-cbc
|
- aes192-cbc
|
||||||
|
@ -230,7 +230,7 @@ func (f *Fs) Features() *fs.Features {
|
|||||||
return f.features
|
return f.features
|
||||||
}
|
}
|
||||||
|
|
||||||
// parsePath parses an sugarsync 'url'
|
// parsePath parses a sugarsync 'url'
|
||||||
func parsePath(path string) (root string) {
|
func parsePath(path string) (root string) {
|
||||||
root = strings.Trim(path, "/")
|
root = strings.Trim(path, "/")
|
||||||
return
|
return
|
||||||
|
@ -518,7 +518,7 @@ func (f *Fs) NewObject(ctx context.Context, relative string) (_ fs.Object, err e
|
|||||||
|
|
||||||
// Put in to the remote path with the modTime given of the given size
|
// Put in to the remote path with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Put should
|
// But for unknown-sized objects (indicated by src.Size() == -1), Put should
|
||||||
// either return an error or upload it properly (rather than e.g. calling
|
// either return an error or upload it properly (rather than e.g. calling
|
||||||
// panic).
|
// panic).
|
||||||
|
@ -177,7 +177,7 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (_ io.ReadC
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) {
|
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (err error) {
|
||||||
|
@ -55,7 +55,7 @@ func (d *Directory) candidates() []upstream.Entry {
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
||||||
|
@ -80,7 +80,7 @@ type Fs struct {
|
|||||||
searchPolicy policy.Policy // policy for SEARCH
|
searchPolicy policy.Policy // policy for SEARCH
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrap candidate objects in to an union Object
|
// Wrap candidate objects in to a union Object
|
||||||
func (f *Fs) wrapEntries(entries ...upstream.Entry) (entry, error) {
|
func (f *Fs) wrapEntries(entries ...upstream.Entry) (entry, error) {
|
||||||
e, err := f.searchEntries(entries...)
|
e, err := f.searchEntries(entries...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -219,7 +219,7 @@ func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, opt
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error {
|
||||||
|
@ -155,7 +155,7 @@ func (e *Error) Error() string {
|
|||||||
return strings.Join(out, ": ")
|
return strings.Join(out, ": ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Time represents represents date and time information for the
|
// Time represents date and time information for the
|
||||||
// webdav API marshalling to and from timeFormat
|
// webdav API marshalling to and from timeFormat
|
||||||
type Time time.Time
|
type Time time.Time
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ func gitDiffDiff(rev1, rev2 string) {
|
|||||||
if errors.As(err, &exitErr) && exitErr.ExitCode() == 1 {
|
if errors.As(err, &exitErr) && exitErr.ExitCode() == 1 {
|
||||||
// OK just different
|
// OK just different
|
||||||
} else {
|
} else {
|
||||||
log.Fatalf("git diff diff failed: %#v", err)
|
log.Fatalf("git diff failed: %#v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_, _ = os.Stdout.Write(out)
|
_, _ = os.Stdout.Write(out)
|
||||||
|
@ -140,7 +140,7 @@ func showHelp(fsInfo *fs.RegInfo) error {
|
|||||||
fmt.Printf("### Backend commands\n\n")
|
fmt.Printf("### Backend commands\n\n")
|
||||||
fmt.Printf(`Here are the commands specific to the %s backend.
|
fmt.Printf(`Here are the commands specific to the %s backend.
|
||||||
|
|
||||||
Run them with with
|
Run them with
|
||||||
|
|
||||||
rclone backend COMMAND remote:
|
rclone backend COMMAND remote:
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ func ShowVersion() {
|
|||||||
fmt.Printf("- go version: %s\n", runtime.Version())
|
fmt.Printf("- go version: %s\n", runtime.Version())
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewFsFile creates a Fs from a name but may point to a file.
|
// NewFsFile creates an Fs from a name but may point to a file.
|
||||||
//
|
//
|
||||||
// It returns a string with the file name if points to a file
|
// It returns a string with the file name if points to a file
|
||||||
// otherwise "".
|
// otherwise "".
|
||||||
@ -99,7 +99,7 @@ func NewFsFile(remote string) (fs.Fs, string) {
|
|||||||
return nil, ""
|
return nil, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// newFsFileAddFilter creates a src Fs from a name
|
// newFsFileAddFilter creates an src Fs from a name
|
||||||
//
|
//
|
||||||
// This works the same as NewFsFile however it adds filters to the Fs
|
// This works the same as NewFsFile however it adds filters to the Fs
|
||||||
// to limit it to a single file if the remote pointed to a file.
|
// to limit it to a single file if the remote pointed to a file.
|
||||||
|
@ -120,7 +120,7 @@ var configCreateCommand = &cobra.Command{
|
|||||||
Short: `Create a new remote with name, type and options.`,
|
Short: `Create a new remote with name, type and options.`,
|
||||||
Long: `
|
Long: `
|
||||||
Create a new remote of <name> with <type> and options. The options
|
Create a new remote of <name> with <type> and options. The options
|
||||||
should be passed in in pairs of <key> <value>.
|
should be passed in pairs of <key> <value>.
|
||||||
|
|
||||||
For example to make a swift remote of name myremote using auto config
|
For example to make a swift remote of name myremote using auto config
|
||||||
you would do:
|
you would do:
|
||||||
@ -204,7 +204,7 @@ var configPasswordCommand = &cobra.Command{
|
|||||||
Short: `Update password in an existing remote.`,
|
Short: `Update password in an existing remote.`,
|
||||||
Long: `
|
Long: `
|
||||||
Update an existing remote's password. The password
|
Update an existing remote's password. The password
|
||||||
should be passed in in pairs of <key> <value>.
|
should be passed in pairs of <key> <value>.
|
||||||
|
|
||||||
For example to set password of a remote of name myremote you would do:
|
For example to set password of a remote of name myremote you would do:
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ be copied to the vfs cache before opening with --vfs-cache-mode full.
|
|||||||
return commandDefinition
|
return commandDefinition
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClipBlocks clips the blocks pointed to to the OS max
|
// ClipBlocks clips the blocks pointed to the OS max
|
||||||
func ClipBlocks(b *uint64) {
|
func ClipBlocks(b *uint64) {
|
||||||
var max uint64
|
var max uint64
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
|
@ -513,7 +513,7 @@ investigate further with the `--dump-bodies` flag.
|
|||||||
This may also be caused by specifying the region when you shouldn't
|
This may also be caused by specifying the region when you shouldn't
|
||||||
have (eg OVH).
|
have (eg OVH).
|
||||||
|
|
||||||
#### Rclone gives Failed to create file system: Response didn't have storage storage url and auth token ####
|
#### Rclone gives Failed to create file system: Response didn't have storage url and auth token ####
|
||||||
|
|
||||||
This is most likely caused by forgetting to specify your tenant when
|
This is most likely caused by forgetting to specify your tenant when
|
||||||
setting up a swift remote.
|
setting up a swift remote.
|
||||||
|
@ -58,7 +58,7 @@ type accountValues struct {
|
|||||||
|
|
||||||
const averagePeriod = 16 // period to do exponentially weighted averages over
|
const averagePeriod = 16 // period to do exponentially weighted averages over
|
||||||
|
|
||||||
// newAccountSizeName makes a Account reader for an io.ReadCloser of
|
// newAccountSizeName makes an Account reader for an io.ReadCloser of
|
||||||
// the given size and name
|
// the given size and name
|
||||||
func newAccountSizeName(stats *StatsInfo, in io.ReadCloser, size int64, name string) *Account {
|
func newAccountSizeName(stats *StatsInfo, in io.ReadCloser, size int64, name string) *Account {
|
||||||
acc := &Account{
|
acc := &Account{
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
ErrorInvalidSeek = errors.New("invalid seek position")
|
ErrorInvalidSeek = errors.New("invalid seek position")
|
||||||
)
|
)
|
||||||
|
|
||||||
// ChunkedReader is a reader for a Object with the possibility
|
// ChunkedReader is a reader for an Object with the possibility
|
||||||
// of reading the source in chunks of given size
|
// of reading the source in chunks of given size
|
||||||
//
|
//
|
||||||
// An initialChunkSize of <= 0 will disable chunked reading.
|
// An initialChunkSize of <= 0 will disable chunked reading.
|
||||||
|
8
fs/fs.go
8
fs/fs.go
@ -82,7 +82,7 @@ type RegInfo struct {
|
|||||||
// Prefix for command line flags for this fs - defaults to Name if not set
|
// Prefix for command line flags for this fs - defaults to Name if not set
|
||||||
Prefix string
|
Prefix string
|
||||||
// Create a new file system. If root refers to an existing
|
// Create a new file system. If root refers to an existing
|
||||||
// object, then it should return a Fs which which points to
|
// object, then it should return an Fs which which points to
|
||||||
// the parent of that object and ErrorIsFile.
|
// the parent of that object and ErrorIsFile.
|
||||||
NewFs func(name string, root string, config configmap.Mapper) (Fs, error) `json:"-"`
|
NewFs func(name string, root string, config configmap.Mapper) (Fs, error) `json:"-"`
|
||||||
// Function to call to help with config
|
// Function to call to help with config
|
||||||
@ -191,7 +191,7 @@ func (o *Option) String() string {
|
|||||||
return fmt.Sprint(o.GetValue())
|
return fmt.Sprint(o.GetValue())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a Option from a string
|
// Set an Option from a string
|
||||||
func (o *Option) Set(s string) (err error) {
|
func (o *Option) Set(s string) (err error) {
|
||||||
newValue, err := configstruct.StringToInterface(o.GetValue(), s)
|
newValue, err := configstruct.StringToInterface(o.GetValue(), s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -274,7 +274,7 @@ type Fs interface {
|
|||||||
|
|
||||||
// Put in to the remote path with the modTime given of the given size
|
// Put in to the remote path with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Put should either
|
||||||
// return an error or upload it properly (rather than e.g. calling panic).
|
// return an error or upload it properly (rather than e.g. calling panic).
|
||||||
//
|
//
|
||||||
@ -327,7 +327,7 @@ type Object interface {
|
|||||||
|
|
||||||
// Update in to the object with the modTime given of the given size
|
// Update in to the object with the modTime given of the given size
|
||||||
//
|
//
|
||||||
// When called from outside a Fs by rclone, src.Size() will always be >= 0.
|
// When called from outside an Fs by rclone, src.Size() will always be >= 0.
|
||||||
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
// But for unknown-sized objects (indicated by src.Size() == -1), Upload should either
|
||||||
// return an error or update the object properly (rather than e.g. calling panic).
|
// return an error or update the object properly (rather than e.g. calling panic).
|
||||||
Update(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) error
|
Update(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) error
|
||||||
|
@ -748,7 +748,7 @@ func checkIdentical(ctx context.Context, dst, src fs.Object) (differ bool, noHas
|
|||||||
return false, false
|
return false, false
|
||||||
}
|
}
|
||||||
|
|
||||||
// checkFn is the the type of the checking function used in CheckFn()
|
// checkFn is the type of the checking function used in CheckFn()
|
||||||
type checkFn func(ctx context.Context, a, b fs.Object) (differ bool, noHash bool)
|
type checkFn func(ctx context.Context, a, b fs.Object) (differ bool, noHash bool)
|
||||||
|
|
||||||
// checkMarch is used to march over two Fses in the same way as
|
// checkMarch is used to march over two Fses in the same way as
|
||||||
@ -1080,7 +1080,7 @@ func hashSum(ctx context.Context, ht hash.Type, o fs.Object) (string, error) {
|
|||||||
return sum, err
|
return sum, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashLister does a md5sum equivalent for the hash type passed in
|
// HashLister does an md5sum equivalent for the hash type passed in
|
||||||
func HashLister(ctx context.Context, ht hash.Type, f fs.Fs, w io.Writer) error {
|
func HashLister(ctx context.Context, ht hash.Type, f fs.Fs, w io.Writer) error {
|
||||||
return ListFn(ctx, f, func(o fs.Object) {
|
return ListFn(ctx, f, func(o fs.Object) {
|
||||||
sum, _ := hashSum(ctx, ht, o)
|
sum, _ := hashSum(ctx, ht, o)
|
||||||
@ -1088,7 +1088,7 @@ func HashLister(ctx context.Context, ht hash.Type, f fs.Fs, w io.Writer) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// HashListerBase64 does a md5sum equivalent for the hash type passed in with base64 encoded
|
// HashListerBase64 does an md5sum equivalent for the hash type passed in with base64 encoded
|
||||||
func HashListerBase64(ctx context.Context, ht hash.Type, f fs.Fs, w io.Writer) error {
|
func HashListerBase64(ctx context.Context, ht hash.Type, f fs.Fs, w io.Writer) error {
|
||||||
return ListFn(ctx, f, func(o fs.Object) {
|
return ListFn(ctx, f, func(o fs.Object) {
|
||||||
sum, err := hashSum(ctx, ht, o)
|
sum, err := hashSum(ctx, ht, o)
|
||||||
|
@ -103,7 +103,7 @@ func (p Params) GetString(key string) (string, error) {
|
|||||||
return str, nil
|
return str, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetInt64 gets a int64 parameter from the input
|
// GetInt64 gets an int64 parameter from the input
|
||||||
//
|
//
|
||||||
// If the parameter isn't found then error will be of type
|
// If the parameter isn't found then error will be of type
|
||||||
// ErrParamNotFound and the returned value will be 0.
|
// ErrParamNotFound and the returned value will be 0.
|
||||||
|
@ -732,7 +732,7 @@ func (s *syncCopyMove) makeRenameMap() {
|
|||||||
fs.Infof(s.fdst, "Finished making map for --track-renames")
|
fs.Infof(s.fdst, "Finished making map for --track-renames")
|
||||||
}
|
}
|
||||||
|
|
||||||
// tryRename renames a src object when doing track renames if
|
// tryRename renames an src object when doing track renames if
|
||||||
// possible, it returns true if the object was renamed.
|
// possible, it returns true if the object was renamed.
|
||||||
func (s *syncCopyMove) tryRename(src fs.Object) bool {
|
func (s *syncCopyMove) tryRename(src fs.Object) bool {
|
||||||
// Calculate the hash of the src object
|
// Calculate the hash of the src object
|
||||||
|
@ -1095,7 +1095,7 @@ func (i identity) ToStandardName(s string) string {
|
|||||||
return ToStandardName(i, s)
|
return ToStandardName(i, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identity returns a Encoder that always returns the input value
|
// Identity returns an Encoder that always returns the input value
|
||||||
func Identity() Encoder {
|
func Identity() Encoder {
|
||||||
return identity{}
|
return identity{}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ func MaxConnectionsOption(maxConnections int) Option {
|
|||||||
return func(p *pacerOptions) { p.maxConnections = maxConnections }
|
return func(p *pacerOptions) { p.maxConnections = maxConnections }
|
||||||
}
|
}
|
||||||
|
|
||||||
// InvokerOption sets a InvokerFunc for the new Pacer.
|
// InvokerOption sets an InvokerFunc for the new Pacer.
|
||||||
func InvokerOption(invoker InvokerFunc) Option {
|
func InvokerOption(invoker InvokerFunc) Option {
|
||||||
return func(p *pacerOptions) { p.invoker = invoker }
|
return func(p *pacerOptions) { p.invoker = invoker }
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ func RetryAfterError(err error, retryAfter time.Duration) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsRetryAfter returns true if the the error or any of it's Cause's is an error
|
// IsRetryAfter returns true if the error or any of it's Cause's is an error
|
||||||
// returned by RetryAfterError. It also returns the associated Duration if possible.
|
// returned by RetryAfterError. It also returns the associated Duration if possible.
|
||||||
func IsRetryAfter(err error) (retryAfter time.Duration, isRetryAfter bool) {
|
func IsRetryAfter(err error) (retryAfter time.Duration, isRetryAfter bool) {
|
||||||
errors.Walk(err, func(err error) bool {
|
errors.Walk(err, func(err error) bool {
|
||||||
|
@ -47,8 +47,8 @@ type File struct {
|
|||||||
writers []Handle // writers for this file
|
writers []Handle // writers for this file
|
||||||
nwriters int32 // len(writers) which is read/updated with atomic
|
nwriters int32 // len(writers) which is read/updated with atomic
|
||||||
readWriters int // how many RWFileHandle are open for writing
|
readWriters int // how many RWFileHandle are open for writing
|
||||||
readWriterClosing bool // is a RWFileHandle currently cosing?
|
readWriterClosing bool // is an RWFileHandle currently cosing?
|
||||||
modified bool // has the cache file be modified by a RWFileHandle?
|
modified bool // has the cache file be modified by an RWFileHandle?
|
||||||
pendingModTime time.Time // will be applied once o becomes available, i.e. after file was written
|
pendingModTime time.Time // will be applied once o becomes available, i.e. after file was written
|
||||||
pendingRenameFun func(ctx context.Context) error // will be run/renamed after all writers close
|
pendingRenameFun func(ctx context.Context) error // will be run/renamed after all writers close
|
||||||
appendMode bool // file was opened with O_APPEND
|
appendMode bool // file was opened with O_APPEND
|
||||||
|
Loading…
Reference in New Issue
Block a user