Documentation ¶
Overview ¶
Code adapted from: https://github.com/kubernetes-sigs/controller-tools/blob/6eef398/cmd/controller-gen/main.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶
type Generator interface { // Generate invokes the Generator, usually writing a file to disk or memory // depending on what output rules are set. Generate() error }
Generator can generate artifacts using data contained in the Generator.
type OutputToCachedDirectory ¶
type OutputToCachedDirectory struct {
Dir string
}
OutputToCachedDirectory configures a generator runtime to output files to a directory. The output option rule string is formatted as follows:
- output:<generator>:<form>:dir (per-generator output) - output:<form>:dir (default output)
where <generator> is the generator's registered string name and <form> is the output rule's registered form string. See the CRD generator for an example of how this is used.
func (OutputToCachedDirectory) Open ¶
func (o OutputToCachedDirectory) Open(_ *loader.Package, path string) (io.WriteCloser, error)
Open is used to generate a CRD manifest in cache at path.
type Runner ¶
type Runner interface { // AddOutputRule associates an OutputRule with a definition name in the // Runner's generator. AddOutputRule(string, genall.OutputRule) // Run creates a generator runtime by passing in rawOpts, a raw set of option // strings, and invokes the runtime. Run([]string) error }
Runner runs a generator.
func NewCachedRunner ¶
func NewCachedRunner() Runner
NewCachedRunner returns a cachedRunner with a set of default generators and output rules. The returned cachedRunner is lazily initialized.