MCPcopy Create free account
hub / github.com/bufbuild/buf / ImageToProtoImage

Function ImageToProtoImage

private/bufpkg/bufimage/bufimage.go:554–567  ·  view source on GitHub ↗

ImageToProtoImage returns a new ProtoImage for the Image.

(image Image)

Source from the content-addressed store, hash-verified

552
553// ImageToProtoImage returns a new ProtoImage for the Image.
554func ImageToProtoImage(image Image) (*imagev1.Image, error) {
555 imageFiles := image.Files()
556 protoImage := imagev1.Image_builder{
557 File: make([]*imagev1.ImageFile, len(imageFiles)),
558 }.Build()
559 for i, imageFile := range imageFiles {
560 protoImageFile, err := imageFileToProtoImageFile(imageFile)
561 if err != nil {
562 return nil, err
563 }
564 protoImage.GetFile()[i] = protoImageFile
565 }
566 return protoImage, nil
567}
568
569// ImageToFileDescriptorSet returns a new FileDescriptorSet for the Image.
570func ImageToFileDescriptorSet(image Image) *descriptorpb.FileDescriptorSet {

Callers 5

runFilterImageFunction · 0.92
TestBasicFunction · 0.92
execRemotePluginsV2Method · 0.92
PutImageMethod · 0.92
TestCloneImageFunction · 0.85

Calls 4

FilesMethod · 0.65
BuildMethod · 0.65
GetFileMethod · 0.65

Tested by 3

runFilterImageFunction · 0.74
TestBasicFunction · 0.74
TestCloneImageFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…