registry/client: use struct literals
Remove some intermediate variables, and use struct literals instead. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
d71ad5b3a6
commit
1d8cd5e443
1 changed files with 13 additions and 16 deletions
|
@ -138,16 +138,14 @@ func NewRepository(name reference.Named, baseURL string, transport http.RoundTri
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &http.Client{
|
|
||||||
Transport: transport,
|
|
||||||
CheckRedirect: checkHTTPRedirect,
|
|
||||||
// TODO(dmcgowan): create cookie jar
|
|
||||||
}
|
|
||||||
|
|
||||||
return &repository{
|
return &repository{
|
||||||
client: client,
|
client: &http.Client{
|
||||||
ub: ub,
|
Transport: transport,
|
||||||
name: name,
|
CheckRedirect: checkHTTPRedirect,
|
||||||
|
// TODO(dmcgowan): create cookie jar
|
||||||
|
},
|
||||||
|
ub: ub,
|
||||||
|
name: name,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,16 +160,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{
|
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(memory.UnlimitedSize), &blobStatter{
|
||||||
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(memory.UnlimitedSize), statter),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue