mirror of
https://github.com/distribution/distribution.git
synced 2025-06-27 15:59:04 +00:00
registry/client: use struct literals
Remove some intermediate variables, and use struct literals instead.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 1d8cd5e443
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1be402c953
commit
bb33a43c74
@ -135,14 +135,12 @@ func NewRepository(name reference.Named, baseURL string, transport http.RoundTri
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{
|
return &repository{
|
||||||
|
client: &http.Client{
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
CheckRedirect: checkHTTPRedirect,
|
CheckRedirect: checkHTTPRedirect,
|
||||||
// TODO(dmcgowan): create cookie jar
|
// TODO(dmcgowan): create cookie jar
|
||||||
}
|
},
|
||||||
|
|
||||||
return &repository{
|
|
||||||
client: client,
|
|
||||||
ub: ub,
|
ub: ub,
|
||||||
name: name,
|
name: name,
|
||||||
}, nil
|
}, nil
|
||||||
@ -159,16 +157,15 @@ func (r *repository) Named() reference.Named {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *repository) Blobs(ctx context.Context) distribution.BlobStore {
|
func (r *repository) Blobs(ctx context.Context) distribution.BlobStore {
|
||||||
statter := &blobStatter{
|
|
||||||
name: r.name,
|
|
||||||
ub: r.ub,
|
|
||||||
client: r.client,
|
|
||||||
}
|
|
||||||
return &blobs{
|
return &blobs{
|
||||||
name: r.name,
|
name: r.name,
|
||||||
ub: r.ub,
|
ub: r.ub,
|
||||||
client: r.client,
|
client: r.client,
|
||||||
statter: cache.NewCachedBlobStatter(memory.NewInMemoryBlobDescriptorCacheProvider(), statter),
|
statter: cache.NewCachedBlobStatter(memory.NewInMemoryBlobDescriptorCacheProvider(), &blobStatter{
|
||||||
|
name: r.name,
|
||||||
|
ub: r.ub,
|
||||||
|
client: r.client,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user