Skip to content

Types

A string type representing a generator category to filter.

type FilterOption string
  • String() string — returns the underlying string value
  • Reason() (FilterReason, bool) — returns the corresponding FilterReason. Returns ("", false) for meta-options like FilterAll or unregistered options.
  • IsValid() bool — reports whether the value is recognized

FilterSQLC, FilterTempl, FilterGoEnum, FilterProtobuf, FilterOapi, FilterDeepcopy, FilterWire, FilterMoq, FilterMockgen, FilterStringer, FilterGeneric, FilterAll

A string type representing why a file was filtered.

type FilterReason string
  • String() string — returns the underlying string value
  • IsValid() bool — reports whether the value is recognized

ReasonSQLC, ReasonTempl, ReasonGoEnum, ReasonProtobuf, ReasonOapi, ReasonDeepcopy, ReasonWire, ReasonMoq, ReasonMockgen, ReasonStringer, ReasonGeneric, ReasonOutsideScope, ReasonExcludePattern, ReasonNotFiltered

Returns all 12 valid FilterOption values (11 detector options + FilterAll).

Returns all 11 detector FilterOption values (excludes FilterAll). Use when enumerating available generators rather than validating options.

Returns all 14 valid FilterReason values.

All three are derived from the internal detectors table — AllFilterOptions() also includes FilterAll, and AllFilterReasons() also includes ReasonOutsideScope, ReasonExcludePattern, and ReasonNotFiltered.

A functional option type for configuring a Filter via NewFilter.

type FilterConfig func(*Filter) error

Created by WithFilterOptions, WithFS, WithIncludePatterns, and WithExcludePatterns. Passed to NewFilter(configs ...FilterConfig).

Each FilterOption and its matching FilterReason share the same underlying string value (e.g., FilterSQLC == "sqlc" == ReasonSQLC).