mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
distribution/xfer: un-export NewTransfer()
This is also only used internally, so no need to export. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
587c474b57
commit
765844e419
4 changed files with 11 additions and 11 deletions
|
@ -225,7 +225,7 @@ func (ldm *LayerDownloadManager) Download(ctx context.Context, initialRootFS ima
|
|||
func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor, parentLayer layer.ChainID, parentDownload *downloadTransfer) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer {
|
||||
d := &downloadTransfer{
|
||||
Transfer: NewTransfer(),
|
||||
Transfer: newTransfer(),
|
||||
layerStore: ldm.layerStore,
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,7 @@ func (ldm *LayerDownloadManager) makeDownloadFunc(descriptor DownloadDescriptor,
|
|||
func (ldm *LayerDownloadManager) makeDownloadFuncFromDownload(descriptor DownloadDescriptor, sourceDownload *downloadTransfer, parentDownload *downloadTransfer) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer {
|
||||
d := &downloadTransfer{
|
||||
Transfer: NewTransfer(),
|
||||
Transfer: newTransfer(),
|
||||
layerStore: ldm.layerStore,
|
||||
}
|
||||
|
||||
|
|
|
@ -77,8 +77,8 @@ type transfer struct {
|
|||
broadcastSyncChan chan struct{}
|
||||
}
|
||||
|
||||
// NewTransfer creates a new transfer.
|
||||
func NewTransfer() Transfer {
|
||||
// newTransfer creates a new transfer.
|
||||
func newTransfer() Transfer {
|
||||
t := &transfer{
|
||||
watchers: make(map[chan struct{}]*Watcher),
|
||||
running: make(chan struct{}),
|
||||
|
|
|
@ -17,7 +17,7 @@ func TestTransfer(t *testing.T) {
|
|||
t.Errorf("%s: transfer function not started even though concurrency limit not reached", id)
|
||||
}
|
||||
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
for i := 0; i <= 10; i++ {
|
||||
progressChan <- progress.Progress{ID: id, Action: "testing", Current: int64(i), Total: 10}
|
||||
|
@ -73,7 +73,7 @@ func TestConcurrencyLimit(t *testing.T) {
|
|||
|
||||
makeXferFunc := func(id string) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, _ chan<- struct{}) Transfer {
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
<-start
|
||||
totalJobs := atomic.AddInt32(&runningJobs, 1)
|
||||
|
@ -132,7 +132,7 @@ func TestInactiveJobs(t *testing.T) {
|
|||
|
||||
makeXferFunc := func(id string) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer {
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
<-start
|
||||
totalJobs := atomic.AddInt32(&runningJobs, 1)
|
||||
|
@ -192,7 +192,7 @@ func TestWatchRelease(t *testing.T) {
|
|||
|
||||
makeXferFunc := func(id string) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, _ chan<- struct{}) Transfer {
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
defer func() {
|
||||
close(progressChan)
|
||||
|
@ -281,7 +281,7 @@ func TestWatchRelease(t *testing.T) {
|
|||
func TestWatchFinishedTransfer(t *testing.T) {
|
||||
makeXferFunc := func(id string) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, _ <-chan struct{}, _ chan<- struct{}) Transfer {
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
// Finish immediately
|
||||
close(progressChan)
|
||||
|
@ -324,7 +324,7 @@ func TestDuplicateTransfer(t *testing.T) {
|
|||
makeXferFunc := func(id string) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, _ <-chan struct{}, _ chan<- struct{}) Transfer {
|
||||
atomic.AddInt32(&xferFuncCalls, 1)
|
||||
xfer := NewTransfer()
|
||||
xfer := newTransfer()
|
||||
go func() {
|
||||
defer func() {
|
||||
close(progressChan)
|
||||
|
|
|
@ -105,7 +105,7 @@ func (lum *LayerUploadManager) Upload(ctx context.Context, layers []UploadDescri
|
|||
func (lum *LayerUploadManager) makeUploadFunc(descriptor UploadDescriptor) DoFunc {
|
||||
return func(progressChan chan<- progress.Progress, start <-chan struct{}, inactive chan<- struct{}) Transfer {
|
||||
u := &uploadTransfer{
|
||||
Transfer: NewTransfer(),
|
||||
Transfer: newTransfer(),
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
|
Loading…
Add table
Reference in a new issue