Comment more packages to pass go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -47,6 +47,7 @@ type Converter struct {
|
||||
layerBlobs map[digest.Digest]ocispec.Descriptor
|
||||
}
|
||||
|
||||
// NewConverter returns a new converter
|
||||
func NewConverter(contentStore content.Store, fetcher remotes.Fetcher) *Converter {
|
||||
return &Converter{
|
||||
contentStore: contentStore,
|
||||
@@ -56,6 +57,7 @@ func NewConverter(contentStore content.Store, fetcher remotes.Fetcher) *Converte
|
||||
}
|
||||
}
|
||||
|
||||
// Handle fetching descriptors for a docker media type
|
||||
func (c *Converter) Handle(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
|
||||
switch desc.MediaType {
|
||||
case images.MediaTypeDockerSchema1Manifest:
|
||||
@@ -101,6 +103,7 @@ func (c *Converter) Handle(ctx context.Context, desc ocispec.Descriptor) ([]ocis
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a docker manifest to an OCI descriptor
|
||||
func (c *Converter) Convert(ctx context.Context) (ocispec.Descriptor, error) {
|
||||
history, diffIDs, err := c.schema1ManifestHistory()
|
||||
if err != nil {
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Status of a content operation
|
||||
type Status struct {
|
||||
content.Status
|
||||
|
||||
@@ -15,6 +16,7 @@ type Status struct {
|
||||
UploadUUID string
|
||||
}
|
||||
|
||||
// StatusTracker to track status of operations
|
||||
type StatusTracker interface {
|
||||
GetStatus(string) (Status, error)
|
||||
SetStatus(string, Status)
|
||||
@@ -25,6 +27,7 @@ type memoryStatusTracker struct {
|
||||
m sync.Mutex
|
||||
}
|
||||
|
||||
// NewInMemoryTracker returns a StatusTracker that tracks content status in-memory
|
||||
func NewInMemoryTracker() StatusTracker {
|
||||
return &memoryStatusTracker{
|
||||
statuses: map[string]Status{},
|
||||
|
||||
@@ -32,11 +32,13 @@ type Resolver interface {
|
||||
Pusher(ctx context.Context, ref string) (Pusher, error)
|
||||
}
|
||||
|
||||
// Fetcher fetches content
|
||||
type Fetcher interface {
|
||||
// Fetch the resource identified by the descriptor.
|
||||
Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)
|
||||
}
|
||||
|
||||
// Pusher pushes content
|
||||
type Pusher interface {
|
||||
// Push returns a content writer for the given resource identified
|
||||
// by the descriptor.
|
||||
@@ -47,6 +49,7 @@ type Pusher interface {
|
||||
// function.
|
||||
type FetcherFunc func(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error)
|
||||
|
||||
// Fetch content
|
||||
func (fn FetcherFunc) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.ReadCloser, error) {
|
||||
return fn(ctx, desc)
|
||||
}
|
||||
@@ -55,6 +58,7 @@ func (fn FetcherFunc) Fetch(ctx context.Context, desc ocispec.Descriptor) (io.Re
|
||||
// function.
|
||||
type PusherFunc func(ctx context.Context, desc ocispec.Descriptor, r io.Reader) error
|
||||
|
||||
func (fn PusherFunc) Pusher(ctx context.Context, desc ocispec.Descriptor, r io.Reader) error {
|
||||
// Push content
|
||||
func (fn PusherFunc) Push(ctx context.Context, desc ocispec.Descriptor, r io.Reader) error {
|
||||
return fn(ctx, desc, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user