mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 04:41:17 +08: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
|
||||
* `enhancement: new remote` - a new rclone backend
|
||||
* `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
|
||||
* `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
|
||||
|
|
|
@ -1455,7 +1455,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
|
|||
httpHeaders.ContentType = fs.MimeType(ctx, o)
|
||||
// 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
|
||||
// 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
|
||||
if !o.fs.opt.DisableCheckSum {
|
||||
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,
|
||||
}, {
|
||||
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,
|
||||
}, {
|
||||
Name: "chunk_size",
|
||||
|
@ -339,7 +339,7 @@ func parseRootPath(path string) (string, error) {
|
|||
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) {
|
||||
// Parse config into Options struct
|
||||
opt := new(Options)
|
||||
|
|
|
@ -559,7 +559,7 @@ func (n *nonce) increment() {
|
|||
n.carry(0)
|
||||
}
|
||||
|
||||
// add an uint64 to the nonce
|
||||
// add a uint64 to the nonce
|
||||
func (n *nonce) add(x uint64) {
|
||||
carry := uint16(0)
|
||||
for i := 0; i < 8; i++ {
|
||||
|
|
|
@ -263,7 +263,7 @@ videos.
|
|||
Setting this flag will cause Google photos and videos to return a
|
||||
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
|
||||
not updating the checksum.`,
|
||||
|
@ -2074,7 +2074,7 @@ func (f *Fs) MergeDirs(ctx context.Context, dirs []fs.Directory) error {
|
|||
}
|
||||
dstDir := dirs[0]
|
||||
for _, srcDir := range dirs[1:] {
|
||||
// list the the objects
|
||||
// list the objects
|
||||
infos := []*drive.File{}
|
||||
_, err := f.list(ctx, []string{srcDir.ID()}, "", false, false, true, func(info *drive.File) bool {
|
||||
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
|
||||
//
|
||||
// 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
|
||||
// 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
|
||||
//
|
||||
// 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
|
||||
// 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 {
|
||||
|
|
|
@ -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
|
||||
// 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) {
|
||||
// we need a MD5
|
||||
// we need an MD5
|
||||
md5Hasher := md5.New()
|
||||
// use the teeReader to write to the local file AND calculate the MD5 while doing so
|
||||
teeReader := io.TeeReader(in, md5Hasher)
|
||||
|
|
|
@ -79,7 +79,7 @@ type Options struct {
|
|||
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 {
|
||||
name string
|
||||
mountID string
|
||||
|
@ -250,7 +250,7 @@ func (f *Fs) Hashes() hash.Set {
|
|||
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 {
|
||||
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 {
|
||||
info, err := o.fs.lstat(o.path)
|
||||
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)
|
||||
}
|
||||
|
||||
// list the the objects
|
||||
// list the objects
|
||||
infos := []*mega.Node{}
|
||||
_, err := f.list(ctx, srcDirNode, func(info *mega.Node) bool {
|
||||
infos = append(infos, info)
|
||||
|
|
|
@ -63,7 +63,7 @@ func init() {
|
|||
// ? (question mark) -> '?' // FULLWIDTH QUESTION MARK
|
||||
// * (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:
|
||||
// (space) -> '␠' // SYMBOL FOR SPACE
|
||||
// (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 {
|
||||
bucketInit, _ := mu.bucketInit()
|
||||
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
|
||||
//
|
||||
// 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
|
||||
// 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 {
|
||||
|
|
|
@ -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
|
||||
//
|
||||
// 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
|
||||
// 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, "")
|
||||
}
|
||||
|
||||
// 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)
|
||||
func getAuthorizationToken(ctx context.Context, srv *rest.Client, user, password, oneTimeCode string) (string, error) {
|
||||
// API Documentation
|
||||
|
|
|
@ -94,7 +94,7 @@ when the ssh-agent contains many keys.`,
|
|||
Name: "use_insecure_cipher",
|
||||
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
|
||||
- aes192-cbc
|
||||
|
|
|
@ -230,7 +230,7 @@ func (f *Fs) Features() *fs.Features {
|
|||
return f.features
|
||||
}
|
||||
|
||||
// parsePath parses an sugarsync 'url'
|
||||
// parsePath parses a sugarsync 'url'
|
||||
func parsePath(path string) (root string) {
|
||||
root = strings.Trim(path, "/")
|
||||
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
|
||||
//
|
||||
// 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 return an error or upload it properly (rather than e.g. calling
|
||||
// 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
|
||||
//
|
||||
// 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
|
||||
// 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) {
|
||||
|
|
|
@ -55,7 +55,7 @@ func (d *Directory) candidates() []upstream.Entry {
|
|||
|
||||
// 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
|
||||
// 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 {
|
||||
|
|
|
@ -80,7 +80,7 @@ type Fs struct {
|
|||
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) {
|
||||
e, err := f.searchEntries(entries...)
|
||||
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
|
||||
//
|
||||
// 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
|
||||
// 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 {
|
||||
|
|
|
@ -155,7 +155,7 @@ func (e *Error) Error() string {
|
|||
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
|
||||
type Time time.Time
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ func gitDiffDiff(rev1, rev2 string) {
|
|||
if errors.As(err, &exitErr) && exitErr.ExitCode() == 1 {
|
||||
// OK just different
|
||||
} else {
|
||||
log.Fatalf("git diff diff failed: %#v", err)
|
||||
log.Fatalf("git diff failed: %#v", err)
|
||||
}
|
||||
}
|
||||
_, _ = os.Stdout.Write(out)
|
||||
|
|
|
@ -140,7 +140,7 @@ func showHelp(fsInfo *fs.RegInfo) error {
|
|||
fmt.Printf("### Backend commands\n\n")
|
||||
fmt.Printf(`Here are the commands specific to the %s backend.
|
||||
|
||||
Run them with with
|
||||
Run them with
|
||||
|
||||
rclone backend COMMAND remote:
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ func ShowVersion() {
|
|||
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
|
||||
// otherwise "".
|
||||
|
@ -99,7 +99,7 @@ func NewFsFile(remote string) (fs.Fs, string) {
|
|||
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
|
||||
// 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.`,
|
||||
Long: `
|
||||
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
|
||||
you would do:
|
||||
|
@ -204,7 +204,7 @@ var configPasswordCommand = &cobra.Command{
|
|||
Short: `Update password in an existing remote.`,
|
||||
Long: `
|
||||
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:
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ be copied to the vfs cache before opening with --vfs-cache-mode full.
|
|||
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) {
|
||||
var max uint64
|
||||
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
|
||||
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
|
||||
setting up a swift remote.
|
||||
|
|
|
@ -58,7 +58,7 @@ type accountValues struct {
|
|||
|
||||
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
|
||||
func newAccountSizeName(stats *StatsInfo, in io.ReadCloser, size int64, name string) *Account {
|
||||
acc := &Account{
|
||||
|
|
|
@ -16,7 +16,7 @@ var (
|
|||
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
|
||||
//
|
||||
// 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 string
|
||||
// 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.
|
||||
NewFs func(name string, root string, config configmap.Mapper) (Fs, error) `json:"-"`
|
||||
// Function to call to help with config
|
||||
|
@ -191,7 +191,7 @@ func (o *Option) String() string {
|
|||
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) {
|
||||
newValue, err := configstruct.StringToInterface(o.GetValue(), s)
|
||||
if err != nil {
|
||||
|
@ -274,7 +274,7 @@ type Fs interface {
|
|||
|
||||
// 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
|
||||
// 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
|
||||
//
|
||||
// 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
|
||||
// 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
|
||||
|
|
|
@ -748,7 +748,7 @@ func checkIdentical(ctx context.Context, dst, src fs.Object) (differ bool, noHas
|
|||
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)
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return ListFn(ctx, f, func(o fs.Object) {
|
||||
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 {
|
||||
return ListFn(ctx, f, func(o fs.Object) {
|
||||
sum, err := hashSum(ctx, ht, o)
|
||||
|
|
|
@ -103,7 +103,7 @@ func (p Params) GetString(key string) (string, error) {
|
|||
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
|
||||
// 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")
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (s *syncCopyMove) tryRename(src fs.Object) bool {
|
||||
// Calculate the hash of the src object
|
||||
|
|
|
@ -1095,7 +1095,7 @@ func (i identity) ToStandardName(s string) string {
|
|||
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 {
|
||||
return identity{}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ func MaxConnectionsOption(maxConnections int) Option {
|
|||
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 {
|
||||
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.
|
||||
func IsRetryAfter(err error) (retryAfter time.Duration, isRetryAfter bool) {
|
||||
errors.Walk(err, func(err error) bool {
|
||||
|
|
|
@ -47,8 +47,8 @@ type File struct {
|
|||
writers []Handle // writers for this file
|
||||
nwriters int32 // len(writers) which is read/updated with atomic
|
||||
readWriters int // how many RWFileHandle are open for writing
|
||||
readWriterClosing bool // is a RWFileHandle currently cosing?
|
||||
modified bool // has the cache file be modified by a RWFileHandle?
|
||||
readWriterClosing bool // is an RWFileHandle currently cosing?
|
||||
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
|
||||
pendingRenameFun func(ctx context.Context) error // will be run/renamed after all writers close
|
||||
appendMode bool // file was opened with O_APPEND
|
||||
|
|
Loading…
Reference in New Issue
Block a user