nginxinc / nginx-go-crossplane

A library for working with NGINX configs in Go
Apache License 2.0
46 stars 12 forks source link

Command line code generator for supporting files #101

Closed dengsh12 closed 1 month ago

dengsh12 commented 1 month ago

Proposed changes

In the past, when people want to add support for new dynamic modules, or update current existing directive definitions in nginx-go-crossplane, they always need to look at documents or source codes and find the definition of directives.

In this PR, we provide a command line tool, which can read from a directory containing source codes, and generate the corresponding supporting file. The supporting file will include a map from directives to their bitmask definitions, and a public MatchFunc to match them. It will be in the same format of currently existing supporting files like analyze_otel_directives.go, analyze_oss_latest_directives.go.

Checklist

Before creating a PR, run through this checklist and mark each as complete.