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)
| 120 | // If the type does not exist in the image, an error wrapping |
| 121 | // [ErrImageFilterTypeNotFound] will be returned. |
| 122 | func 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. |
no outgoing calls
searching dependent graphs…