Skip to content

Commit

Permalink
Move identifier to separate file (to match other packages)
Browse files Browse the repository at this point in the history
Signed-off-by: Natalie Arellano <[email protected]>
  • Loading branch information
natalieparellano committed Apr 2, 2024
1 parent bfc04ad commit 2efba06
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 9 additions & 0 deletions local/identifier.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package local

type IDIdentifier struct {
ImageID string
}

func (i IDIdentifier) String() string {
return i.ImageID
}
10 changes: 1 addition & 9 deletions local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@ func (i *Image) Found() bool {

func (i *Image) Identifier() (imgutil.Identifier, error) {
return IDIdentifier{
id: strings.TrimPrefix(i.lastIdentifier, "sha256:"),
ImageID: strings.TrimPrefix(i.lastIdentifier, "sha256:"),
}, nil
}

type IDIdentifier struct {
id string
}

func (i IDIdentifier) String() string {
return i.id
}

// GetLayer returns an io.ReadCloser with uncompressed layer data.
// The layer will always have data, even if that means downloading ALL the image layers from the daemon.
func (i *Image) GetLayer(diffID string) (io.ReadCloser, error) {
Expand Down

0 comments on commit 2efba06

Please sign in to comment.