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

Function WithExcludeTypes

private/bufpkg/bufimage/bufimageutil/bufimageutil.go:149–158  ·  view source on GitHub ↗

WithExcludeTypes returns an option for FilterImage that specifies the set of types that should be excluded from 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 pac

(typeNames ...string)

Source from the content-addressed store, hash-verified

147// If the type does not exist in the image, an error wrapping
148// [ErrImageFilterTypeNotFound] will be returned.
149func WithExcludeTypes(typeNames ...string) ImageFilterOption {
150 return func(opts *imageFilterOptions) {
151 if len(typeNames) > 0 && opts.excludeTypes == nil {
152 opts.excludeTypes = make(map[string]struct{}, len(typeNames))
153 }
154 for _, typeName := range typeNames {
155 opts.excludeTypes[typeName] = struct{}{}
156 }
157 }
158}
159
160// WithMutateInPlace returns an option for FilterImage that specifies
161// that the filtered image should be mutated in place. This option is useful when the

Callers 14

execPluginsMethod · 0.92
filterImageFunction · 0.92
TestTypesFunction · 0.85
TestNestingFunction · 0.85
TestOneofFunction · 0.85
TestOptionsFunction · 0.85
TestOptionImportsFunction · 0.85
TestPackagesFunction · 0.85
TestVersionedPackagesFunction · 0.85
TestUnusedDepsFunction · 0.85
TestConsecutiveFiltersFunction · 0.85
TestDependenciesFunction · 0.85

Calls

no outgoing calls

Tested by 12

TestTypesFunction · 0.68
TestNestingFunction · 0.68
TestOneofFunction · 0.68
TestOptionsFunction · 0.68
TestOptionImportsFunction · 0.68
TestPackagesFunction · 0.68
TestVersionedPackagesFunction · 0.68
TestUnusedDepsFunction · 0.68
TestConsecutiveFiltersFunction · 0.68
TestDependenciesFunction · 0.68
TestEmptyFilesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…