MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / pbReferrerItemToAction

Function pbReferrerItemToAction

app/cli/pkg/action/referrer_discover.go:104–125  ·  view source on GitHub ↗
(in *pb.ReferrerItem)

Source from the content-addressed store, hash-verified

102}
103
104func pbReferrerItemToAction(in *pb.ReferrerItem) *ReferrerItem {
105 if in == nil {
106 return nil
107 }
108
109 out := &ReferrerItem{
110 Digest: in.GetDigest(),
111 Downloadable: in.GetDownloadable(),
112 Public: in.GetPublic(),
113 Kind: in.GetKind(),
114 CreatedAt: toTimePtr(in.GetCreatedAt().AsTime()),
115 References: make([]*ReferrerItem, 0, len(in.GetReferences())),
116 Metadata: in.GetMetadata(),
117 Annotations: in.GetAnnotations(),
118 }
119
120 for _, r := range in.GetReferences() {
121 out.References = append(out.References, pbReferrerItemToAction(r))
122 }
123
124 return out
125}

Callers 1

Calls 9

GetDownloadableMethod · 0.80
GetReferencesMethod · 0.80
toTimePtrFunction · 0.70
GetMetadataMethod · 0.65
GetAnnotationsMethod · 0.65
GetDigestMethod · 0.45
GetPublicMethod · 0.45
GetKindMethod · 0.45
GetCreatedAtMethod · 0.45

Tested by

no test coverage detected