Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add internal/imagesource/impl.NoSignatures, use it to reduce boilerplate
Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
- Loading branch information
Showing
5 changed files
with
22 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package impl | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/opencontainers/go-digest" | ||
) | ||
|
||
// NoSignatures implements GetSignatures() that returns nothing. | ||
type NoSignatures struct{} | ||
|
||
// GetSignatures returns the image's signatures. It may use a remote (= slow) service. | ||
// If instanceDigest is not nil, it contains a digest of the specific manifest instance to retrieve signatures for | ||
// (when the primary manifest is a manifest list); this never happens if the primary manifest is not a manifest list | ||
// (e.g. if the source never returns manifest lists). | ||
func (stub NoSignatures) GetSignatures(ctx context.Context, instanceDigest *digest.Digest) ([][]byte, error) { | ||
return nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters