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

Function WithIncludeTypes

private/bufpkg/bufimage/bufimageutil/bufimageutil.go:122–131  ·  view source on GitHub ↗

WithIncludeTypes returns an option for FilterImage that specifies the set of types that should be included in the filtered image. May be provided multiple times. The type names should be fully qualified. For example, "google.protobuf.Any" or "buf.validate". Types may be nested, and can be any packa

(typeNames ...string)

Source from the content-addressed store, hash-verified

120// If the type does not exist in the image, an error wrapping
121// [ErrImageFilterTypeNotFound] will be returned.
122func WithIncludeTypes(typeNames ...string) ImageFilterOption {
123 return func(opts *imageFilterOptions) {
124 if len(typeNames) > 0 && opts.includeTypes == nil {
125 opts.includeTypes = make(map[string]struct{}, len(typeNames))
126 }
127 for _, typeName := range typeNames {
128 opts.includeTypes[typeName] = struct{}{}
129 }
130 }
131}
132
133// WithExcludeTypes returns an option for FilterImage that
134// specifies the set of types that should be excluded from the filtered image.

Callers 15

runFunction · 0.92
wellKnownTypeImageFunction · 0.92
execPluginsMethod · 0.92
filterImageFunction · 0.92
TestTypesFunction · 0.85
TestNestingFunction · 0.85
TestOneofFunction · 0.85
TestOptionsFunction · 0.85
TestOptionImportsFunction · 0.85
TestImportModifiersFunction · 0.85
TestExtensionsFunction · 0.85
TestPackagesFunction · 0.85

Calls

no outgoing calls

Tested by 15

TestTypesFunction · 0.68
TestNestingFunction · 0.68
TestOneofFunction · 0.68
TestOptionsFunction · 0.68
TestOptionImportsFunction · 0.68
TestImportModifiersFunction · 0.68
TestExtensionsFunction · 0.68
TestPackagesFunction · 0.68
TestVersionedPackagesFunction · 0.68
TestAnyFunction · 0.68
TestUnusedDepsFunction · 0.68
TestTransitivePublicFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…