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

Function ImageToCodeGeneratorRequest

private/bufpkg/bufimage/bufimage.go:585–601  ·  view source on GitHub ↗

ImageToCodeGeneratorRequest returns a new CodeGeneratorRequest for the Image. All non-imports are added as files to generate. If includeImports is set, all non-well-known-type imports are also added as files to generate. If includeWellKnownTypes is set, well-known-type imports are also added as fil

(
	image Image,
	parameter string,
	compilerVersion *pluginpb.Version,
	includeImports bool,
	includeWellKnownTypes bool,
)

Source from the content-addressed store, hash-verified

583// If includeWellKnownTypes is set, well-known-type imports are also added as files to generate.
584// includeWellKnownTypes has no effect if includeImports is not set.
585func ImageToCodeGeneratorRequest(
586 image Image,
587 parameter string,
588 compilerVersion *pluginpb.Version,
589 includeImports bool,
590 includeWellKnownTypes bool,
591) (*pluginpb.CodeGeneratorRequest, error) {
592 return imageToCodeGeneratorRequest(
593 image,
594 parameter,
595 compilerVersion,
596 includeImports,
597 includeWellKnownTypes,
598 nil,
599 nil,
600 )
601}
602
603// ImagesToCodeGeneratorRequests converts the Images to CodeGeneratorRequests.
604//

Callers 2

testBuildRequestFunction · 0.92
TestBasicFunction · 0.92

Calls 1

Tested by 2

testBuildRequestFunction · 0.74
TestBasicFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…