Versions in this module Expand all Collapse all v1 v1.54.4 Nov 23, 2020 Changes in this version + const DurationOff + const EntryDirectory + const EntryObject + const MaxLevel + const ModTimeNotSupported + var Config = NewConfig() + var ConfigFileGet = func(section, key string) (string, bool) + var ConfigFileSet = func(section, key, value string) (err error) + var ConfigProvider = "provider" + var CountError = func(err error) error + var DumpFlagsList string + var ErrorCantCopy = errors.New("can't copy object - incompatible remotes") + var ErrorCantDirMove = errors.New("can't move directory - incompatible remotes") + var ErrorCantMove = errors.New("can't move object - incompatible remotes") + var ErrorCantPurge = errors.New("can't purge directory") + var ErrorCantSetModTime = errors.New("can't set modified time") + var ErrorCantSetModTimeWithoutDelete = errors.New("can't set modified time without deleting existing object") + var ErrorCantShareDirectories = errors.New("this backend can't share directories with link") + var ErrorCantUploadEmptyFiles = errors.New("can't upload empty files to this remote") + var ErrorCommandNotFound = errors.New("command not found") + var ErrorDirExists = errors.New("can't copy directory - destination already exists") + var ErrorDirNotFound = errors.New("directory not found") + var ErrorDirectoryNotEmpty = errors.New("directory not empty") + var ErrorImmutableModified = errors.New("immutable file modified") + var ErrorIsFile = errors.New("is a file not a directory") + var ErrorLevelNotSupported = errors.New("level value not supported") + var ErrorListAborted = errors.New("list aborted") + var ErrorListBucketRequired = errors.New("bucket or container name is needed in remote") + var ErrorNotAFile = errors.New("is not a regular file") + var ErrorNotDeleting = errors.New("not deleting files as there were IO errors") + var ErrorNotDeletingDirs = errors.New("not deleting directories as there were IO errors") + var ErrorNotFoundInConfigFile = errors.New("didn't find section in config file") + var ErrorNotImplemented = errors.New("optional feature not implemented") + var ErrorObjectNotFound = errors.New("object not found") + var ErrorOverlapping = errors.New("can't sync or move files on overlapping remotes") + var ErrorPermissionDenied = errors.New("permission denied") + var LogPrint = func(level LogLevel, text string) + var Registry []*RegInfo + var Version = "v1.54.0-DEV" + func CheckClose(c io.Closer, err *error) + func CompareDirEntries(a, b DirEntry) int + func ConfigMap(fsInfo *RegInfo, configName string) (config *configmap.Map) + func ConfigString(f Fs) string + func ConfigToEnv(section, name string) string + func Debugf(o interface{}, text string, args ...interface{}) + func DirEntryType(d DirEntry) string + func Errorf(o interface{}, text string, args ...interface{}) + func FileExists(ctx context.Context, fs Fs, remote string) (bool, error) + func Fingerprint(ctx context.Context, o ObjectInfo, fast bool) string + func FixRangeOption(options []OpenOption, size int64) + func GetModifyWindow(fss ...Info) time.Duration + func Infof(o interface{}, text string, args ...interface{}) + func LogDirName(f Fs, dir string) interface + func LogLevelPrintf(level LogLevel, o interface{}, text string, args ...interface{}) + func LogPrintf(level LogLevel, o interface{}, text string, args ...interface{}) + func Logf(o interface{}, text string, args ...interface{}) + func MimeType(ctx context.Context, o ObjectInfo) (mimeType string) + func MimeTypeDirEntry(ctx context.Context, item DirEntry) string + func MimeTypeFromName(remote string) (mimeType string) + func NewUsageValue(value int64) *int64 + func ObjectOptionalInterfaces(o Object) (supported, unsupported []string) + func OpenOptionAddHTTPHeaders(headers http.Header, options []OpenOption) + func OpenOptionAddHeaders(options []OpenOption, headers map[string]string) + func OpenOptionHeaders(options []OpenOption) (headers map[string]string) + func OptionToEnv(name string) string + func ParseDuration(age string) (d time.Duration, err error) + func Register(info *RegInfo) + type Abouter interface + About func(ctx context.Context) (*Usage, error) + type BaseOption Option + type BwTimeSlot struct + Bandwidth SizeSuffix + DayOfTheWeek int + HHMM int + type BwTimetable []BwTimeSlot + func (x *BwTimetable) Set(s string) error + func (x BwTimetable) LimitAt(tt time.Time) BwTimeSlot + func (x BwTimetable) String() string + func (x BwTimetable) Type() string + type ChangeNotifier interface + ChangeNotify func(context.Context, func(string, EntryType), <-chan time.Duration) + type CleanUpper interface + CleanUp func(ctx context.Context) error + type CommaSepList []string + func (CommaSepList) Type() string + func (l *CommaSepList) Scan(s fmt.ScanState, ch rune) error + func (l *CommaSepList) Set(s string) error + func (l CommaSepList) String() string + type CommandHelp struct + Long string + Name string + Opts map[string]string + Short string + type Commander interface + Command func(ctx context.Context, name string, arg []string, opt map[string]string) (interface{}, error) + type ConfigInfo struct + AskPassword bool + AutoConfirm bool + BackupDir string + BindAddr net.IP + BufferSize SizeSuffix + BwLimit BwTimetable + BwLimitFile BwTimetable + CaCert string + CheckFirst bool + CheckSum bool + Checkers int + ClientCert string + ClientKey string + CompareDest string + ConnectTimeout time.Duration + Cookie bool + CopyDest string + CutoffMode CutoffMode + DataRateUnit string + DeleteMode DeleteMode + DisableFeatures []string + DownloadHeaders []*HTTPOption + DryRun bool + Dump DumpFlags + ErrorOnNoTransfer bool + ExpectContinueTimeout time.Duration + Headers []*HTTPOption + IgnoreCaseSync bool + IgnoreChecksum bool + IgnoreErrors bool + IgnoreExisting bool + IgnoreSize bool + IgnoreTimes bool + Immutable bool + InsecureSkipVerify bool + Interactive bool + LogLevel LogLevel + LowLevelRetries int + MaxBacklog int + MaxDelete int64 + MaxDepth int + MaxDuration time.Duration + MaxStatsGroups int + MaxTransfer SizeSuffix + ModifyWindow time.Duration + MultiThreadCutoff SizeSuffix + MultiThreadSet bool + MultiThreadStreams int + NoCheckDest bool + NoGzip bool + NoTraverse bool + NoUnicodeNormalization bool + NoUpdateModTime bool + OrderBy string + PasswordCommand SpaceSepList + Progress bool + RefreshTimes bool + SizeOnly bool + StatsFileNameLength int + StatsLogLevel LogLevel + StatsOneLine bool + StatsOneLineDate bool + StatsOneLineDateFormat string + StreamingUploadCutoff SizeSuffix + Suffix string + SuffixKeepExtension bool + TPSLimit float64 + TPSLimitBurst int + Timeout time.Duration + TrackRenames bool + TrackRenamesStrategy string + Transfers int + UpdateOlder bool + UploadHeaders []*HTTPOption + UseJSONLog bool + UseListR bool + UseMmap bool + UseServerModTime bool + UserAgent string + func NewConfig() *ConfigInfo + type Copier interface + Copy func(ctx context.Context, src Object, remote string) (Object, error) + type CutoffMode byte + const CutoffModeCautious + const CutoffModeDefault + const CutoffModeHard + const CutoffModeSoft + func (m *CutoffMode) Set(s string) error + func (m *CutoffMode) Type() string + func (m CutoffMode) String() string + type DeleteMode byte + const DeleteModeAfter + const DeleteModeBefore + const DeleteModeDefault + const DeleteModeDuring + const DeleteModeOff + const DeleteModeOnly + type Dir struct + func NewDir(remote string, modTime time.Time) *Dir + func NewDirCopy(ctx context.Context, d Directory) *Dir + func (d *Dir) ID() string + func (d *Dir) Items() int64 + func (d *Dir) ModTime(ctx context.Context) time.Time + func (d *Dir) Remote() string + func (d *Dir) SetID(id string) *Dir + func (d *Dir) SetItems(items int64) *Dir + func (d *Dir) SetRemote(remote string) *Dir + func (d *Dir) SetSize(size int64) *Dir + func (d *Dir) Size() int64 + func (d *Dir) String() string + type DirCacheFlusher interface + DirCacheFlush func() + type DirEntries []DirEntry + func (ds DirEntries) ForDir(fn func(dir Directory)) + func (ds DirEntries) ForDirError(fn func(dir Directory) error) error + func (ds DirEntries) ForObject(fn func(o Object)) + func (ds DirEntries) ForObjectError(fn func(o Object) error) error + func (ds DirEntries) Len() int + func (ds DirEntries) Less(i, j int) bool + func (ds DirEntries) Swap(i, j int) + type DirEntry interface + ModTime func(context.Context) time.Time + Remote func() string + Size func() int64 + String func() string + type DirMover interface + DirMove func(ctx context.Context, src Fs, srcRemote, dstRemote string) error + type Directory interface + ID func() string + Items func() int64 + type Disconnecter interface + Disconnect func(ctx context.Context) error + type DumpFlags int + const DumpAuth + const DumpBodies + const DumpFilters + const DumpGoRoutines + const DumpHeaders + const DumpOpenFiles + const DumpRequests + const DumpResponses + func (f *DumpFlags) Set(s string) error + func (f *DumpFlags) Type() string + func (f DumpFlags) String() string + type Duration time.Duration + func (d *Duration) Scan(s fmt.ScanState, ch rune) error + func (d *Duration) Set(s string) error + func (d Duration) IsSet() bool + func (d Duration) ReadableString() string + func (d Duration) String() string + func (d Duration) Type() string + type EntryType int + type Features struct + About func(ctx context.Context) (*Usage, error) + BucketBased bool + BucketBasedRootOK bool + CanHaveEmptyDirectories bool + CaseInsensitive bool + ChangeNotify func(context.Context, func(string, EntryType), <-chan time.Duration) + CleanUp func(ctx context.Context) error + Command func(ctx context.Context, name string, arg []string, opt map[string]string) (interface{}, error) + Copy func(ctx context.Context, src Object, remote string) (Object, error) + DirCacheFlush func() + DirMove func(ctx context.Context, src Fs, srcRemote, dstRemote string) error + Disconnect func(ctx context.Context) error + DuplicateFiles bool + GetTier bool + IsLocal bool + ListR ListRFn + MergeDirs func(ctx context.Context, dirs []Directory) error + Move func(ctx context.Context, src Object, remote string) (Object, error) + OpenWriterAt func(ctx context.Context, remote string, size int64) (WriterAtCloser, error) + PublicLink func(ctx context.Context, remote string, expire Duration, unlink bool) (string, error) + Purge func(ctx context.Context, dir string) error + PutStream func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error) + PutUnchecked func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error) + ReadMimeType bool + ServerSideAcrossConfigs bool + SetTier bool + SetWrapper func(f Fs) + SlowHash bool + SlowModTime bool + UnWrap func() Fs + UserInfo func(ctx context.Context) (map[string]string, error) + WrapFs func() Fs + WriteMimeType bool + func (ft *Features) Disable(name string) *Features + func (ft *Features) DisableList(list []string) *Features + func (ft *Features) Enabled() (features map[string]bool) + func (ft *Features) Fill(f Fs) *Features + func (ft *Features) List() (out []string) + func (ft *Features) Mask(f Fs) *Features + func (ft *Features) Wrap(f Fs) *Features + func (ft *Features) WrapsFs(f Fs, w Fs) *Features + type Fs interface + List func(ctx context.Context, dir string) (entries DirEntries, err error) + Mkdir func(ctx context.Context, dir string) error + NewObject func(ctx context.Context, remote string) (Object, error) + Put func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error) + Rmdir func(ctx context.Context, dir string) error + func NewFs(path string) (Fs, error) + func TemporaryLocalFs() (Fs, error) + func UnWrapFs(f Fs) Fs + type FullObject interface + type FullObjectInfo interface + type GetTierer interface + GetTier func() string + type HTTPOption struct + Key string + Value string + func (o *HTTPOption) Header() (key string, value string) + func (o *HTTPOption) Mandatory() bool + func (o *HTTPOption) String() string + type HashesOption struct + Hashes hash.Set + func (o *HashesOption) Header() (key string, value string) + func (o *HashesOption) Mandatory() bool + func (o *HashesOption) String() string + type IDer interface + ID func() string + type Info interface + Features func() *Features + Hashes func() hash.Set + Name func() string + Precision func() time.Duration + Root func() string + String func() string + type ListRCallback func(entries DirEntries) error + type ListRFn func(ctx context.Context, dir string, callback ListRCallback) error + type ListRer interface + ListR func(ctx context.Context, dir string, callback ListRCallback) error + type LogLevel byte + const LogLevelAlert + const LogLevelCritical + const LogLevelDebug + const LogLevelEmergency + const LogLevelError + const LogLevelInfo + const LogLevelNotice + const LogLevelWarning + func (l *LogLevel) Set(s string) error + func (l *LogLevel) Type() string + func (l LogLevel) String() string + type LogValueItem struct + func LogValue(key string, value interface{}) LogValueItem + func (j LogValueItem) String() string + type MergeDirser interface + MergeDirs func(ctx context.Context, dirs []Directory) error + type MimeTyper interface + MimeType func(ctx context.Context) string + type Mover interface + Move func(ctx context.Context, src Object, remote string) (Object, error) + type NullOption struct + func (o NullOption) Header() (key string, value string) + func (o NullOption) Mandatory() bool + func (o NullOption) String() string + type Object interface + Open func(ctx context.Context, options ...OpenOption) (io.ReadCloser, error) + Remove func(ctx context.Context) error + SetModTime func(ctx context.Context, t time.Time) error + Update func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) error + func UnWrapObject(o Object) Object + type ObjectInfo interface + Fs func() Info + Hash func(ctx context.Context, ty hash.Type) (string, error) + Storable func() bool + type ObjectPair struct + Dst Object + Src Object + type ObjectUnWrapper interface + UnWrap func() Object + type Objects []Object + type ObjectsChan chan Object + type OpenOption interface + Header func() (key string, value string) + Mandatory func() bool + type OpenWriterAter interface + OpenWriterAt func(ctx context.Context, remote string, size int64) (WriterAtCloser, error) + type Option struct + Advanced bool + Default interface{} + Examples OptionExamples + Help string + Hide OptionVisibility + IsPassword bool + Name string + NoPrefix bool + Provider string + Required bool + ShortOpt string + Value interface{} + func (o *Option) EnvVarName(prefix string) string + func (o *Option) FlagName(prefix string) string + func (o *Option) GetValue() interface{} + func (o *Option) MarshalJSON() ([]byte, error) + func (o *Option) Set(s string) (err error) + func (o *Option) String() string + func (o *Option) Type() string + type OptionExample struct + Help string + Provider string + Value string + type OptionExamples []OptionExample + func (os OptionExamples) Len() int + func (os OptionExamples) Less(i, j int) bool + func (os OptionExamples) Sort() + func (os OptionExamples) Swap(i, j int) + type OptionVisibility byte + const OptionHideBoth + const OptionHideCommandLine + const OptionHideConfigurator + type Options []Option + func (os Options) Get(name string) *Option + type Pacer struct + func NewPacer(c pacer.Calculator) *Pacer + func (p *Pacer) ModifyCalculator(f func(pacer.Calculator)) + func (p *Pacer) SetCalculator(c pacer.Calculator) + type PublicLinker interface + PublicLink func(ctx context.Context, remote string, expire Duration, unlink bool) (string, error) + type Purger interface + Purge func(ctx context.Context, dir string) error + type PutStreamer interface + PutStream func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error) + type PutUncheckeder interface + PutUnchecked func(ctx context.Context, in io.Reader, src ObjectInfo, options ...OpenOption) (Object, error) + type RangeOption struct + End int64 + Start int64 + func ParseRangeOption(s string) (po *RangeOption, err error) + func (o *RangeOption) Decode(size int64) (offset, limit int64) + func (o *RangeOption) Header() (key string, value string) + func (o *RangeOption) Mandatory() bool + func (o *RangeOption) String() string + type RangeSeeker interface + RangeSeek func(ctx context.Context, offset int64, whence int, length int64) (int64, error) + type RegInfo struct + CommandHelp []CommandHelp + Config func(name string, config configmap.Mapper) + Description string + Name string + NewFs func(name string, root string, config configmap.Mapper) (Fs, error) + Options Options + Prefix string + func ConfigFs(path string) (fsInfo *RegInfo, configName, fsPath string, config *configmap.Map, err error) + func Find(name string) (*RegInfo, error) + func MustFind(name string) *RegInfo + func ParseRemote(path string) (fsInfo *RegInfo, configName, fsPath string, err error) + func (ri *RegInfo) FileName() string + type SeekOption struct + Offset int64 + func (o *SeekOption) Header() (key string, value string) + func (o *SeekOption) Mandatory() bool + func (o *SeekOption) String() string + type SetTierer interface + SetTier func(tier string) error + type SizeSuffix int64 + const Byte + const ExbiByte + const GibiByte + const KibiByte + const MebiByte + const PebiByte + const TebiByte + func (x *SizeSuffix) Scan(s fmt.ScanState, ch rune) error + func (x *SizeSuffix) Set(s string) error + func (x *SizeSuffix) Type() string + func (x SizeSuffix) String() string + func (x SizeSuffix) Unit(unit string) string + type SizeSuffixList []SizeSuffix + func (l SizeSuffixList) Len() int + func (l SizeSuffixList) Less(i, j int) bool + func (l SizeSuffixList) Sort() + func (l SizeSuffixList) Swap(i, j int) + type SpaceSepList []string + func (SpaceSepList) Type() string + func (l *SpaceSepList) Scan(s fmt.ScanState, ch rune) error + func (l *SpaceSepList) Set(s string) error + func (l SpaceSepList) String() string + type UnWrapper interface + UnWrap func() Fs + type Usage struct + Free *int64 + Objects *int64 + Other *int64 + Total *int64 + Trashed *int64 + Used *int64 + type UserInfoer interface + UserInfo func(ctx context.Context) (map[string]string, error) + type Wrapper interface + SetWrapper func(f Fs) + WrapFs func() Fs + type WriterAtCloser interface