MCPcopy
hub / github.com/aquasecurity/trivy / PutArtifact

Method PutArtifact

pkg/cache/remote.go:48–56  ·  view source on GitHub ↗

PutArtifact sends artifact to remote client

(ctx context.Context, imageID string, artifactInfo types.ArtifactInfo)

Source from the content-addressed store, hash-verified

46
47// PutArtifact sends artifact to remote client
48func (c RemoteCache) PutArtifact(ctx context.Context, imageID string, artifactInfo types.ArtifactInfo) error {
49 _, err := rpc.Retry(ctx, func() (*emptypb.Empty, error) {
50 return c.client.PutArtifact(c.ctx, rpc.ConvertToRPCArtifactInfo(imageID, artifactInfo))
51 })
52 if err != nil {
53 return xerrors.Errorf("unable to store cache on the server: %w", err)
54 }
55 return nil
56}
57
58// PutBlob sends blobInfo to remote client
59func (c RemoteCache) PutBlob(ctx context.Context, diffID string, blobInfo types.BlobInfo) error {

Calls 3

RetryFunction · 0.92
ConvertToRPCArtifactInfoFunction · 0.92
PutArtifactMethod · 0.65

Tested by 2