Documentation
¶
Overview ¶
Command postprocess applies transformations to generated.go to fix conflicts introduced by oapi-codegen that cannot be resolved via configuration alone.
Transformations applied:
- Rename symbols that conflict with the public API of this package (ClientOption, NewClient, WithHTTPClient, WithBaseURL, PrometheusRule, and the PrometheusResultType "string" enum value, which oapi-codegen names String and would clash with the hand-written String helper). oapi-codegen does not provide a configuration option to rename these. Selector members (e.g. url.URL.String()) are left untouched so the rename never rewrites a method or field access on a different type.
- Remove deprecated fields from PrometheusAlertRule (Description, Summary, and the deprecated KeepFiringFor) since these have been replaced by annotations and the snake_case keep_firing_for field respectively.
- Strip YAML handling (the gopkg.in/yaml.v2 import, response struct fields named YAML*, and switch cases that call yaml.Unmarshal). The root package must not depend on any YAML library; YAML support belongs in the yaml/ subpackage, and the TestNoYAMLDependency guard test enforces this.
Usage: go run ./tools/postprocess generated.go
Click to show internal directories.
Click to hide internal directories.