1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

distribution/xfer: use "transferManager" in godoc

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-01-22 12:56:42 +01:00
parent 874b11495b
commit 587c474b57
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -63,7 +63,7 @@ type transfer struct {
// running remains open as long as the transfer is in progress. // running remains open as long as the transfer is in progress.
running chan struct{} running chan struct{}
// released stays open until all watchers release the transfer and // released stays open until all watchers release the transfer and
// the transfer is no longer tracked by the transfer manager. // the transfer is no longer tracked by the transferManager.
released chan struct{} released chan struct{}
// broadcastDone is true if the main progress channel has closed. // broadcastDone is true if the main progress channel has closed.
@ -242,7 +242,7 @@ func (t *transfer) Done() <-chan struct{} {
} }
// Released returns a channel which is closed once all watchers release the // Released returns a channel which is closed once all watchers release the
// transfer AND the transfer is no longer tracked by the transfer manager. // transfer AND the transfer is no longer tracked by the transferManager.
func (t *transfer) Released() <-chan struct{} { func (t *transfer) Released() <-chan struct{} {
return t.released return t.released
} }
@ -252,7 +252,7 @@ func (t *transfer) Context() context.Context {
return t.ctx return t.ctx
} }
// Close is called by the transfer manager when the transfer is no longer // Close is called by the transferManager when the transfer is no longer
// being tracked. // being tracked.
func (t *transfer) Close() { func (t *transfer) Close() {
t.mu.Lock() t.mu.Lock()
@ -263,10 +263,10 @@ func (t *transfer) Close() {
t.mu.Unlock() t.mu.Unlock()
} }
// DoFunc is a function called by the transfer manager to actually perform // DoFunc is a function called by the transferManager to actually perform
// a transfer. It should be non-blocking. It should wait until the start channel // a transfer. It should be non-blocking. It should wait until the start channel
// is closed before transferring any data. If the function closes inactive, that // is closed before transferring any data. If the function closes inactive, that
// signals to the transfer manager that the job is no longer actively moving // signals to the transferManager that the job is no longer actively moving
// data - for example, it may be waiting for a dependent transfer to finish. // data - for example, it may be waiting for a dependent transfer to finish.
// This prevents it from taking up a slot. // This prevents it from taking up a slot.
type DoFunc func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer type DoFunc func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer