Documentation ¶
Index ¶
- func NewLocalToDropboxBatch(ctl app_control.Control, ctx dbx_context.Context, batchSize int) es_filesystem.Connector
- func StartBatchSessions(qd eq_queue.Definition, ctx dbx_context.Context, batchSize int) (BatchSessions, BlockSession)
- type BatchSessions
- type BlockSession
- type CommitInfo
- type CopyBatchUploadBlock
- type FinishBatch
- type SessionCallback
- type SessionCheck
- type SessionId
- type UploadAppend
- type UploadCursor
- type UploadFinish
- type UploadFinishBatch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLocalToDropboxBatch ¶
func NewLocalToDropboxBatch(ctl app_control.Control, ctx dbx_context.Context, batchSize int) es_filesystem.Connector
func StartBatchSessions ¶
func StartBatchSessions(qd eq_queue.Definition, ctx dbx_context.Context, batchSize int) (BatchSessions, BlockSession)
Types ¶
type BatchSessions ¶
type BatchSessions interface { // NewSession Start a new session with the commit information. // The operation might blocked depends on the backlog size. NewSession(commit CommitInfo, callback SessionCallback) (sessionId string, err error) // AbortSession Abort uploading session for the session Id. // The sessionId will be removed from the batch. // The func callbacks OnFailure event. AbortSession(sessionId string, err error) // FinishBlockUploads Report finish for all block uploads. // The func should not block the operation. FinishBlockUploads(sessionId string) // Shutdown Flush and finish all sessions. // The operation might blocked when the backlog exists. Shutdown() (err dbx_error.DropboxError) // FinishBatchCommit Process upload session commit. FinishBatchCommit(batch *FinishBatch) // FinishBatchEntry Entry upload session commit batch. FinishBatchEntry(count int) }
type BlockSession ¶
type BlockSession interface { // AddBlock Add block AddBlock(sessionId string, offset int64) // FinishSuccess Tell finish operation FinishSuccess(sessionId string, offset int64) // FinishFailure Tell failure FinishFailure(sessionId string, err error) }
func NewBlockSession ¶
func NewBlockSession(ctx dbx_context.Context, bs BatchSessions) BlockSession
type CommitInfo ¶
type CopyBatchUploadBlock ¶
type FinishBatch ¶
type FinishBatch struct {
Batch []string `json:"batch"`
}
type SessionCallback ¶
type SessionCallback struct { CopyPair es_filesystem.CopyPair OnSuccess func(pair es_filesystem.CopyPair, copied es_filesystem.Entry) OnFailure func(pair es_filesystem.CopyPair, err es_filesystem.FileSystemError) }
type SessionCheck ¶
type UploadAppend ¶
type UploadAppend struct { Cursor UploadCursor `json:"cursor"` Close bool `json:"close"` }
type UploadCursor ¶
type UploadFinish ¶
type UploadFinish struct { Cursor UploadCursor `json:"cursor"` Commit CommitInfo `json:"commit"` }
type UploadFinishBatch ¶
type UploadFinishBatch struct {
Entries []UploadFinish `json:"entries"`
}
Click to show internal directories.
Click to hide internal directories.