Documentation ¶
Index ¶
- Constants
- func BeginUpload(ctx context.Context, params files_sdk.FileBeginUploadParams, ...) (fileUploadPartCollection files_sdk.FileUploadPartCollection, err error)
- func Copy(ctx context.Context, params files_sdk.FileCopyParams, ...) (fileAction files_sdk.FileAction, err error)
- func Create(ctx context.Context, params files_sdk.FileCreateParams, ...) (file files_sdk.File, err error)
- func Delete(ctx context.Context, params files_sdk.FileDeleteParams, ...) (err error)
- func Download(ctx context.Context, params files_sdk.FileDownloadParams) (files_sdk.File, error)
- func Find(ctx context.Context, params files_sdk.FileFindParams, ...) (file files_sdk.File, err error)
- func Get(ctx context.Context, Path string) (files_sdk.File, error)
- func Move(ctx context.Context, params files_sdk.FileMoveParams, ...) (fileAction files_sdk.FileAction, err error)
- func RetryByPolicy(ctx context.Context, job *status.Job, policy RetryPolicy, signalEvents bool)
- func RetryByStatus(ctx context.Context, job *status.Job, signalEvents bool, s ...status.Status)
- func SetJobParams(r *status.Job, d direction.Direction, params interface{})
- func Update(ctx context.Context, params files_sdk.FileUpdateParams, ...) (file files_sdk.File, err error)
- type Client
- func (c *Client) BeginUpload(ctx context.Context, params files_sdk.FileBeginUploadParams, ...) (fileUploadPartCollection files_sdk.FileUploadPartCollection, err error)
- func (c *Client) Copy(ctx context.Context, params files_sdk.FileCopyParams, ...) (fileAction files_sdk.FileAction, err error)
- func (c *Client) Create(ctx context.Context, params files_sdk.FileCreateParams, ...) (file files_sdk.File, err error)
- func (c *Client) Delete(ctx context.Context, params files_sdk.FileDeleteParams, ...) (err error)
- func (c *Client) Download(ctx context.Context, params files_sdk.FileDownloadParams, ...) (files_sdk.File, error)
- func (c *Client) DownloadRequestStatus(ctx context.Context, fileDownloadUrl string, downloadRequestId string, ...) (files_sdk.ResponseError, error)
- func (c *Client) DownloadRetry(ctx context.Context, job status.Job) *status.Job
- func (c *Client) DownloadToFile(ctx context.Context, params files_sdk.FileDownloadParams, filePath string) (files_sdk.File, error)
- func (c *Client) DownloadUri(ctx context.Context, params files_sdk.FileDownloadParams, ...) (files_sdk.File, error)
- func (c *Client) Downloader(ctx context.Context, params DownloaderParams) *status.Job
- func (c *Client) FileStats(ctx context.Context, file files_sdk.File) (files_sdk.File, error)
- func (c *Client) Find(ctx context.Context, params files_sdk.FileFindParams, ...) (file files_sdk.File, err error)
- func (c *Client) Get(ctx context.Context, Path string) (files_sdk.File, error)
- func (c *Client) ListFor(ctx context.Context, params files_sdk.FolderListForParams) (*folder.Iter, error)
- func (c *Client) ListForRecursive(ctx context.Context, params files_sdk.FolderListForParams) (lib.IterI, error)
- func (c *Client) Move(ctx context.Context, params files_sdk.FileMoveParams, ...) (fileAction files_sdk.FileAction, err error)
- func (c *Client) Update(ctx context.Context, params files_sdk.FileUpdateParams, ...) (file files_sdk.File, err error)
- func (c *Client) UploadIO(parentCtx context.Context, params UploadIOParams) (files_sdk.File, files_sdk.FileUploadPart, Parts, error)
- func (c *Client) UploadRetry(ctx context.Context, job status.Job) *status.Job
- func (c *Client) Uploader(ctx context.Context, params UploaderParams) *status.Job
- type DeleteSource
- type DownloadParts
- func (d *DownloadParts) FinalSize() int64
- func (d *DownloadParts) Init(file fs.File, info fs.FileInfo, globalWait goccm.ConcurrencyManager, ...) *DownloadParts
- func (d *DownloadParts) Run(ctx context.Context) error
- func (d *DownloadParts) SizeGuess() bool
- func (d *DownloadParts) TriggerFirstSuccess(status int)
- func (d *DownloadParts) WaitOnFirstSuccess() int
- type DownloadStatus
- func (d *DownloadStatus) Err() error
- func (d *DownloadStatus) File() files_sdk.File
- func (d *DownloadStatus) Id() string
- func (d *DownloadStatus) Job() *status.Job
- func (d *DownloadStatus) LastByte() time.Time
- func (d *DownloadStatus) LocalPath() string
- func (d *DownloadStatus) RecentError() error
- func (d *DownloadStatus) RemotePath() string
- func (d *DownloadStatus) SetFinalSize(written int64)
- func (d *DownloadStatus) SetStatus(s status.Status, err error)
- func (d *DownloadStatus) Size() (size int64)
- func (d *DownloadStatus) Status() status.Status
- func (d *DownloadStatus) TransferBytes() int64
- type DownloadUri
- type DownloadUriValid
- type DownloaderParams
- type Entity
- type FS
- type File
- func (f *File) Close() error
- func (f *File) Info() (goFs.FileInfo, error)
- func (f *File) Init() *File
- func (f *File) IsDir() bool
- func (f *File) Name() string
- func (f *File) Read(b []byte) (n int, err error)
- func (f *File) ReadAt(p []byte, off int64) (n int, err error)
- func (f *File) ReaderRange(off int64, end int64) (r io.ReadCloser, err error)
- func (f *File) Stat() (goFs.FileInfo, error)
- func (f *File) Type() goFs.FileMode
- func (f *File) WithContext(ctx context.Context) interface{}
- type Info
- type MoveSource
- type OffSet
- type Part
- type Parts
- type PossibleSize
- type ProxyReader
- type ReadDirFile
- type ReaderRange
- type RetryPolicy
- type UntrustedSize
- type UploadIOParams
- type UploadStatus
- func (u *UploadStatus) Err() error
- func (u *UploadStatus) File() files_sdk.File
- func (u *UploadStatus) Id() string
- func (u *UploadStatus) Job() *status.Job
- func (u *UploadStatus) LastByte() time.Time
- func (u *UploadStatus) LocalPath() string
- func (u *UploadStatus) RecentError() error
- func (u *UploadStatus) RemotePath() string
- func (u *UploadStatus) SetStatus(s status.Status, err error)
- func (u *UploadStatus) SetUploadedBytes(b int64)
- func (u *UploadStatus) Size() int64
- func (u *UploadStatus) Status() status.Status
- func (u *UploadStatus) TransferBytes() int64
- type Uploader
- type UploaderParams
- type WithContext
Constants ¶
View Source
const ( DownloadPartChunkSize = int64(1024 * 1024 * 5) DownloadPartLimit = 15 DownloadPartLimitForSizeGuess = 10 )
View Source
const ( NotRun = iota RunSuccess RunError )
View Source
const ( RetryAll = RetryPolicy("RetryAll") RetryUnfinished = RetryPolicy("RetryUnfinished") RetryErroredIfSomeCompleted = RetryPolicy("RetryErroredIfSomeCompleted") )
Variables ¶
This section is empty.
Functions ¶
func BeginUpload ¶
func BeginUpload(ctx context.Context, params files_sdk.FileBeginUploadParams, opts ...files_sdk.RequestResponseOption) (fileUploadPartCollection files_sdk.FileUploadPartCollection, err error)
func Copy ¶
func Copy(ctx context.Context, params files_sdk.FileCopyParams, opts ...files_sdk.RequestResponseOption) (fileAction files_sdk.FileAction, err error)
func Create ¶
func Create(ctx context.Context, params files_sdk.FileCreateParams, opts ...files_sdk.RequestResponseOption) (file files_sdk.File, err error)
func Delete ¶
func Delete(ctx context.Context, params files_sdk.FileDeleteParams, opts ...files_sdk.RequestResponseOption) (err error)
func Find ¶
func Find(ctx context.Context, params files_sdk.FileFindParams, opts ...files_sdk.RequestResponseOption) (file files_sdk.File, err error)
func Move ¶
func Move(ctx context.Context, params files_sdk.FileMoveParams, opts ...files_sdk.RequestResponseOption) (fileAction files_sdk.FileAction, err error)
func RetryByPolicy ¶
func RetryByStatus ¶
Types ¶
type Client ¶
func (*Client) BeginUpload ¶
func (c *Client) BeginUpload(ctx context.Context, params files_sdk.FileBeginUploadParams, opts ...files_sdk.RequestResponseOption) (fileUploadPartCollection files_sdk.FileUploadPartCollection, err error)
func (*Client) Copy ¶
func (c *Client) Copy(ctx context.Context, params files_sdk.FileCopyParams, opts ...files_sdk.RequestResponseOption) (fileAction files_sdk.FileAction, err error)
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, params files_sdk.FileCreateParams, opts ...files_sdk.RequestResponseOption) (file files_sdk.File, err error)
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, params files_sdk.FileDeleteParams, opts ...files_sdk.RequestResponseOption) (err error)
func (*Client) Download ¶
func (c *Client) Download(ctx context.Context, params files_sdk.FileDownloadParams, opts ...files_sdk.RequestResponseOption) (files_sdk.File, error)
func (*Client) DownloadRequestStatus ¶
func (c *Client) DownloadRequestStatus(ctx context.Context, fileDownloadUrl string, downloadRequestId string, opts ...files_sdk.RequestResponseOption) (files_sdk.ResponseError, error)
func (*Client) DownloadRetry ¶
func (*Client) DownloadToFile ¶
func (*Client) DownloadUri ¶
func (c *Client) DownloadUri(ctx context.Context, params files_sdk.FileDownloadParams, opts ...files_sdk.RequestResponseOption) (files_sdk.File, error)
func (*Client) Downloader ¶
func (*Client) FileStats ¶
File{}.Size and File{}.Mtime are not always up to date. This calls HEAD on File{}.DownloadUri to get the latest info. Some Download URLs won't support HEAD. In this case the size is reported as -1. The size can be known post download using Client{}.DownloadRequestStatus. This applies to the remote mount types FTP, SFTP, and WebDAV.
func (*Client) Find ¶
func (c *Client) Find(ctx context.Context, params files_sdk.FileFindParams, opts ...files_sdk.RequestResponseOption) (file files_sdk.File, err error)
func (*Client) ListForRecursive ¶
func (*Client) Move ¶
func (c *Client) Move(ctx context.Context, params files_sdk.FileMoveParams, opts ...files_sdk.RequestResponseOption) (fileAction files_sdk.FileAction, err error)
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, params files_sdk.FileUpdateParams, opts ...files_sdk.RequestResponseOption) (file files_sdk.File, err error)
func (*Client) UploadIO ¶
func (c *Client) UploadIO(parentCtx context.Context, params UploadIOParams) (files_sdk.File, files_sdk.FileUploadPart, Parts, error)
func (*Client) UploadRetry ¶
type DeleteSource ¶
DeleteSource files after a sync
job.RegisterFileEvent(func(file status.File) { log, err := file.DeleteSource{Direction: f.Direction, Config: config}.Call(ctx, f) }, status.Complete, status.Skipped)
type DownloadParts ¶
type DownloadParts struct { context.CancelFunc context.Context fs.File fs.FileInfo lib.WriterAndAt CloseError error files_sdk.Config // contains filtered or unexported fields }
func (*DownloadParts) FinalSize ¶
func (d *DownloadParts) FinalSize() int64
func (*DownloadParts) Init ¶
func (d *DownloadParts) Init(file fs.File, info fs.FileInfo, globalWait goccm.ConcurrencyManager, writer lib.WriterAndAt, config files_sdk.Config) *DownloadParts
func (*DownloadParts) SizeGuess ¶
func (d *DownloadParts) SizeGuess() bool
func (*DownloadParts) TriggerFirstSuccess ¶
func (d *DownloadParts) TriggerFirstSuccess(status int)
func (*DownloadParts) WaitOnFirstSuccess ¶
func (d *DownloadParts) WaitOnFirstSuccess() int
type DownloadStatus ¶
type DownloadStatus struct { fs.FS fs.FileInfo DownloadedBytes int64 Sync bool Mutex *sync.RWMutex PreserveTimes bool // contains filtered or unexported fields }
func (*DownloadStatus) Err ¶
func (d *DownloadStatus) Err() error
func (*DownloadStatus) File ¶
func (d *DownloadStatus) File() files_sdk.File
func (*DownloadStatus) Id ¶
func (d *DownloadStatus) Id() string
func (*DownloadStatus) Job ¶
func (d *DownloadStatus) Job() *status.Job
func (*DownloadStatus) LastByte ¶
func (d *DownloadStatus) LastByte() time.Time
func (*DownloadStatus) LocalPath ¶
func (d *DownloadStatus) LocalPath() string
func (*DownloadStatus) RecentError ¶
func (d *DownloadStatus) RecentError() error
func (*DownloadStatus) RemotePath ¶
func (d *DownloadStatus) RemotePath() string
func (*DownloadStatus) SetFinalSize ¶
func (d *DownloadStatus) SetFinalSize(written int64)
func (*DownloadStatus) Size ¶
func (d *DownloadStatus) Size() (size int64)
func (*DownloadStatus) Status ¶
func (d *DownloadStatus) Status() status.Status
func (*DownloadStatus) TransferBytes ¶
func (d *DownloadStatus) TransferBytes() int64
type DownloadUri ¶
type DownloadUri string
func (DownloadUri) Valid ¶
func (d DownloadUri) Valid(within time.Duration) (s DownloadUriValid, valid bool, err error)
type DownloaderParams ¶
type FS ¶
type FS struct { files_sdk.Config context.Context Root string // contains filtered or unexported fields }
func (*FS) ClearCache ¶
func (f *FS) ClearCache()
func (*FS) WithContext ¶
type File ¶
type File struct { *files_sdk.File *FS io.ReadCloser // contains filtered or unexported fields }
func (*File) ReaderRange ¶
func (*File) WithContext ¶
type MoveSource ¶
MoveSource files after a sync
job.RegisterFileEvent(func(file status.File) { log, err := file.MoveSource{Direction: f.Direction, Config: config}.Call(ctx, f) }, status.Complete, status.Skipped)
type Part ¶
type Part struct { OffSet context.Context context.CancelFunc // contains filtered or unexported fields }
func (*Part) Successful ¶
type PossibleSize ¶
type PossibleSize interface {
PossibleSize() int64
}
type ProxyReader ¶
func (*ProxyReader) Close ¶
func (x *ProxyReader) Close() error
func (*ProxyReader) Len ¶
func (x *ProxyReader) Len() int
type ReadDirFile ¶
type ReadDirFile struct { *File // contains filtered or unexported fields }
type ReaderRange ¶
type ReaderRange interface {
ReaderRange(off int64, end int64) (io.ReadCloser, error)
}
type RetryPolicy ¶
type RetryPolicy string
type UntrustedSize ¶
type UntrustedSize interface {
UntrustedSize() bool
}
type UploadIOParams ¶
type UploadStatus ¶
type UploadStatus struct { Sync bool Uploader Parts files_sdk.FileUploadPart Mutex *sync.RWMutex // contains filtered or unexported fields }
func (*UploadStatus) Err ¶
func (u *UploadStatus) Err() error
func (*UploadStatus) File ¶
func (u *UploadStatus) File() files_sdk.File
func (*UploadStatus) Id ¶
func (u *UploadStatus) Id() string
func (*UploadStatus) Job ¶
func (u *UploadStatus) Job() *status.Job
func (*UploadStatus) LastByte ¶
func (u *UploadStatus) LastByte() time.Time
func (*UploadStatus) LocalPath ¶
func (u *UploadStatus) LocalPath() string
func (*UploadStatus) RecentError ¶
func (u *UploadStatus) RecentError() error
func (*UploadStatus) RemotePath ¶
func (u *UploadStatus) RemotePath() string
func (*UploadStatus) SetUploadedBytes ¶
func (u *UploadStatus) SetUploadedBytes(b int64)
func (*UploadStatus) Size ¶
func (u *UploadStatus) Size() int64
func (*UploadStatus) Status ¶
func (u *UploadStatus) Status() status.Status
func (*UploadStatus) TransferBytes ¶
func (u *UploadStatus) TransferBytes() int64
type Uploader ¶
type Uploader interface { UploadIO(context.Context, UploadIOParams) (files_sdk.File, files_sdk.FileUploadPart, Parts, error) Find(context.Context, files_sdk.FileFindParams, ...files_sdk.RequestResponseOption) (files_sdk.File, error) }
type UploaderParams ¶
type WithContext ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.