forked from TrueCloudLab/rclone
fix spelling
This commit is contained in:
parent
7963320a29
commit
48c09608ea
31 changed files with 41 additions and 41 deletions
|
@ -127,7 +127,7 @@ func waitFor(fn func() bool) (ok bool) {
|
||||||
func mount(f fs.Fs, mountpoint string) (*vfs.VFS, <-chan error, func() error, error) {
|
func mount(f fs.Fs, mountpoint string) (*vfs.VFS, <-chan error, func() error, error) {
|
||||||
fs.Debugf(f, "Mounting on %q", mountpoint)
|
fs.Debugf(f, "Mounting on %q", mountpoint)
|
||||||
|
|
||||||
// Check the mountpoint - in Windows the mountpoint musn't exist before the mount
|
// Check the mountpoint - in Windows the mountpoint mustn't exist before the mount
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
fi, err := os.Stat(mountpoint)
|
fi, err := os.Stat(mountpoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -2,7 +2,7 @@ package lshelp
|
||||||
|
|
||||||
// Help describes the common help for all the list commands
|
// Help describes the common help for all the list commands
|
||||||
var Help = `
|
var Help = `
|
||||||
Any of the filtering options can be applied to this commmand.
|
Any of the filtering options can be applied to this command.
|
||||||
|
|
||||||
There are several related list commands
|
There are several related list commands
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ type Dir struct {
|
||||||
*vfs.Dir
|
*vfs.Dir
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check interface satsified
|
// Check interface satisfied
|
||||||
var _ fusefs.Node = (*Dir)(nil)
|
var _ fusefs.Node = (*Dir)(nil)
|
||||||
|
|
||||||
// Attr updates the attributes of a directory
|
// Attr updates the attributes of a directory
|
||||||
|
|
|
@ -24,7 +24,7 @@ type FS struct {
|
||||||
f fs.Fs
|
f fs.Fs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check interface satistfied
|
// Check interface satisfied
|
||||||
var _ fusefs.FS = (*FS)(nil)
|
var _ fusefs.FS = (*FS)(nil)
|
||||||
|
|
||||||
// NewFS makes a new FS
|
// NewFS makes a new FS
|
||||||
|
@ -46,7 +46,7 @@ func (f *FS) Root() (node fusefs.Node, err error) {
|
||||||
return &Dir{root}, nil
|
return &Dir{root}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check interface satsified
|
// Check interface satisfied
|
||||||
var _ fusefs.FSStatfser = (*FS)(nil)
|
var _ fusefs.FSStatfser = (*FS)(nil)
|
||||||
|
|
||||||
// Statfs is called to obtain file system metadata.
|
// Statfs is called to obtain file system metadata.
|
||||||
|
|
|
@ -19,7 +19,7 @@ If source:path is a file or directory then it moves it to a file or
|
||||||
directory named dest:path.
|
directory named dest:path.
|
||||||
|
|
||||||
This can be used to rename files or upload single files to other than
|
This can be used to rename files or upload single files to other than
|
||||||
their existing name. If the source is a directory then it acts exacty
|
their existing name. If the source is a directory then it acts exactly
|
||||||
like the move command.
|
like the move command.
|
||||||
|
|
||||||
So
|
So
|
||||||
|
|
|
@ -361,7 +361,7 @@ func (u *UI) Draw() error {
|
||||||
Linef(0, h-1, w, termbox.ColorBlack, termbox.ColorWhite, ' ', "Total usage: %v, Objects: %d%s", fs.SizeSuffix(size), count, message)
|
Linef(0, h-1, w, termbox.ColorBlack, termbox.ColorWhite, ' ', "Total usage: %v, Objects: %d%s", fs.SizeSuffix(size), count, message)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the box on top if requred
|
// Show the box on top if required
|
||||||
if u.showBox {
|
if u.showBox {
|
||||||
u.Box()
|
u.Box()
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ var (
|
||||||
progressMu sync.Mutex
|
progressMu sync.Mutex
|
||||||
)
|
)
|
||||||
|
|
||||||
// printProgress prings the progress with an optional log
|
// printProgress prints the progress with an optional log
|
||||||
func printProgress(logMessage string) {
|
func printProgress(logMessage string) {
|
||||||
progressMu.Lock()
|
progressMu.Lock()
|
||||||
defer progressMu.Unlock()
|
defer progressMu.Unlock()
|
||||||
|
|
|
@ -155,7 +155,7 @@ func (f *DriverFactory) NewDriver() (ftp.Driver, error) {
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Driver impletation of ftp server
|
//Driver implementation of ftp server
|
||||||
type Driver struct {
|
type Driver struct {
|
||||||
vfs *vfs.VFS
|
vfs *vfs.VFS
|
||||||
lock sync.Mutex
|
lock sync.Mutex
|
||||||
|
@ -378,7 +378,7 @@ func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64,
|
||||||
return bytes, nil
|
return bytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//FileInfo struct ot hold file infor for ftp server
|
//FileInfo struct to hold file info for ftp server
|
||||||
type FileInfo struct {
|
type FileInfo struct {
|
||||||
os.FileInfo
|
os.FileInfo
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ type FileInfo struct {
|
||||||
group uint32
|
group uint32
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mode return êrm mode of file.
|
//Mode return mode of file.
|
||||||
func (f *FileInfo) Mode() os.FileMode {
|
func (f *FileInfo) Mode() os.FileMode {
|
||||||
return f.mode
|
return f.mode
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ func (f *FileInfo) Group() string {
|
||||||
str := fmt.Sprint(f.group)
|
str := fmt.Sprint(f.group)
|
||||||
g, err := user.LookupGroupId(str)
|
g, err := user.LookupGroupId(str)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return str //Group not found default to numrical value
|
return str //Group not found default to numerical value
|
||||||
}
|
}
|
||||||
return g.Name
|
return g.Name
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetTemplate eturns the HTML template for serving directories via HTTP
|
// GetTemplate returns the HTML template for serving directories via HTTP
|
||||||
func GetTemplate() (tpl *template.Template, err error) {
|
func GetTemplate() (tpl *template.Template, err error) {
|
||||||
templateFile, err := Assets.Open("index.html")
|
templateFile, err := Assets.Open("index.html")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -20,7 +20,7 @@ Few cloud storage services provides different storage classes on objects,
|
||||||
for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive,
|
for example AWS S3 and Glacier, Azure Blob storage - Hot, Cool and Archive,
|
||||||
Google Cloud Storage, Regional Storage, Nearline, Coldline etc.
|
Google Cloud Storage, Regional Storage, Nearline, Coldline etc.
|
||||||
|
|
||||||
Note that, certain tier chages make objects not available to access immediately.
|
Note that, certain tier changes make objects not available to access immediately.
|
||||||
For example tiering to archive in azure blob storage makes objects in frozen state,
|
For example tiering to archive in azure blob storage makes objects in frozen state,
|
||||||
user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object
|
user can restore by setting tier to Hot/Cool, similarly S3 to Glacier makes object
|
||||||
inaccessible.true
|
inaccessible.true
|
||||||
|
|
|
@ -116,7 +116,7 @@ func (acc *Account) StopBuffering() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateReader updates the underlying io.ReadCloser stopping the
|
// UpdateReader updates the underlying io.ReadCloser stopping the
|
||||||
// asynb buffer (if any) and re-adding it
|
// async buffer (if any) and re-adding it
|
||||||
func (acc *Account) UpdateReader(in io.ReadCloser) {
|
func (acc *Account) UpdateReader(in io.ReadCloser) {
|
||||||
acc.mu.Lock()
|
acc.mu.Lock()
|
||||||
acc.StopBuffering()
|
acc.StopBuffering()
|
||||||
|
|
|
@ -90,7 +90,7 @@ type StatsInfo struct {
|
||||||
inProgress *inProgress
|
inProgress *inProgress
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewStats cretates an initialised StatsInfo
|
// NewStats creates an initialised StatsInfo
|
||||||
func NewStats() *StatsInfo {
|
func NewStats() *StatsInfo {
|
||||||
return &StatsInfo{
|
return &StatsInfo{
|
||||||
checking: newStringSet(fs.Config.Checkers, "checking"),
|
checking: newStringSet(fs.Config.Checkers, "checking"),
|
||||||
|
|
|
@ -183,8 +183,8 @@ func (cr *ChunkedReader) Open() (*ChunkedReader, error) {
|
||||||
|
|
||||||
// openRange will open the source Object with the current chunk range
|
// openRange will open the source Object with the current chunk range
|
||||||
//
|
//
|
||||||
// If the current open reader implenets RangeSeeker, it is tried first.
|
// If the current open reader implements RangeSeeker, it is tried first.
|
||||||
// When RangeSeek failes, o.Open with a RangeOption is used.
|
// When RangeSeek fails, o.Open with a RangeOption is used.
|
||||||
//
|
//
|
||||||
// A length <= 0 will request till the end of the file
|
// A length <= 0 will request till the end of the file
|
||||||
func (cr *ChunkedReader) openRange() error {
|
func (cr *ChunkedReader) openRange() error {
|
||||||
|
|
|
@ -94,7 +94,7 @@ type ConfigInfo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewConfig creates a new config with everything set to the default
|
// NewConfig creates a new config with everything set to the default
|
||||||
// value. These are the ultimate defaults and are overriden by the
|
// value. These are the ultimate defaults and are overridden by the
|
||||||
// config module.
|
// config module.
|
||||||
func NewConfig() *ConfigInfo {
|
func NewConfig() *ConfigInfo {
|
||||||
c := new(ConfigInfo)
|
c := new(ConfigInfo)
|
||||||
|
|
|
@ -676,11 +676,11 @@ func ConfirmWithConfig(m configmap.Getter, configName string, Default bool) bool
|
||||||
|
|
||||||
// Choose one of the defaults or type a new string if newOk is set
|
// Choose one of the defaults or type a new string if newOk is set
|
||||||
func Choose(what string, defaults, help []string, newOk bool) string {
|
func Choose(what string, defaults, help []string, newOk bool) string {
|
||||||
valueDescripton := "an existing"
|
valueDescription := "an existing"
|
||||||
if newOk {
|
if newOk {
|
||||||
valueDescripton = "your own"
|
valueDescription = "your own"
|
||||||
}
|
}
|
||||||
fmt.Printf("Choose a number from below, or type in %s value\n", valueDescripton)
|
fmt.Printf("Choose a number from below, or type in %s value\n", valueDescription)
|
||||||
for i, text := range defaults {
|
for i, text := range defaults {
|
||||||
var lines []string
|
var lines []string
|
||||||
if help != nil {
|
if help != nil {
|
||||||
|
|
|
@ -95,7 +95,7 @@ func AddFlags(flagSet *pflag.FlagSet) {
|
||||||
flags.StringVarP(flagSet, &fs.Config.ClientKey, "client-key", "", fs.Config.ClientKey, "Client SSL private key (PEM) for mutual TLS auth")
|
flags.StringVarP(flagSet, &fs.Config.ClientKey, "client-key", "", fs.Config.ClientKey, "Client SSL private key (PEM) for mutual TLS auth")
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetFlags converts any flags into config which weren't straight foward
|
// SetFlags converts any flags into config which weren't straight forward
|
||||||
func SetFlags() {
|
func SetFlags() {
|
||||||
if verbose >= 2 {
|
if verbose >= 2 {
|
||||||
fs.Config.LogLevel = fs.LogLevelDebug
|
fs.Config.LogLevel = fs.LogLevelDebug
|
||||||
|
|
|
@ -43,7 +43,7 @@ func StringToInterface(def interface{}, in string) (newValue interface{}, err er
|
||||||
return o.Elem().Interface(), nil
|
return o.Elem().Interface(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Item descripts a single entry in the options structure
|
// Item describes a single entry in the options structure
|
||||||
type Item struct {
|
type Item struct {
|
||||||
Name string // snake_case
|
Name string // snake_case
|
||||||
Field string // CamelCase
|
Field string // CamelCase
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Package flags contains enahnced versions of spf13/pflag flag
|
// Package flags contains enhanced versions of spf13/pflag flag
|
||||||
// routines which will read from the environment also.
|
// routines which will read from the environment also.
|
||||||
package flags
|
package flags
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ func (rs *rules) boundedRecursion() bool {
|
||||||
// FilesMap describes the map of files to transfer
|
// FilesMap describes the map of files to transfer
|
||||||
type FilesMap map[string]struct{}
|
type FilesMap map[string]struct{}
|
||||||
|
|
||||||
// Opt configues the filter
|
// Opt configures the filter
|
||||||
type Opt struct {
|
type Opt struct {
|
||||||
DeleteExcluded bool
|
DeleteExcluded bool
|
||||||
FilterRule []string
|
FilterRule []string
|
||||||
|
|
4
fs/fs.go
4
fs/fs.go
|
@ -792,8 +792,8 @@ type ChangeNotifier interface {
|
||||||
// At least one value will be written to the channel,
|
// At least one value will be written to the channel,
|
||||||
// specifying the initial value and updated values might
|
// specifying the initial value and updated values might
|
||||||
// follow. A 0 Duration should pause the polling.
|
// follow. A 0 Duration should pause the polling.
|
||||||
// The ChangeNotify implemantion must empty the channel
|
// The ChangeNotify implementation must empty the channel
|
||||||
// regulary. When the channel gets closed, the implemantion
|
// regularly. When the channel gets closed, the implementation
|
||||||
// should stop polling and release resources.
|
// should stop polling and release resources.
|
||||||
ChangeNotify(func(string, EntryType), <-chan time.Duration)
|
ChangeNotify(func(string, EntryType), <-chan time.Duration)
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
// returns the "%p" reprentation of the thing passed in
|
// returns the "%p" representation of the thing passed in
|
||||||
func ptr(p interface{}) string {
|
func ptr(p interface{}) string {
|
||||||
return fmt.Sprintf("%p", p)
|
return fmt.Sprintf("%p", p)
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ func filterAndSortDir(entries fs.DirEntries, includeAll bool, dir string,
|
||||||
default:
|
default:
|
||||||
return nil, errors.Errorf("unknown object type %T", entry)
|
return nil, errors.Errorf("unknown object type %T", entry)
|
||||||
}
|
}
|
||||||
// check remote name belongs in this directry
|
// check remote name belongs in this directory
|
||||||
remote := entry.Remote()
|
remote := entry.Remote()
|
||||||
switch {
|
switch {
|
||||||
case !ok:
|
case !ok:
|
||||||
|
|
|
@ -206,7 +206,7 @@ func equal(src fs.ObjectInfo, dst fs.Object, sizeOnly, checkSum bool) bool {
|
||||||
|
|
||||||
// Used to remove a failed copy
|
// Used to remove a failed copy
|
||||||
//
|
//
|
||||||
// Returns whether the file was succesfully removed or not
|
// Returns whether the file was successfully removed or not
|
||||||
func removeFailedCopy(dst fs.Object) bool {
|
func removeFailedCopy(dst fs.Object) bool {
|
||||||
if dst == nil {
|
if dst == nil {
|
||||||
return false
|
return false
|
||||||
|
@ -226,7 +226,7 @@ type overrideRemoteObject struct {
|
||||||
remote string
|
remote string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remote returns the overriden remote name
|
// Remote returns the overridden remote name
|
||||||
func (o *overrideRemoteObject) Remote() string {
|
func (o *overrideRemoteObject) Remote() string {
|
||||||
return o.remote
|
return o.remote
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ func (o *RangeOption) Header() (key string, value string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseRangeOption parses a RangeOption from a Range: header.
|
// ParseRangeOption parses a RangeOption from a Range: header.
|
||||||
// It only appects single ranges.
|
// It only accepts single ranges.
|
||||||
func ParseRangeOption(s string) (po *RangeOption, err error) {
|
func ParseRangeOption(s string) (po *RangeOption, err error) {
|
||||||
const preamble = "bytes="
|
const preamble = "bytes="
|
||||||
if !strings.HasPrefix(s, preamble) {
|
if !strings.HasPrefix(s, preamble) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ check that parameter passing is working properly.`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Echo the input to the ouput parameters
|
// Echo the input to the output parameters
|
||||||
func rcNoop(in Params) (out Params, err error) {
|
func rcNoop(in Params) (out Params, err error) {
|
||||||
return in, nil
|
return in, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ func (x *SizeSuffix) Scan(s fmt.ScanState, ch rune) error {
|
||||||
return x.Set(string(token))
|
return x.Set(string(token))
|
||||||
}
|
}
|
||||||
|
|
||||||
// SizeSuffixList is a sclice SizeSuffix values
|
// SizeSuffixList is a slice SizeSuffix values
|
||||||
type SizeSuffixList []SizeSuffix
|
type SizeSuffixList []SizeSuffix
|
||||||
|
|
||||||
func (l SizeSuffixList) Len() int { return len(l) }
|
func (l SizeSuffixList) Len() int { return len(l) }
|
||||||
|
|
|
@ -188,7 +188,7 @@ func (s *syncCopyMove) processError(err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the current error (if any) in the order of prececedence
|
// Returns the current error (if any) in the order of precedence
|
||||||
// fatalErr
|
// fatalErr
|
||||||
// normal error
|
// normal error
|
||||||
// noRetryErr
|
// noRetryErr
|
||||||
|
|
|
@ -219,7 +219,7 @@ func TestWalkNotFoundMaskError(t *testing.T) {
|
||||||
).Walk()
|
).Walk()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWalkNotFoundSkipkError(t *testing.T) {
|
func TestWalkNotFoundSkipError(t *testing.T) {
|
||||||
// this doesn't work for WalkR
|
// this doesn't work for WalkR
|
||||||
newListDirs(t, nil, true,
|
newListDirs(t, nil, true,
|
||||||
listResults{
|
listResults{
|
||||||
|
|
|
@ -211,7 +211,7 @@ func testPutLarge(t *testing.T, f fs.Fs, file *fstest.Item) {
|
||||||
require.NoError(t, obj.Remove())
|
require.NoError(t, obj.Remove())
|
||||||
}
|
}
|
||||||
|
|
||||||
// errorReader just returne an error on Read
|
// errorReader just returns an error on Read
|
||||||
type errorReader struct {
|
type errorReader struct {
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ func stringsContains(x string, ss []string) bool {
|
||||||
|
|
||||||
// Run runs the basic integration tests for a remote using the options passed in.
|
// Run runs the basic integration tests for a remote using the options passed in.
|
||||||
//
|
//
|
||||||
// They are structured in a heirachical way so that dependencies for the tests can be created.
|
// They are structured in a hierarchical way so that dependencies for the tests can be created.
|
||||||
//
|
//
|
||||||
// For example some tests require the directory to be created - these
|
// For example some tests require the directory to be created - these
|
||||||
// are inside the "FsMkdir" test. Some tests require some tests files
|
// are inside the "FsMkdir" test. Some tests require some tests files
|
||||||
|
|
|
@ -154,7 +154,7 @@ type TokenSource struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If token has expired then first try re-reading it from the config
|
// If token has expired then first try re-reading it from the config
|
||||||
// file in case a concurrently runnng rclone has updated it already
|
// file in case a concurrently running rclone has updated it already
|
||||||
func (ts *TokenSource) reReadToken() bool {
|
func (ts *TokenSource) reReadToken() bool {
|
||||||
tokenString, err := config.FileGetFresh(ts.name, config.ConfigToken)
|
tokenString, err := config.FileGetFresh(ts.name, config.ConfigToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
// ClientWithHeaderReset makes a new http client which resets the
|
// ClientWithHeaderReset makes a new http client which resets the
|
||||||
// headers passed in on redirect
|
// headers passed in on redirect
|
||||||
//
|
//
|
||||||
// This is now unecessary with go1.8 so becomes a no-op
|
// This is now unnecessary with go1.8 so becomes a no-op
|
||||||
func ClientWithHeaderReset(c *http.Client, headers map[string]string) *http.Client {
|
func ClientWithHeaderReset(c *http.Client, headers map[string]string) *http.Client {
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue